-
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.
Add Message for Delete Member Event (#530)
Co-authored-by: kohlros <[email protected]> Co-authored-by: kohlros <[email protected]>
- Loading branch information
1 parent
b48d4fb
commit 1bc0a75
Showing
23 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
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: 2 additions & 2 deletions
4
packages/TelegramClient-Core.package/TCCAddMembersMessage.class/methodProperties.json
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,8 +1,8 @@ | ||
{ | ||
"class" : { | ||
"newFrom:" : "rgw 7/21/2022 13:36" }, | ||
"newFrom:" : "LR 7/23/2022 10:06" }, | ||
"instance" : { | ||
"asSnippet" : "rgw 7/21/2022 14:15", | ||
"asText" : "rgw 7/21/2022 15:06", | ||
"asText" : "LR 7/23/2022 10:59", | ||
"members" : "rgw 7/21/2022 13:33", | ||
"members:" : "rgw 7/21/2022 13:33" } } |
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
1 change: 1 addition & 0 deletions
1
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/README.md
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 @@ | ||
Reprents a message where a member is removed from a group. |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/class/newFrom..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,6 @@ | ||
instance creation | ||
newFrom: aJsonObject | ||
|
||
^ self new | ||
member: (aJsonObject at: 'user_id'); | ||
yourself |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asSnippet.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 @@ | ||
accessing | ||
asSnippet | ||
|
||
^ self asText |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asText.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,6 @@ | ||
accessing | ||
asText | ||
|
||
| name | | ||
name := (self core userStore getUserFor: self member) fullName. | ||
^ 'Removed: ' , name |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member..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 @@ | ||
accessing | ||
member: aUserId | ||
|
||
member := aUserId |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member.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 @@ | ||
accessing | ||
member | ||
|
||
^ member |
8 changes: 8 additions & 0 deletions
8
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/methodProperties.json
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,8 @@ | ||
{ | ||
"class" : { | ||
"newFrom:" : "LR 7/23/2022 10:41" }, | ||
"instance" : { | ||
"asSnippet" : "LR 7/23/2022 10:43", | ||
"asText" : "LR 7/23/2022 10:45", | ||
"member" : "LR 7/23/2022 10:56", | ||
"member:" : "LR 7/23/2022 10:57" } } |
14 changes: 14 additions & 0 deletions
14
packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/properties.json
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,14 @@ | ||
{ | ||
"category" : "TelegramClient-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "LR 7/23/2022 10:54", | ||
"instvars" : [ | ||
"member" ], | ||
"name" : "TCCDeleteMemberMessage", | ||
"pools" : [ | ||
], | ||
"super" : "TCCUserMessage", | ||
"type" : "normal" } |
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
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
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
12 changes: 12 additions & 0 deletions
12
...ge/TCTCMessageTests.class/instance/testMessageDeleteMemberCorrectlyConstructedFromJson.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,12 @@ | ||
testing | ||
testMessageDeleteMemberCorrectlyConstructedFromJson | ||
|
||
| chat deleteMemberEvent deleteMemberMessage | | ||
|
||
chat := TCTMMocks mockBasicGroupChat. | ||
deleteMemberEvent := TCTMMocks mockMessageDeleteMemberWith: TCTMMocks mockUser1 id from: chat id. | ||
deleteMemberMessage := TCCUserMessage newFromMessageEvent: deleteMemberEvent in: chat with: self core. | ||
|
||
self assert: deleteMemberMessage member equals: (TCTMMocks mockUser1 id). | ||
self assert: 'Removed: Test User' equals: deleteMemberMessage asSnippet. | ||
self assert: 'Removed: Test User' equals: deleteMemberMessage asText |
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
19 changes: 19 additions & 0 deletions
19
...legramClientTests-Misc.package/TCTMMocks.class/class/mockMessageDeleteMemberWith.from..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,19 @@ | ||
message - json | ||
mockMessageDeleteMemberWith: aUserId from: aChatId | ||
|
||
^ (JsonObject newFrom: { | ||
'@type' -> 'message'. | ||
'id' -> self mockMessageId. | ||
'chat_id' -> aChatId. | ||
'sender_id' -> (JsonObject newFrom: { | ||
'@type' -> #messageSenderChat. | ||
'user_id' -> self mockUser1 id | ||
}). | ||
'content' -> (JsonObject newFrom: { | ||
'@type'->'messageChatDeleteMember'. | ||
'user_id'-> aUserId | ||
}). | ||
'is_outgoing' -> false. | ||
'reply_to_message_id' -> 0. | ||
'date' -> self mockMessageTimestamp | ||
}) |
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
11 changes: 11 additions & 0 deletions
11
...TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessage.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,11 @@ | ||
testing | ||
testDeleteMemberMessage | ||
|
||
| deleteMemberEvent deleteMemberMessage chat | | ||
|
||
chat := TCTMMocks mockBasicGroupChat. | ||
deleteMemberEvent := TCTMMocks mockMessageDeleteMemberWith: TCTMMocks mockUser1 id from: chat id. | ||
deleteMemberMessage := TCCUserMessage newFromMessageEvent: deleteMemberEvent in: chat with: self core. | ||
|
||
self wantsToTest: (TCUMessage newFrom: deleteMemberMessage). | ||
self assertReading: 'Removed: Test User' in: self subject |
11 changes: 11 additions & 0 deletions
11
...sts-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessageIsNotUserMessage.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,11 @@ | ||
testing | ||
testDeleteMemberMessageIsNotUserMessage | ||
|
||
| deleteMemberEvent deleteMemberMessage chat | | ||
|
||
chat := TCTMMocks mockBasicGroupChat. | ||
deleteMemberEvent := TCTMMocks mockMessageDeleteMemberWith: TCTMMocks mockUser1 id from: chat id. | ||
deleteMemberMessage := TCCUserMessage newFromMessageEvent: deleteMemberEvent in: chat with: self core. | ||
|
||
self wantsToTest: (TCUMessage newFrom: deleteMemberMessage). | ||
self deny: self subject isUserMessage |
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