diff --git a/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/instance/asText.st b/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/instance/asText.st index 1367fd2d..85b41f48 100644 --- a/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/instance/asText.st +++ b/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/instance/asText.st @@ -2,6 +2,5 @@ accessing asText | names | - names := self members collect: [:aUserId | (self core userStore getUserFor: aUserId) fullName]. ^ 'Added: ' , (names joinSeparatedBy: ', ') \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/methodProperties.json index 1eace309..abb0c803 100644 --- a/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCAddMembersMessage.class/methodProperties.json @@ -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" } } diff --git a/packages/TelegramClient-Core.package/TCCChat.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCChat.class/methodProperties.json index 76eaff6a..2da73f19 100644 --- a/packages/TelegramClient-Core.package/TCCChat.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCChat.class/methodProperties.json @@ -38,7 +38,7 @@ "isPrivate" : "per 6/4/2021 14:42", "isSuperGroup" : "per 6/15/2021 08:09", "lastMessage" : "aka 7/14/2022 14:28", - "lastMessageDate" : " 7/22/2022 10:40:18", + "lastMessageDate" : "7/22/2022 10:40:18", "lastMessageId" : "JB 8/4/2021 00:10", "lastMessageSenderId" : "LR 7/14/2022 12:16", "lastMessageSenderId:" : "LR 7/14/2022 15:11", diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/README.md b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/README.md new file mode 100644 index 00000000..bc6eaac0 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/README.md @@ -0,0 +1 @@ +Reprents a message where a member is removed from a group. \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/class/newFrom..st new file mode 100644 index 00000000..7fc15afb --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/class/newFrom..st @@ -0,0 +1,6 @@ +instance creation +newFrom: aJsonObject + + ^ self new + member: (aJsonObject at: 'user_id'); + yourself \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asSnippet.st b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asSnippet.st new file mode 100644 index 00000000..e60b994b --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asSnippet.st @@ -0,0 +1,4 @@ +accessing +asSnippet + + ^ self asText \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asText.st b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asText.st new file mode 100644 index 00000000..170679d3 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/asText.st @@ -0,0 +1,6 @@ +accessing +asText + + | name | + name := (self core userStore getUserFor: self member) fullName. + ^ 'Removed: ' , name \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member..st b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member..st new file mode 100644 index 00000000..0cbe13d5 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member..st @@ -0,0 +1,4 @@ +accessing +member: aUserId + + member := aUserId \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member.st b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member.st new file mode 100644 index 00000000..7c71440a --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/instance/member.st @@ -0,0 +1,4 @@ +accessing +member + + ^ member \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/methodProperties.json new file mode 100644 index 00000000..149dba1d --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/methodProperties.json @@ -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" } } diff --git a/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/properties.json b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/properties.json new file mode 100644 index 00000000..2a56846a --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDeleteMemberMessage.class/properties.json @@ -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" } diff --git a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st index 36eb3aa0..1a104e89 100644 --- a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st +++ b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st @@ -5,4 +5,5 @@ newMessageWith: aJsonObject ['messageText'] -> [TCCTextMessage newFrom: aJsonObject]. ['messagePhoto'] -> [TCCPhotoMessage newFrom: aJsonObject]. ['messageChatAddMembers'] -> [TCCAddMembersMessage newFrom: aJsonObject]. + ['messageChatDeleteMember'] -> [TCCDeleteMemberMessage newFrom: aJsonObject]. } otherwise: [TCCNotSupportedMessage new] \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json index c3c4c4ef..4742f6b2 100644 --- a/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newMessageWith:" : "rgw 7/21/2022 13:43" }, + "newMessageWith:" : "LR 7/23/2022 10:44" }, "instance" : { "chat" : "aka 7/14/2022 16:41", "chat:" : "aka 7/14/2022 16:41", @@ -11,8 +11,8 @@ "date:" : "aka 7/14/2022 16:40", "id" : "aka 7/14/2022 16:40", "id:" : "aka 7/14/2022 16:40", - "initialize" : " 7/22/2022 10:40:18", - "isFirstMessageOfDay" : " 7/22/2022 10:40:18", - "isFirstMessageOfDay:" : " 7/22/2022 10:40:18", - "isLastMessageOfDay" : " 7/22/2022 10:40:18", - "isLastMessageOfDay:" : " 7/22/2022 10:40:18" } } + "initialize" : "7/22/2022 10:40:18", + "isFirstMessageOfDay" : "7/22/2022 10:40:18", + "isFirstMessageOfDay:" : "7/22/2022 10:40:18", + "isLastMessageOfDay" : "7/22/2022 10:40:18", + "isLastMessageOfDay:" : "7/22/2022 10:40:18" } } diff --git a/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json index 0452e681..7992ed1b 100644 --- a/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json @@ -5,13 +5,13 @@ "instance" : { "addAtBottom:" : "rgw 7/21/2022 15:02", "addAtTop:" : "rgw 7/21/2022 15:02", - "addBottomDayDividerForDate:" : " 7/22/2022 15:41:43", + "addBottomDayDividerForDate:" : "7/22/2022 15:41:43", "addMessages" : "RS 7/17/2021 17:40", "addTopDayDividerForDate:" : "js 7/18/2022 07:30", "chat" : "js 7/31/2020 16:39", "chat:" : "js 7/31/2020 16:39", "core" : "JB 6/26/2021 10:22", - "createDayDividerForDate:" : " 7/22/2022 15:41:43", + "createDayDividerForDate:" : "7/22/2022 15:41:43", "createMessageItemFrom:" : "rgw 7/21/2022 15:09", "displayChat:" : "RS 7/17/2021 11:54", "initialize" : "RS 7/17/2021 17:40", diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st index 28e31ec3..2189082d 100644 --- a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st +++ b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st @@ -5,6 +5,7 @@ newFrom: aCoreMessage [TCCTextMessage] -> [TCUTextMessage]. [TCCPhotoMessage] -> [TCUPhotoMessage]. [TCCAddMembersMessage] -> [TCUInfoMessage]. + [TCCDeleteMemberMessage] -> [TCUInfoMessage]. } otherwise: [TCUTextMessage]) basicNew messageModel: aCoreMessage; diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json index af3c5a0e..8bc490c2 100644 --- a/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "defaultBottomMargin" : "aka 7/14/2022 16:20", "defaultMargins" : "aka 7/14/2022 16:20", - "newFrom:" : "rgw 7/22/2022 15:13" }, + "newFrom:" : "LR 7/23/2022 10:44" }, "instance" : { "isUserMessage" : "rgw 7/21/2022 14:07", "messageModel" : "aka 7/14/2022 17:22", diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testMessageDeleteMemberCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testMessageDeleteMemberCorrectlyConstructedFromJson.st new file mode 100644 index 00000000..82250cb8 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testMessageDeleteMemberCorrectlyConstructedFromJson.st @@ -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 \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json index fdef1248..ef34f454 100644 --- a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json @@ -4,6 +4,7 @@ "instance" : { "testMessageAddMembersCorrectlyConstructedFromJson" : "rgw 7/21/2022 16:04", "testMessageCorrectlyConstructedFromJson" : "aka 7/14/2022 16:58", + "testMessageDeleteMemberCorrectlyConstructedFromJson" : "LR 7/23/2022 11:01", "testMessageHasTextRepresentation" : "tom.richter 6/26/2021 21:06", "testMessageIsReply" : "rgw 5/12/2022 16:40", "testMessageReplySnippetTruncates" : "aka 7/14/2022 16:56", diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockMessageDeleteMemberWith.from..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockMessageDeleteMemberWith.from..st new file mode 100644 index 00000000..0244c505 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockMessageDeleteMemberWith.from..st @@ -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 + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json index 3438f0ba..aaa40ee2 100644 --- a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json @@ -24,6 +24,7 @@ "mockMembers" : "rgw 6/2/2022 10:04", "mockMessageAddMembersFrom:to:" : "rgw 7/21/2022 15:05", "mockMessageDate" : "TR 6/25/2021 21:07", + "mockMessageDeleteMemberWith:from:" : "LR 7/23/2022 10:13", "mockMessageEventFrom:" : "pk 8/5/2021 17:09", "mockMessageFrom:with:" : "aka 7/14/2022 16:57", "mockMessageId" : "8/5/2021 21:14:18", diff --git a/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessage.st b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessage.st new file mode 100644 index 00000000..de141e23 --- /dev/null +++ b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessage.st @@ -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 \ No newline at end of file diff --git a/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessageIsNotUserMessage.st b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessageIsNotUserMessage.st new file mode 100644 index 00000000..cc99f6ea --- /dev/null +++ b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/instance/testDeleteMemberMessageIsNotUserMessage.st @@ -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 \ No newline at end of file diff --git a/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/methodProperties.json b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/methodProperties.json index 4acccd0e..e73a1e16 100644 --- a/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/methodProperties.json +++ b/packages/TelegramClientTests-UI.package/TCTUMessageTests.class/methodProperties.json @@ -7,6 +7,8 @@ "setUp" : "rgw 6/6/2022 18:42", "testAddMembersMessage" : "rgw 7/21/2022 16:02", "testAddMembersMessageIsNotUserMessage" : "rgw 7/21/2022 16:01", + "testDeleteMemberMessage" : "LR 7/23/2022 11:01", + "testDeleteMemberMessageIsNotUserMessage" : "LR 7/23/2022 11:02", "testMessageBetweenRequestsAnsweredMessage" : "LR 5/29/2022 17:34", "testMessageColorsDifferentForIncomingOutgoing" : "tom.richter 6/26/2021 17:23", "testMessageContainsDate" : "tom.richter 6/26/2021 17:23",