-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "generate callback ids in core, enforce register before send"
This reverts commit 62e01cc.
- Loading branch information
1 parent
62e01cc
commit 6dfaad0
Showing
20 changed files
with
40 additions
and
83 deletions.
There are no files selected for viewing
15 changes: 7 additions & 8 deletions
15
packages/TelegramClient-Core.package/TCCBasicGroupChat.class/instance/loadInfo.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
loading | ||
loadInfo | ||
|
||
| callbackID | | ||
callbackID := self core registerCallback: [:aBasicGroupFullInfoEvent | | ||
self | ||
memberCount: (aBasicGroupFullInfoEvent at: 'members') size; | ||
description: (aBasicGroupFullInfoEvent at: 'description'); | ||
addMembersFrom: (aBasicGroupFullInfoEvent at: 'members'). | ||
]. | ||
self core client send: (TCCRequest | ||
newWithType: 'getBasicGroupFullInfo' | ||
from: { | ||
'basic_group_id'->self groupId. | ||
'@extra'->callbackID}). | ||
'@extra'->self groupId}). | ||
self core registerCallback: [:aBasicGroupFullInfoEvent | | ||
self | ||
memberCount: (aBasicGroupFullInfoEvent at: 'members') size; | ||
description: (aBasicGroupFullInfoEvent at: 'description'). | ||
self addMembersFrom: (aBasicGroupFullInfoEvent at: 'members'). | ||
] with: self groupId asString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/TelegramClient-Core.package/TCCChat.class/instance/positionKnown..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
positionKnown: aBoolean | ||
|
||
positionKnown := aBoolean | ||
positionKnown := aBoolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
packages/TelegramClient-Core.package/TCCCore.class/instance/callbackCounter..st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/TelegramClient-Core.package/TCCCore.class/instance/callbackCounter.st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/TelegramClient-Core.package/TCCCore.class/instance/callbackCounterPreIncrement.st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages/TelegramClient-Core.package/TCCCore.class/instance/generateCallbackID.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
packages/TelegramClient-Core.package/TCCCore.class/instance/registerCallback..st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCCore.class/instance/registerCallback.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utility | ||
registerCallback: aClosure with: aCallbackId | ||
|
||
self pendingRequests at: (aCallbackId asString) put: aClosure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
packages/TelegramClient-Core.package/TCCSuperGroupChat.class/instance/loadGeneralInfo.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
loading | ||
loadGeneralInfo | ||
|
||
| callbackID | | ||
callbackID := self core | ||
registerCallback: [:aSupergroupFullInfoEvent | | ||
self | ||
memberCount: (aSupergroupFullInfoEvent at: 'member_count'); | ||
description: (aSupergroupFullInfoEvent at: 'description')]. | ||
|
||
|
||
self core client send: (TCCRequest | ||
newWithType: 'getSupergroupFullInfo' | ||
from: {'supergroup_id'->self groupId. | ||
'@extra'->callbackID}). | ||
'@extra'->self groupId}). | ||
|
||
self core | ||
registerCallback: [:aSupergroupFullInfoEvent | | ||
self | ||
memberCount: (aSupergroupFullInfoEvent at: 'member_count'); | ||
description: (aSupergroupFullInfoEvent at: 'description').] | ||
with: self groupId. |
12 changes: 6 additions & 6 deletions
12
packages/TelegramClient-Core.package/TCCSuperGroupChat.class/instance/loadMembers.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
loading | ||
loadMembers | ||
|
||
| callbackID | | ||
callbackID := self core | ||
registerCallback: [:aSupergroupMembersEvent | | ||
self addMembersFrom: (aSupergroupMembersEvent at: 'members')]. | ||
|
||
self core client send: (TCCRequest | ||
newWithType: 'getSupergroupMembers' | ||
from: {'supergroup_id'->self groupId. | ||
'offset'->self members size. | ||
'limit'->self class defaultLimit. | ||
'@extra'->callbackID}). | ||
'@extra'->('#', self groupId)}). | ||
|
||
self core | ||
registerCallback: [:aSupergroupMembersEvent | | ||
self addMembersFrom: (aSupergroupMembersEvent at: 'members').] | ||
with: '#', self groupId. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/TelegramClient-Core.package/TCCUsers.class/instance/requestUserFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
utility | ||
requestUserFor: aUserId | ||
|
||
| callbackID | | ||
callbackID := self core | ||
self core | ||
registerCallback: | ||
[:userEvent | (self at: aUserId) resolveWith: (TCCUser newFrom: userEvent)]. | ||
[:userEvent | (self at: aUserId) resolveWith: (TCCUser newFrom: userEvent)] | ||
with: (aUserId asString). | ||
|
||
self core requestUser: aUserId with: callbackID | ||
self core requestUser: aUserId with: aUserId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/TelegramClientTests-Core.package/TCTCCoreTests.class/instance/testCallbackID.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters