diff --git a/.squot-materialize b/.squot-materialize index 1ba7c640b..f10774ab4 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -5,6 +5,12 @@ ], #encoding : 'TXT' }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'file-icon.png' + ], + #encoding : Class [ #PNGReadWriter ] + }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', @@ -117,7 +123,7 @@ 'assets', 'logo.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @6 }, SquotCypressMapper { #package : MCPackage { @@ -169,6 +175,13 @@ ], #encoding : Class [ #JPEGReadWriter2 ] }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'play_circle_outline_icon.png' + ], + #encoding : @6 + }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', @@ -176,12 +189,5 @@ 'ci-linter.yml' ], #encoding : 'TXT' - }, - SquotImageMapper { - #path : FSAbsolutePath [ - 'assets', - 'play_circle_outline_icon.png' - ], - #encoding : @40 } ] \ No newline at end of file diff --git a/assets/playbutton.jpg b/assets/playbutton.jpg index a52a92c40..861291196 100644 Binary files a/assets/playbutton.jpg and b/assets/playbutton.jpg differ diff --git a/file-icon.png b/file-icon.png new file mode 100644 index 000000000..761424995 Binary files /dev/null and b/file-icon.png differ diff --git a/packages/TelegramClient-Core.package/TCCAnimatedStickerMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCAnimatedStickerMessage.class/methodProperties.json index 94ac2e205..5e6891589 100644 --- a/packages/TelegramClient-Core.package/TCCAnimatedStickerMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCAnimatedStickerMessage.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newFrom:" : "JK 5/31/2024 11:40" }, + "newFrom:" : "JK 6/23/2024 11:47" }, "instance" : { "asSnippet" : "RK 6/26/2021 11:37", "asText" : "rgw 5/12/2022 14:28", diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st index 67f26be2c..71e419f7e 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st @@ -10,8 +10,7 @@ initialize imageStore: (TCCImageStore newWith: self); videoStore: (TCCVideoStore newWith: self); stickerStore: (TCCStickerStore newWith: self); - callbackCounter: 0. - + callbackCounter: 0. "Mac users report serious slowdowns when receiveLoop is running at lower priority" "So we have to rely on just the delay" diff --git a/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json index 73838b180..83f675f43 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json @@ -22,7 +22,7 @@ "handlePendingEvent:" : "per 8/2/2021 15:05", "imageStore" : "pk 6/19/2021 17:15", "imageStore:" : "TR 6/22/2021 09:33", - "initialize" : "TU 6/14/2024 09:38", + "initialize" : "JK 6/20/2024 22:16", "initializeHandlers" : "RS 8/1/2021 12:53", "isClientAlive" : "js 5/28/2020 17:18", "loggedInUserId" : "pk 8/5/2021 17:04", diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/README.md b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/README.md new file mode 100644 index 000000000..2231c6be4 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/README.md @@ -0,0 +1 @@ +data-represantation of a single text message in a chat \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st new file mode 100644 index 000000000..b170102cb --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st @@ -0,0 +1,6 @@ +instance creation +newFrom: aJsonObject + + ^ self new + filename: ((aJsonObject at: 'document') at: 'file_name'); + yourself diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asSnippet.st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asSnippet.st new file mode 100644 index 000000000..4de843517 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asSnippet.st @@ -0,0 +1,4 @@ +accessing +asSnippet + + ^ self filename \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asText.st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asText.st new file mode 100644 index 000000000..a617c37f6 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/asText.st @@ -0,0 +1,4 @@ +accessing +asText + + ^ self filename \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename..st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename..st new file mode 100644 index 000000000..e8867db0b --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename..st @@ -0,0 +1,4 @@ +accessing +filename: aString + + filename := aString \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename.st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename.st new file mode 100644 index 000000000..bffd00bc8 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/filename.st @@ -0,0 +1,4 @@ +accessing +filename + + ^ filename \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json new file mode 100644 index 000000000..d7c6e18fc --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json @@ -0,0 +1,8 @@ +{ + "class" : { + "newFrom:" : "JK 6/23/2024 11:52" }, + "instance" : { + "asSnippet" : "AH 6/21/2024 13:54", + "asText" : "AH 6/21/2024 13:54", + "filename" : "AH 6/21/2024 13:54", + "filename:" : "AH 6/21/2024 13:55" } } diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/properties.json b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/properties.json new file mode 100644 index 000000000..7aaf07625 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "filename" ], + "name" : "TCCDocumentMessage", + "pools" : [ + ], + "super" : "TCCMessage", + "type" : "normal" } diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/class/imageFormFrom..st b/packages/TelegramClient-Core.package/TCCFileStore.class/class/imageFormFrom..st new file mode 100644 index 000000000..01f1dc7a4 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/class/imageFormFrom..st @@ -0,0 +1,4 @@ +utility +imageFormFrom: aString + + ^ Form fromFileNamed: aString \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormFor..st b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormFor..st new file mode 100644 index 000000000..96625f9bf --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormFor..st @@ -0,0 +1,7 @@ +utility +getFormFor: anImageId + + | promise | + promise := self getFormPromiseFor: anImageId. + promise wait. + ^ promise value \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormPromiseFor..st b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormPromiseFor..st new file mode 100644 index 000000000..c3738877d --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormPromiseFor..st @@ -0,0 +1,10 @@ +utility +getFormPromiseFor: anImageId + + | promise | + promise := self at: anImageId ifAbsent: [ + self at: anImageId put: Promise new. + self requestFileFor: anImageId with: (self at: anImageId). + self at: anImageId + ]. + ^ promise >>= [:aPath | self class imageFormFrom: aPath] \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json index 325d5428f..d3dada010 100644 --- a/packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json @@ -1,8 +1,11 @@ { "class" : { "extractPathFrom:" : "JK 6/12/2024 19:32", + "imageFormFrom:" : "JK 6/21/2024 13:53", "newWith:" : "pk 6/19/2021 18:09" }, "instance" : { "core" : "pk 6/19/2021 16:13", "core:" : "pk 6/19/2021 16:13", + "getFormFor:" : "JK 6/21/2024 13:30", + "getFormPromiseFor:" : "JK 6/21/2024 13:47", "requestFileFor:with:" : "JK 6/12/2024 19:23" } } diff --git a/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json index 2787be05f..c1a995105 100644 --- a/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json @@ -1,11 +1,11 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52", - "newWith:" : "6/14/2024 09:21:38" }, + "extractPathFrom:" : "6/23/2024 14:02:55", + "imageFormFrom:" : "6/23/2024 14:02:55", + "newWith:" : "6/23/2024 14:02:55" }, "instance" : { - "core" : "6/14/2024 09:21:38", - "core:" : "6/14/2024 09:21:38", - "getFormFor:" : "JK 5/16/2024 22:13", - "getFormPromiseFor:" : "rgw 6/6/2022 18:43", - "requestImageFor:with:" : "JK 6/12/2024 19:46" } } + "core" : "6/23/2024 14:02:55", + "core:" : "6/23/2024 14:02:55", + "getFormFor:" : "6/23/2024 14:02:55", + "getFormPromiseFor:" : "6/23/2024 14:02:55", + "requestImageFor:with:" : "6/22/2024 13:42:57" } } diff --git a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st index 18134d321..d11aa6764 100644 --- a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st +++ b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st @@ -8,6 +8,7 @@ newMessageWith: aJsonObject ['messagePhoto'] -> [TCCPhotoMessage newFrom: aJsonObject]. ['messageVideo'] -> [TCCVideoMessage newFrom: aJsonObject]. ['messageSticker'] -> [TCCStickerMessage newFrom: aJsonObject]. + ['messageDocument'] -> [TCCDocumentMessage 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 952409a2a..1c3ba8262 100644 --- a/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCMessage.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "maxReplySnippetSize" : "rgw 5/12/2022 16:05", "newFromMessageEvent:in:with:" : "rgw 6/2/2022 09:01", - "newMessageWith:" : "TU 6/14/2024 09:39", + "newMessageWith:" : "AH 6/21/2024 14:29", "timeStampToDateAndTime:" : "JB 5/16/2021 09:42" }, "instance" : { "asReplySnippet" : "rgw 5/12/2022 16:05", diff --git a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json index 2db6c5b97..dba5fbdef 100644 --- a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json @@ -22,7 +22,7 @@ "newSendMessage:to:asReplyTo:" : "JS 5/20/2022 10:02", "newSendPhoneNumber:" : "RS 6/23/2021 16:34", "newSendPhotoMessage:to:" : "ED 6/19/2024 12:10", - "newSendStickerMessage:to:" : "JK 5/28/2024 10:52", + "newSendStickerMessage:to:" : "JK 6/21/2024 14:08", "newSendVideoMessage:to:" : "ED 6/19/2024 12:22", "newSetPollAnswer:message:options:" : "TU 6/6/2024 01:15", "newUser:" : "JB 8/1/2021 11:55", diff --git a/packages/TelegramClient-Core.package/TCCStickerMessage.class/instance/asSnippet.st b/packages/TelegramClient-Core.package/TCCStickerMessage.class/instance/asSnippet.st index 0523cf614..29a78d2e3 100644 --- a/packages/TelegramClient-Core.package/TCCStickerMessage.class/instance/asSnippet.st +++ b/packages/TelegramClient-Core.package/TCCStickerMessage.class/instance/asSnippet.st @@ -1,4 +1,4 @@ accessing asSnippet - ^ 'Sticker' \ No newline at end of file + ^ 'Sticker: ', self stickerId \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCStickerMessage.class/methodProperties.json index ed660cbbc..cfb2db6b3 100644 --- a/packages/TelegramClient-Core.package/TCCStickerMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCStickerMessage.class/methodProperties.json @@ -1,9 +1,9 @@ { "class" : { "newAnimatedStickerFrom:" : "JK 5/31/2024 11:36", - "newFrom:" : "JK 5/31/2024 11:11" }, + "newFrom:" : "JK 6/23/2024 11:39" }, "instance" : { - "asSnippet" : "JK 5/16/2024 16:00", + "asSnippet" : "JK 6/23/2024 14:32", "asText" : "JK 5/16/2024 16:00", "height" : "JK 5/16/2024 16:01", "height:" : "JK 5/16/2024 16:01", diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/class/imageFormFrom..st b/packages/TelegramClient-Core.package/TCCStickerStore.class/class/imageFormFrom..st new file mode 100644 index 000000000..bee97c1fb --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/class/imageFormFrom..st @@ -0,0 +1,9 @@ +utility +imageFormFrom: aString + + | file byteArray | + file := FileStream fileNamed: aString. + file binary. + byteArray := file next: file size. + file close. + ^ (TCCLibWebP decode: byteArray). \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/class/newWith..st b/packages/TelegramClient-Core.package/TCCStickerStore.class/class/newWith..st index d560c0746..9641e71df 100644 --- a/packages/TelegramClient-Core.package/TCCStickerStore.class/class/newWith..st +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/class/newWith..st @@ -3,5 +3,5 @@ newWith: aCore ^ self new core: aCore; - stickerIds: OrderedCollection new; - yourself \ No newline at end of file + stickerSets: Dictionary new; + yourself. \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/downloadStickerSet..st b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/downloadStickerSet..st index 5557075b1..288ce25f2 100644 --- a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/downloadStickerSet..st +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/downloadStickerSet..st @@ -1,6 +1,6 @@ as yet unclassified downloadStickerSet: aStickerSet - + + self storeStickerSet: aStickerSet. (aStickerSet at: 'stickers') do: [:sticker | - self stickerIds add: ((sticker at: 'sticker') at: 'id'). self getFormPromiseFor: ((sticker at: 'sticker') at: 'id')]. \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/loadStickerIds.st b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/loadStickerIds.st new file mode 100644 index 000000000..1c603486a --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/loadStickerIds.st @@ -0,0 +1,9 @@ +as yet unclassified +loadStickerIds + + | sets | + + self core send: (TCCRequest getInstalledStickerSets) + thenDo: [:stickerEvent | sets := stickerEvent at: 'sets'. + sets do: [:setInfo | self core send: (TCCRequest getStickerSetFor: (setInfo at: 'id')) + thenDo: [:set | (set at: 'is_animated') ifFalse: [self storeStickerSet: set.]]]]. \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets..st b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets..st new file mode 100644 index 000000000..7360f4565 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets..st @@ -0,0 +1,4 @@ +accessing +stickerSets: aDictionary + + stickerSets := aDictionary \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets.st b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets.st new file mode 100644 index 000000000..02809923f --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/stickerSets.st @@ -0,0 +1,4 @@ +accessing +stickerSets + + ^ stickerSets \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/storeStickerSet..st b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/storeStickerSet..st new file mode 100644 index 000000000..194eeb430 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/instance/storeStickerSet..st @@ -0,0 +1,10 @@ +utility +storeStickerSet: aStickerSet + + | stickers | + + self stickerSets at: (aStickerSet at: 'id') ifAbsent: [ + stickers := OrderedCollection new. + (aStickerSet at: 'stickers') do: [:sticker | + stickers add: ((sticker at: 'sticker') at: 'id')]. + self stickerSets at: (aStickerSet at: 'id') put: stickers] \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json index fe61308a0..0c43de1ea 100644 --- a/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json @@ -1,15 +1,20 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "newWith:" : "JK 6/5/2024 12:01", - "stickerFormFrom:" : "JK 6/5/2024 11:15" }, + "extractPathFrom:" : "6/23/2024 14:02:55", + "imageFormFrom:" : "JK 6/21/2024 13:46", + "newWith:" : "JK 6/20/2024 22:18", + "stickerFormFrom:" : "6/23/2024 14:02:55" }, "instance" : { - "core" : "pk 6/19/2021 16:13", - "core:" : "pk 6/19/2021 16:13", - "downloadStickerSet:" : "JK 6/5/2024 12:07", - "getFormFor:" : "JK 6/5/2024 11:12", - "getFormPromiseFor:" : "JK 5/16/2024 21:21", - "getInstalledStickers" : "JK 6/5/2024 11:37", + "core" : "6/23/2024 14:02:55", + "core:" : "6/23/2024 14:02:55", + "downloadStickerSet:" : "JK 6/19/2024 11:33", + "getFormFor:" : "6/23/2024 14:02:55", + "getFormPromiseFor:" : "6/23/2024 14:02:55", + "getInstalledStickers" : "6/23/2024 17:46:17", + "loadStickerIds" : "JK 6/20/2024 23:39", "requestStickerFor:with:" : "JK 5/16/2024 21:40", - "stickerIds" : "JK 6/5/2024 11:41", - "stickerIds:" : "JK 6/5/2024 11:41" } } + "stickerIds" : "6/23/2024 17:46:17", + "stickerIds:" : "6/23/2024 17:46:17", + "stickerSets" : "JK 6/19/2024 11:30", + "stickerSets:" : "JK 6/19/2024 11:30", + "storeStickerSet:" : "JK 6/23/2024 16:33" } } diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json b/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json index 55edbaa6a..286ffca0b 100644 --- a/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json @@ -6,10 +6,9 @@ ], "commentStamp" : "", "instvars" : [ - "core", - "stickerIds" ], + "stickerSets" ], "name" : "TCCStickerStore", "pools" : [ ], - "super" : "Dictionary", + "super" : "TCCFileStore", "type" : "normal" } diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json index 97f215865..768223360 100644 --- a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newFrom:" : "JK 6/12/2024 11:28" }, + "newFrom:" : "JK 6/23/2024 11:14" }, "instance" : { "asSnippet" : "JK 6/12/2024 11:31", "asText" : "TR 6/20/2021 10:41", diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json index 18a5f48f4..c788988dd 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -1,9 +1,9 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52" }, + "extractPathFrom:" : "6/23/2024 14:02:55", + "imageFormFrom:" : "6/23/2024 14:02:55" }, "instance" : { - "getFormFor:" : "JK 6/12/2024 19:28", - "getFormPromiseFor:" : "JK 6/12/2024 19:30", + "getFormFor:" : "6/23/2024 14:02:55", + "getFormPromiseFor:" : "6/23/2024 14:02:55", "getVideoFor:" : "JK 6/12/2024 19:48", "getVideoPromiseFor:" : "JK 6/12/2024 19:56" } } diff --git a/packages/TelegramClient-UI.package/TCUChatMessageList.class/instance/createDayDividerForDate..st b/packages/TelegramClient-UI.package/TCUChatMessageList.class/instance/createDayDividerForDate..st index 455a377f9..4982b6089 100644 --- a/packages/TelegramClient-UI.package/TCUChatMessageList.class/instance/createDayDividerForDate..st +++ b/packages/TelegramClient-UI.package/TCUChatMessageList.class/instance/createDayDividerForDate..st @@ -2,6 +2,6 @@ stepping and presenter createDayDividerForDate: aDate | messageItem | - messageItem := TCUDayDividerMessage newFromDate: aDate. + messageItem := TCUDayDivider newFromDate: aDate. ^ TCUDayDividerMessageWrapper newFromMessage: messageItem withWidth: self scroller width \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json index 81ebcbe12..95826ab2e 100644 --- a/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatMessageList.class/methodProperties.json @@ -11,7 +11,7 @@ "chat" : "js 7/31/2020 16:39", "chat:" : "js 7/31/2020 16:39", "core" : "JB 6/26/2021 10:22", - "createDayDividerForDate:" : "js 7/31/2022 10:20", + "createDayDividerForDate:" : "AH 6/23/2024 13:00", "createMessageItemFrom:" : "js 7/31/2022 10:02", "displayChat:" : "RS 7/17/2021 11:54", "initialize" : "RS 7/17/2021 17:40", diff --git a/packages/TelegramClient-UI.package/TCUChatWindow.class/instance/buttonStickerPressed.st b/packages/TelegramClient-UI.package/TCUChatWindow.class/instance/buttonStickerPressed.st index 53739091d..1f33e24ac 100644 --- a/packages/TelegramClient-UI.package/TCUChatWindow.class/instance/buttonStickerPressed.st +++ b/packages/TelegramClient-UI.package/TCUChatWindow.class/instance/buttonStickerPressed.st @@ -3,10 +3,9 @@ buttonStickerPressed | stickerWindow | self stickerWindow ifNil: [ - stickerWindow := TCUStickerWindow new + stickerWindow := (TCUStickerList newWith: (self owner core)) position: (self position + (700 @ 50)); - selectedChat: self selectedChat; - core: (self owner core). + selectedChat: self selectedChat. self stickerWindow: stickerWindow. self addMorph: stickerWindow. self stickerButton makeLighter.] diff --git a/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json index a9375da50..94602a03b 100644 --- a/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json @@ -20,7 +20,7 @@ "addWelcomeMessage" : "RK 8/4/2021 12:07", "buttonFileSelectPressed" : "ED 6/19/2024 13:54", "buttonSendPressed" : "ek 6/19/2022 19:07", - "buttonStickerPressed" : "JK 6/5/2024 11:12", + "buttonStickerPressed" : "AH 6/23/2024 13:00", "chatMessageList" : "JB 7/6/2021 14:02", "chatMessageList:" : "JB 7/6/2021 14:02", "clear" : "JK 5/29/2024 20:29", diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/README.md b/packages/TelegramClient-UI.package/TCUDayDivider.class/README.md similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/README.md rename to packages/TelegramClient-UI.package/TCUDayDivider.class/README.md diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/defaultBorderWidth.st b/packages/TelegramClient-UI.package/TCUDayDivider.class/class/defaultBorderWidth.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/defaultBorderWidth.st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/class/defaultBorderWidth.st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/defaultLayoutInset.st b/packages/TelegramClient-UI.package/TCUDayDivider.class/class/defaultLayoutInset.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/defaultLayoutInset.st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/class/defaultLayoutInset.st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/newFromDate..st b/packages/TelegramClient-UI.package/TCUDayDivider.class/class/newFromDate..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/class/newFromDate..st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/class/newFromDate..st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/content..st b/packages/TelegramClient-UI.package/TCUDayDivider.class/instance/content..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/content..st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/instance/content..st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/content.st b/packages/TelegramClient-UI.package/TCUDayDivider.class/instance/content.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/content.st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/instance/content.st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/initialize.st b/packages/TelegramClient-UI.package/TCUDayDivider.class/instance/initialize.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/instance/initialize.st rename to packages/TelegramClient-UI.package/TCUDayDivider.class/instance/initialize.st diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUDayDivider.class/methodProperties.json similarity index 100% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/methodProperties.json rename to packages/TelegramClient-UI.package/TCUDayDivider.class/methodProperties.json diff --git a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/properties.json b/packages/TelegramClient-UI.package/TCUDayDivider.class/properties.json similarity index 87% rename from packages/TelegramClient-UI.package/TCUDayDividerMessage.class/properties.json rename to packages/TelegramClient-UI.package/TCUDayDivider.class/properties.json index ad647b1eb..d368f9488 100644 --- a/packages/TelegramClient-UI.package/TCUDayDividerMessage.class/properties.json +++ b/packages/TelegramClient-UI.package/TCUDayDivider.class/properties.json @@ -7,7 +7,7 @@ "commentStamp" : "aka 7/14/2022 15:07", "instvars" : [ "content" ], - "name" : "TCUDayDividerMessage", + "name" : "TCUDayDivider", "pools" : [ ], "super" : "RectangleMorph", diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/README.md b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/README.md new file mode 100644 index 000000000..6682e55d8 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/README.md @@ -0,0 +1 @@ +a single text message displayed in a TCUMessageList \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/getIcon.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/getIcon.st new file mode 100644 index 000000000..d45b09902 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/getIcon.st @@ -0,0 +1,5 @@ +asset +getIcon + + ^ (GitAssetLoader for: 'TelegramClient') loadForm: 'file-icon.png' + diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/maxHeight.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/maxHeight.st new file mode 100644 index 000000000..1f6efb168 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/class/maxHeight.st @@ -0,0 +1,4 @@ +default values +maxHeight + + ^ 200 \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addContent.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addContent.st new file mode 100644 index 000000000..0709ffb18 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addContent.st @@ -0,0 +1,5 @@ +constructing +addContent + + self addIcon. + self addText \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st new file mode 100644 index 000000000..94ac59d7e --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st @@ -0,0 +1,7 @@ +constructing +addIcon + + | iconForm | + iconForm := self class getIcon. + iconForm := iconForm scaledToHeight: self class maxHeight. + self addMorphBack: iconForm asMorph diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json new file mode 100644 index 000000000..37bd35ccb --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json @@ -0,0 +1,7 @@ +{ + "class" : { + "getIcon" : "AH 6/21/2024 14:08", + "maxHeight" : "AH 6/21/2024 14:32" }, + "instance" : { + "addContent" : "AH 6/21/2024 14:07", + "addIcon" : "AH 6/21/2024 14:10" } } diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/properties.json b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/properties.json new file mode 100644 index 000000000..a6b5626a2 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-UI", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCUDocumentMessage", + "pools" : [ + ], + "super" : "TCUUserMessage", + "type" : "normal" } diff --git a/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initialize.st b/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initialize.st index ff2ed3d6e..24ed7689e 100644 --- a/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initialize.st +++ b/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initialize.st @@ -8,6 +8,7 @@ initialize addHeader; chatWindow: TCUChatWindow new; addChatsList; + initializeStickerStore; initializeChatWindow; subscribeChatsList; clipSubmorphs: true. diff --git a/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initializeStickerStore.st b/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initializeStickerStore.st new file mode 100644 index 000000000..47ed49354 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUMainWindow.class/instance/initializeStickerStore.st @@ -0,0 +1,4 @@ +initialization +initializeStickerStore + + self core stickerStore loadStickerIds \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUMainWindow.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUMainWindow.class/methodProperties.json index 75c047977..e03b543a6 100644 --- a/packages/TelegramClient-UI.package/TCUMainWindow.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUMainWindow.class/methodProperties.json @@ -15,8 +15,9 @@ "deleteMorph" : "RS 7/17/2021 12:20", "header" : "r.s 8/2/2020 19:07", "header:" : "r.s 8/2/2020 19:08", - "initialize" : "RS 7/17/2021 17:47", + "initialize" : "JK 6/20/2024 22:24", "initializeChatWindow" : "RS 7/17/2021 12:01", + "initializeStickerStore" : "JK 6/20/2024 22:28", "logout" : "RS 7/31/2021 15:57", "newMessageReceived:" : "per 6/16/2021 17:36", "subscribeChatsList" : "RS 7/17/2021 11:48" } } diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st index 6ef7fbeea..63d477460 100644 --- a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st +++ b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st @@ -7,6 +7,7 @@ newFrom: aCoreMessage [TCCPhotoMessage] -> [TCUPhotoMessage]. [TCCVideoMessage] -> [TCUVideoMessage]. [TCCStickerMessage] -> [TCUStickerMessage]. + [TCCDocumentMessage] -> [TCUDocumentMessage]. [TCCAddMembersMessage] -> [TCUInfoMessage]. [TCCDeleteMemberMessage] -> [TCUInfoMessage]. [TCCAnimatedStickerMessage] -> [TCUAnimatedStickerMessage]. diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json index 35e5f89ef..0e6cb3b4e 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:" : "TU 6/14/2024 09:39" }, + "newFrom:" : "AH 6/21/2024 14:31" }, "instance" : { "handlesMouseDown:" : "js 7/31/2022 11:13", "isUserMessage" : "rgw 7/21/2022 14:07", diff --git a/packages/TelegramClient-UI.package/TCUPollOption.class/instance/initializeWith.and..st b/packages/TelegramClient-UI.package/TCUPollOption.class/instance/initializeWith.and..st index 9200015e3..4bb073b6e 100644 --- a/packages/TelegramClient-UI.package/TCUPollOption.class/instance/initializeWith.and..st +++ b/packages/TelegramClient-UI.package/TCUPollOption.class/instance/initializeWith.and..st @@ -1,5 +1,6 @@ as yet unclassified initializeWith: aPollMessage and: anOption + | text | pollMessage := aPollMessage. pollOption := anOption. @@ -9,8 +10,9 @@ initializeWith: aPollMessage and: anOption selectionMorph color: aPollMessage messageColor; extent: 16@16. + text := (anOption votePercentage asString),'% ',(anOption text). textMorph := aPollMessage class defaultTextMorph - contents: (TCUEmojiHelper embedEmojisInto: anOption text); + contents: (TCUEmojiHelper embedEmojisInto: text); hResizing: #spaceFill; color: Color white; margins: aPollMessage class defaultMargins; diff --git a/packages/TelegramClient-UI.package/TCUPollOption.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUPollOption.class/methodProperties.json index 2a5df1640..541b76960 100644 --- a/packages/TelegramClient-UI.package/TCUPollOption.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUPollOption.class/methodProperties.json @@ -4,10 +4,10 @@ "new:" : "6/14/2024 00:26:16", "new:with:" : "F.M. 6/5/2024 14:49" }, "instance" : { - "initializeWith:" : "6/14/2024 09:29:43", - "initializeWith:and:" : "TU 6/14/2024 00:31", + "initializeWith:" : "AH 6/21/2024 14:33", + "initializeWith:and:" : "TU 6/20/2024 21:56", "mouseDown:" : "TU 6/6/2024 01:46", - "selected" : "6/14/2024 09:29:43", - "selected:" : "6/14/2024 09:29:43", + "selected" : "AH 6/21/2024 14:33", + "selected:" : "AH 6/21/2024 14:33", "updateSelection" : "TU 6/14/2024 00:29", - "updateText:" : "6/14/2024 09:29:43" } } + "updateText:" : "AH 6/21/2024 14:33" } } diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/README.md b/packages/TelegramClient-UI.package/TCUStickerList.class/README.md similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/README.md rename to packages/TelegramClient-UI.package/TCUStickerList.class/README.md diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/class/newWith..st b/packages/TelegramClient-UI.package/TCUStickerList.class/class/newWith..st new file mode 100644 index 000000000..eee119bc7 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/class/newWith..st @@ -0,0 +1,7 @@ +as yet unclassified +newWith: aCore + + ^ self basicNew + core: aCore; + initialize; + yourself \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/addCloseButton.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addCloseButton.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/addCloseButton.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/addCloseButton.st diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addNextButton.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addNextButton.st new file mode 100644 index 000000000..05b7588dd --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addNextButton.st @@ -0,0 +1,15 @@ +drawing +addNextButton + + | nextButton | + + nextButton := TCUButton new + extent: 30 @ 30; + text: '>'; + color: TCUDefaultValues colorLightBlue; + on: #mouseUp send: #showNextSet to: self; + yourself. + nextButton text color: Color white. + nextButton position: self position + (70 @ 0). + + self addMorph: nextButton. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addPreviousButton.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addPreviousButton.st new file mode 100644 index 000000000..ca6fa32f0 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/addPreviousButton.st @@ -0,0 +1,15 @@ +drawing +addPreviousButton + + | previousButton | + + previousButton := TCUButton new + extent: 30 @ 30; + text: '<'; + color: TCUDefaultValues colorLightBlue; + on: #mouseUp send: #showPreviousSet to: self; + yourself. + previousButton text color: Color white. + previousButton position: self position + (35 @ 0). + + self addMorph: previousButton. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItems.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItems.st similarity index 88% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItems.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItems.st index bae06d9db..bc9168d79 100644 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItems.st +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItems.st @@ -4,7 +4,7 @@ buildStickerListItems | stickers item | stickers := OrderedCollection new. - (self core stickerStore stickerIds) do: [:sticker | + (self core stickerStore keys) do: [:sticker | item := (TCUStickerListItem new image: ((self core stickerStore getFormFor: sticker) scaledToWidth: 100); id: sticker; diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItemsFor..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItemsFor..st new file mode 100644 index 000000000..91cfa6bb3 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/buildStickerListItemsFor..st @@ -0,0 +1,16 @@ +drawing +buildStickerListItemsFor: anArray + + | stickers item | + + stickers := OrderedCollection new. + anArray do: [:stickerId | + item := (TCUStickerListItem new + image: ((self core stickerStore getFormFor: stickerId) scaledToWidth: 100); + id: stickerId; + selectedChat: self selectedChat; + path: ((self core stickerStore at: stickerId) value)). + item on: #mouseDown send: #sendStickerMessage:event:from: to: self selectedChat withValue: stickerId. + stickers add: item]. + self items: stickers. + \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/close.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/close.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/close.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/close.st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/collectInstalledStickers.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/collectInstalledStickers.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/collectInstalledStickers.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/collectInstalledStickers.st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/convertWebp..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/convertWebp..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/convertWebp..st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/convertWebp..st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/core..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/core..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/core..st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/core..st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/core.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/core.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/core.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/core.st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/downloadStickerSetFrom..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/downloadStickerSetFrom..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/downloadStickerSetFrom..st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/downloadStickerSetFrom..st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/initialize.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/initialize.st similarity index 63% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/initialize.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/initialize.st index 7770f5b60..6f7cdde09 100644 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/initialize.st +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/initialize.st @@ -5,5 +5,6 @@ initialize self extent: 110 @ 590; shouldRedraw: true; - addCloseButton. - "loadStickers." \ No newline at end of file + addCloseButton; + addPreviousButton; + addNextButton. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/loadStickers.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/loadStickers.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/loadStickers.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/loadStickers.st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/loadStickersFromStore.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/loadStickersFromStore.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/loadStickersFromStore.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/loadStickersFromStore.st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/selectedChat..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedChat..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/selectedChat..st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedChat..st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/selectedChat.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedChat.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/selectedChat.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedChat.st diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet..st new file mode 100644 index 000000000..12c306984 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet..st @@ -0,0 +1,4 @@ +accessing +selectedSet: aSetId + + selectedSet := aSetId \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet.st new file mode 100644 index 000000000..71db8084a --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/selectedSet.st @@ -0,0 +1,4 @@ +accessing +selectedSet + + ^ selectedSet \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/shouldRedraw..st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/shouldRedraw..st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/shouldRedraw..st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/shouldRedraw..st diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/shouldRedraw.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/shouldRedraw.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/shouldRedraw.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/shouldRedraw.st diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showNextSet.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showNextSet.st new file mode 100644 index 000000000..45830aa15 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showNextSet.st @@ -0,0 +1,10 @@ +drawing +showNextSet + + | keyArray | + keyArray := self core stickerStore stickerSets keysInOrder. + (keyArray size > (keyArray indexOf: (self selectedSet))) ifTrue: [ + self selectedSet: (keyArray at: ((keyArray indexOf: (self selectedSet)) + 1))] + ifFalse: [self selectedSet: (keyArray at: 1)]. + self showSelectedSet + \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showPreviousSet.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showPreviousSet.st new file mode 100644 index 000000000..ff7e3dacd --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showPreviousSet.st @@ -0,0 +1,10 @@ +drawing +showPreviousSet + + | keyArray | + + keyArray := self core stickerStore stickerSets keysInOrder. + (1 ~= (keyArray indexOf: (self selectedSet))) ifTrue: [ + self selectedSet: ((keyArray at: (keyArray indexOf: (self selectedSet)) - 1))] + ifFalse: [self selectedSet: (keyArray at: keyArray size)]. + self showSelectedSet \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showSelectedSet.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showSelectedSet.st new file mode 100644 index 000000000..4180e1b74 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/showSelectedSet.st @@ -0,0 +1,9 @@ +drawing +showSelectedSet + + | stickers | + self clearItems. + stickers := self core stickerStore stickerSets at: self selectedSet. + self buildStickerListItemsFor: stickers. + self items do: [:anItem | self scroller addMorphBack: anItem]. + \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/instance/step.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/step.st new file mode 100644 index 000000000..0bd3ac38c --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/step.st @@ -0,0 +1,7 @@ +stepping and presenter +step + + self shouldRedraw ifTrue: [ + self selectedSet: ((self core stickerStore stickerSets keysInOrder) at: 1). + self showSelectedSet. + self shouldRedraw: false] \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/stepTime.st b/packages/TelegramClient-UI.package/TCUStickerList.class/instance/stepTime.st similarity index 100% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/stepTime.st rename to packages/TelegramClient-UI.package/TCUStickerList.class/instance/stepTime.st diff --git a/packages/TelegramClient-UI.package/TCUStickerList.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUStickerList.class/methodProperties.json new file mode 100644 index 000000000..0b9911718 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/methodProperties.json @@ -0,0 +1,29 @@ +{ + "class" : { + "newWith:" : "JK 6/20/2024 23:46" }, + "instance" : { + "addCloseButton" : "JK 5/21/2024 10:22", + "addNextButton" : "JK 6/19/2024 12:03", + "addPreviousButton" : "JK 6/19/2024 12:04", + "buildStickerListItems" : "6/23/2024 14:02:54", + "buildStickerListItemsFor:" : "JK 6/21/2024 14:07", + "close" : "JK 5/29/2024 20:09", + "collectInstalledStickers" : "6/23/2024 14:02:54", + "convertWebp:" : "6/22/2024 13:42:57", + "core" : "JK 5/31/2024 14:29", + "core:" : "JK 5/31/2024 14:29", + "downloadStickerSetFrom:" : "6/23/2024 14:02:54", + "initialize" : "JK 6/20/2024 23:42", + "loadStickers" : "6/23/2024 14:02:54", + "loadStickersFromStore" : "6/23/2024 14:02:54", + "selectedChat" : "JK 5/28/2024 10:22", + "selectedChat:" : "JK 5/28/2024 10:23", + "selectedSet" : "JK 6/20/2024 11:39", + "selectedSet:" : "JK 6/20/2024 11:39", + "shouldRedraw" : "JK 5/22/2024 20:12", + "shouldRedraw:" : "JK 5/22/2024 20:12", + "showNextSet" : "JK 6/21/2024 00:08", + "showPreviousSet" : "JK 6/21/2024 00:08", + "showSelectedSet" : "JK 6/21/2024 00:09", + "step" : "JK 6/21/2024 00:09", + "stepTime" : "JK 5/22/2024 19:59" } } diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/properties.json b/packages/TelegramClient-UI.package/TCUStickerList.class/properties.json similarity index 80% rename from packages/TelegramClient-UI.package/TCUStickerWindow.class/properties.json rename to packages/TelegramClient-UI.package/TCUStickerList.class/properties.json index af0d7d796..982d4e891 100644 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/properties.json +++ b/packages/TelegramClient-UI.package/TCUStickerList.class/properties.json @@ -9,8 +9,9 @@ "closeButton", "shouldRedraw", "selectedChat", - "core" ], - "name" : "TCUStickerWindow", + "core", + "selectedSet" ], + "name" : "TCUStickerList", "pools" : [ ], "super" : "TCUList", diff --git a/packages/TelegramClient-UI.package/TCUStickerListItem.class/instance/mouseDown..st b/packages/TelegramClient-UI.package/TCUStickerListItem.class/instance/mouseDown..st index 8a02d46a1..99ce3f610 100644 --- a/packages/TelegramClient-UI.package/TCUStickerListItem.class/instance/mouseDown..st +++ b/packages/TelegramClient-UI.package/TCUStickerListItem.class/instance/mouseDown..st @@ -1,5 +1,4 @@ event handling mouseDown: anEvent - self selectedChat sendStickerMessage: path. - "Transcript show: self asString." \ No newline at end of file + self selectedChat sendStickerMessage: self path. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerListItem.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUStickerListItem.class/methodProperties.json index be03645a0..08cfdde96 100644 --- a/packages/TelegramClient-UI.package/TCUStickerListItem.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUStickerListItem.class/methodProperties.json @@ -4,7 +4,7 @@ "instance" : { "id" : "JK 6/5/2024 11:46", "id:" : "JK 6/5/2024 11:46", - "mouseDown:" : "JK 5/28/2024 11:57", + "mouseDown:" : "JK 6/21/2024 14:00", "path" : "JK 5/28/2024 09:45", "path:" : "JK 5/28/2024 09:45", "selectedChat" : "JK 5/28/2024 10:20", diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/step.st b/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/step.st deleted file mode 100644 index 3ed514698..000000000 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/step.st +++ /dev/null @@ -1,8 +0,0 @@ -stepping and presenter -step - - self shouldRedraw ifTrue: [ - self core stickerStore getInstalledStickers. - self buildStickerListItems. - self items do: [:anItem | self scroller addMorphBack: anItem]. - self shouldRedraw: false] \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json deleted file mode 100644 index 7f82db6c1..000000000 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "addCloseButton" : "JK 5/21/2024 10:22", - "buildStickerListItems" : "JK 6/5/2024 12:09", - "close" : "JK 5/29/2024 20:09", - "collectInstalledStickers" : "6/7/2024 09:02:10", - "convertWebp:" : "TU 5/29/2024 15:05", - "core" : "JK 5/31/2024 14:29", - "core:" : "JK 5/31/2024 14:29", - "downloadStickerSetFrom:" : "6/7/2024 09:02:10", - "initialize" : "JK 5/31/2024 14:35", - "loadStickers" : "JK 6/5/2024 11:45", - "loadStickersFromStore" : "JK 6/4/2024 11:57", - "selectedChat" : "JK 5/28/2024 10:22", - "selectedChat:" : "JK 5/28/2024 10:23", - "shouldRedraw" : "JK 5/22/2024 20:12", - "shouldRedraw:" : "JK 5/22/2024 20:12", - "step" : "JK 6/5/2024 12:07", - "stepTime" : "JK 5/22/2024 19:59" } } diff --git a/packages/TelegramClientTests-Core.package/.squot-contents b/packages/TelegramClientTests-Core.package/.squot-contents deleted file mode 100644 index 239ddebb0..000000000 --- a/packages/TelegramClientTests-Core.package/.squot-contents +++ /dev/null @@ -1,5 +0,0 @@ -SquotTrackedObjectMetadata { - #objectClassName : #PackageInfo, - #objectsReplacedByNames : true, - #serializer : #SquotCypressCodeSerializer -} \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testChatCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testChatCorrectlyConstructedFromJson.st index 1eb6f985e..e6446e2a7 100644 --- a/packages/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testChatCorrectlyConstructedFromJson.st +++ b/packages/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testChatCorrectlyConstructedFromJson.st @@ -2,7 +2,7 @@ testing testChatCorrectlyConstructedFromJson | mockChat | - + mockChat := TCCChat newFromChatEvent: (TCTMMocks mockChatEvent at: 'chat'). self assert: 'MockChat' equals: mockChat title. diff --git a/packages/TelegramClientTests-Core.package/TCTCChatTests.class/methodProperties.json b/packages/TelegramClientTests-Core.package/TCTCChatTests.class/methodProperties.json index 484f07d4b..afce88d3f 100644 --- a/packages/TelegramClientTests-Core.package/TCTCChatTests.class/methodProperties.json +++ b/packages/TelegramClientTests-Core.package/TCTCChatTests.class/methodProperties.json @@ -8,7 +8,7 @@ "testAddMessage" : "rgw 8/5/2022 09:47", "testAddNewestMessage" : "aka 7/10/2022 12:30", "testAddOldestMessage" : "aka 7/10/2022 12:31", - "testChatCorrectlyConstructedFromJson" : "js 6/18/2022 10:46", + "testChatCorrectlyConstructedFromJson" : "JK 6/21/2024 15:23", "testChatNoPhotoCorrectlyConstructedFromJson" : "rgw 6/2/2022 16:17", "testGetMessageById" : "rgw 8/5/2022 09:41", "testHandleMessageRequest" : "aka 6/15/2022 11:54", diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageCorrectlyConstructedFromJson.st new file mode 100644 index 000000000..34cf9b098 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageCorrectlyConstructedFromJson.st @@ -0,0 +1,12 @@ +testing +testAnimatedStickerMessageCorrectlyConstructedFromJson + + | stickerMessageEvent chat stickerMessage | + + chat := TCTMMocks mockPrivateChat. + stickerMessageEvent := TCTMMocks mockAnimatedStickerMessageJsonFrom: chat id. + stickerMessage := TCCMessage newFromMessageEvent: stickerMessageEvent in: chat with: self core. + + self assert: TCTMMocks mockValidEmoji equals: stickerMessage text. + self assert: TCTMMocks mockValidEmoji equals: stickerMessage asSnippet. + self assert: TCTMMocks mockValidEmoji equals: stickerMessage asText. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageTypeIdentifiedCorrectly.st new file mode 100644 index 000000000..ab40c68da --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testAnimatedStickerMessageTypeIdentifiedCorrectly.st @@ -0,0 +1,10 @@ +testing +testAnimatedStickerMessageTypeIdentifiedCorrectly + + | stickerMessageEvent chat stickerMessage | + + chat := TCTMMocks mockPrivateChat. + stickerMessageEvent := TCTMMocks mockAnimatedStickerMessageJsonFrom: chat id. + stickerMessage := TCCMessage newFromMessageEvent: stickerMessageEvent in: chat with: self core. + + self assert: TCCAnimatedStickerMessage equals: stickerMessage class. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageCorrectlyConstructedFromJson.st new file mode 100644 index 000000000..5aaff8f34 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageCorrectlyConstructedFromJson.st @@ -0,0 +1,12 @@ +testing +testDocumentMessageCorrectlyConstructedFromJson + + | documentMessageEvent chat documentMessage | + + chat := TCTMMocks mockPrivateChat. + documentMessageEvent := TCTMMocks mockDocumentMessageJsonFrom: chat id. + documentMessage := TCCMessage newFromMessageEvent: documentMessageEvent in: chat with: self core. + + self assert: TCTMMocks mockDocumentFileName equals: documentMessage filename. + self assert: TCTMMocks mockDocumentFileName equals: documentMessage asSnippet. + self assert: TCTMMocks mockDocumentFileName equals: documentMessage asText. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageTypeIdentifiedCorrectly.st new file mode 100644 index 000000000..2bb53d975 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testDocumentMessageTypeIdentifiedCorrectly.st @@ -0,0 +1,10 @@ +testing +testDocumentMessageTypeIdentifiedCorrectly + + | documentMessageEvent chat documentMessage | + + chat := TCTMMocks mockPrivateChat. + documentMessageEvent := TCTMMocks mockDocumentMessageJsonFrom: chat id. + documentMessage := TCCMessage newFromMessageEvent: documentMessageEvent in: chat with: self core. + + self assert: TCCDocumentMessage equals: documentMessage class. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPhotoMessageCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPhotoMessageCorrectlyConstructedFromJson.st index 5cae7fa86..59f9f9a89 100644 --- a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPhotoMessageCorrectlyConstructedFromJson.st +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPhotoMessageCorrectlyConstructedFromJson.st @@ -8,7 +8,9 @@ testPhotoMessageCorrectlyConstructedFromJson photoMessage := TCCMessage newFromMessageEvent: photoMessageEvent in: chat with: self core. self assert: TCTMMocks mockText equals: photoMessage caption. + self assert: TCTMMocks mockText equals: photoMessage asText. self assert: photoMessage hasCaption. self assert: TCTMMocks mockImageId equals: photoMessage fileId. self assert: TCTMMocks mockPhotoHeight equals: photoMessage height. - self assert: TCTMMocks mockPhotoWidth equals: photoMessage width. \ No newline at end of file + self assert: TCTMMocks mockPhotoWidth equals: photoMessage width. + self assert: 'Photo: ', TCTMMocks mockText equals: photoMessage asSnippet. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageCorrectlyConstructedFromJson.st new file mode 100644 index 000000000..29309081a --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageCorrectlyConstructedFromJson.st @@ -0,0 +1,16 @@ +testing +testPollMessageCorrectlyConstructedFromJson + + | pollMessageEvent chat pollMessage | + + chat := TCTMMocks mockPrivateChat. + pollMessageEvent := TCTMMocks mockPollMessageJsonFrom: chat id. + pollMessage := TCCMessage newFromMessageEvent: pollMessageEvent in: chat with: self core. + + self assert: pollMessage allowsMultipleAnswers equals: true. + self assert: 'Question' equals: pollMessage question. + self assert: 'pollTypeRegular' equals: pollMessage pollType. + self assert: false equals: pollMessage isClosed. + self assert: false equals: pollMessage isAnonymous. + self assert: 'Question' equals: pollMessage asText. + self assert: 'Question' equals: pollMessage asSnippet. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageTypeIdentifiedCorrectly.st new file mode 100644 index 000000000..62b1b8fef --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testPollMessageTypeIdentifiedCorrectly.st @@ -0,0 +1,10 @@ +testing +testPollMessageTypeIdentifiedCorrectly + + | pollMessageEvent chat pollMessage | + + chat := TCTMMocks mockPrivateChat. + pollMessageEvent := TCTMMocks mockPollMessageJsonFrom: chat id. + pollMessage := TCCMessage newFromMessageEvent: pollMessageEvent in: chat with: self core. + + self assert: TCCPollMessage equals: pollMessage class. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageCorrectlyContructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageCorrectlyContructedFromJson.st new file mode 100644 index 000000000..61e13bd1a --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageCorrectlyContructedFromJson.st @@ -0,0 +1,14 @@ +testing +testStaticStickerMessageCorrectlyContructedFromJson + + | stickerMessageEvent chat stickerMessage | + + chat := TCTMMocks mockPrivateChat. + stickerMessageEvent := TCTMMocks mockStaticStickerMessageJsonFrom: chat id. + stickerMessage := TCCMessage newFromMessageEvent: stickerMessageEvent in: chat with: self core. + + self assert: TCTMMocks mockStickerId equals: stickerMessage stickerId. + self assert: TCTMMocks mockStickerWidth equals: stickerMessage width. + self assert: TCTMMocks mockStickerHeight equals: stickerMessage height. + self assert: 'Sticker: ', TCTMMocks mockStickerId equals: stickerMessage asSnippet. + self assert: 'Sticker' equals: stickerMessage asText. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageTypeIdentifiedCorrectly.st new file mode 100644 index 000000000..9a2dc0368 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testStaticStickerMessageTypeIdentifiedCorrectly.st @@ -0,0 +1,10 @@ +testing +testStaticStickerMessageTypeIdentifiedCorrectly + + | stickerMessageEvent chat stickerMessage | + + chat := TCTMMocks mockPrivateChat. + stickerMessageEvent := TCTMMocks mockStaticStickerMessageJsonFrom: chat id. + stickerMessage := TCCMessage newFromMessageEvent: stickerMessageEvent in: chat with: self core. + + self assert: TCCStickerMessage equals: stickerMessage class. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testTextMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testTextMessageTypeIdentifiedCorrectly.st index 22bdf9d65..2e42c270d 100644 --- a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testTextMessageTypeIdentifiedCorrectly.st +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testTextMessageTypeIdentifiedCorrectly.st @@ -7,4 +7,6 @@ testTextMessageTypeIdentifiedCorrectly textMessageEvent := TCTMMocks mockMessageJsonFrom: chat id. textMessage := TCCMessage newFromMessageEvent: textMessageEvent in: chat with: self core. - self assert: TCCTextMessage equals: textMessage class. \ No newline at end of file + self assert: TCCTextMessage equals: textMessage class. + self assert: TCTMMocks mockText equals: textMessage asSnippet. + self assert: TCTMMocks mockText equals: textMessage asText. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageCorrectlyConstructedFromJson.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageCorrectlyConstructedFromJson.st new file mode 100644 index 000000000..19107e462 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageCorrectlyConstructedFromJson.st @@ -0,0 +1,17 @@ +testing +testVideoMessageCorrectlyConstructedFromJson + + | videoMessageEvent chat videoMessage | + + chat := TCTMMocks mockPrivateChat. + videoMessageEvent := TCTMMocks mockVideoMessageJsonFrom: chat id. + videoMessage := TCCMessage newFromMessageEvent: videoMessageEvent in: chat with: self core. + + self assert: TCTMMocks mockText equals: videoMessage caption. + self assert: videoMessage hasCaption. + self assert: TCTMMocks mockImageId equals: videoMessage thumbnailId. + self assert: TCTMMocks mockPhotoHeight equals: videoMessage height. + self assert: TCTMMocks mockPhotoWidth equals: videoMessage width. + self assert: TCTMMocks mockVideoId equals: videoMessage videoId. + self assert: 'Video: ', TCTMMocks mockText equals: videoMessage asSnippet. + self assert: TCTMMocks mockText equals: videoMessage asText. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageTypeIdentifiedCorrectly.st b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageTypeIdentifiedCorrectly.st new file mode 100644 index 000000000..0c8136c74 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/instance/testVideoMessageTypeIdentifiedCorrectly.st @@ -0,0 +1,10 @@ +testing +testVideoMessageTypeIdentifiedCorrectly + + | videoMessageEvent chat videoMessage | + + chat := TCTMMocks mockPrivateChat. + videoMessageEvent := TCTMMocks mockVideoMessageJsonFrom: chat id. + videoMessage := TCCMessage newFromMessageEvent: videoMessageEvent in: chat with: self core. + + self assert: TCCVideoMessage equals: videoMessage class. \ 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 d01d14f70..0a889db7e 100644 --- a/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json +++ b/packages/TelegramClientTests-Core.package/TCTCMessageTests.class/methodProperties.json @@ -2,6 +2,10 @@ "class" : { }, "instance" : { + "testAnimatedStickerMessageCorrectlyConstructedFromJson" : "JK 6/23/2024 14:35", + "testAnimatedStickerMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 11:45", + "testDocumentMessageCorrectlyConstructedFromJson" : "JK 6/23/2024 17:43", + "testDocumentMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 11:55", "testMessageAddMembersCorrectlyConstructedFromJson" : "ek 8/5/2022 15:07", "testMessageCorrectlyConstructedFromJson" : "js 7/31/2022 10:28", "testMessageDeleteMemberCorrectlyConstructedFromJson" : "ek 8/5/2022 15:08", @@ -13,9 +17,15 @@ "testMessageShouldNotify" : "RS 7/17/2021 10:53", "testMessageWithMessageSenderChatCorrectlyConstructedFromJson" : "js 7/31/2022 10:29", "testNotSupportedMessageTypeIdentifiedCorrectly" : "js 7/31/2022 10:29", - "testPhotoMessageCorrectlyConstructedFromJson" : "js 7/31/2022 10:29", - "testPhotoMessageTypeIdentifiedCorrectly" : "js 7/31/2022 10:29", + "testPhotoMessageCorrectlyConstructedFromJson" : "JK 6/23/2024 14:31", + "testPhotoMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 11:26", + "testPollMessageCorrectlyConstructedFromJson" : "JK 6/23/2024 17:58", + "testPollMessageTypeIdentifiedCorrectly" : "TU 6/23/2024 16:41", "testSenderNameInChannelMessage" : "tom.richter 7/25/2021 11:36", "testSenderNameInNonChannelMessage" : "per 7/17/2021 16:13", + "testStaticStickerMessageCorrectlyContructedFromJson" : "JK 6/23/2024 14:34", + "testStaticStickerMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 14:34", "testTextMessageCorrectlyConstructedFromJson" : "js 7/31/2022 10:30", - "testTextMessageTypeIdentifiedCorrectly" : "js 7/31/2022 10:30" } } + "testTextMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 14:32", + "testVideoMessageCorrectlyConstructedFromJson" : "JK 6/23/2024 14:31", + "testVideoMessageTypeIdentifiedCorrectly" : "JK 6/23/2024 11:24" } } diff --git a/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/README.md b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/README.md new file mode 100644 index 000000000..268b24c1c --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/README.md @@ -0,0 +1 @@ +A TCTCImageStoreTests tests wether the TCCImageStore works as it should. diff --git a/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/setUp.st b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/setUp.st new file mode 100644 index 000000000..1f4eefa94 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/setUp.st @@ -0,0 +1,5 @@ +running +setUp + + super setUp. + TCTMMocks writeMockImage. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/testCorrectlyLoadsStickerIdsFromJson.st b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/testCorrectlyLoadsStickerIdsFromJson.st new file mode 100644 index 000000000..e63f88990 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/instance/testCorrectlyLoadsStickerIdsFromJson.st @@ -0,0 +1,9 @@ +testing +testCorrectlyLoadsStickerIdsFromJson + + | stickerSet | + stickerSet := TCTMMocks mockStickerSetJson. + + self core stickerStore storeStickerSet: stickerSet. + + self assert: TCTMMocks mockStickerSet equals: self core stickerStore stickerSets. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/methodProperties.json b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/methodProperties.json new file mode 100644 index 000000000..29a8394db --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/methodProperties.json @@ -0,0 +1,6 @@ +{ + "class" : { + }, + "instance" : { + "setUp" : "JK 6/23/2024 16:21", + "testCorrectlyLoadsStickerIdsFromJson" : "JK 6/23/2024 16:43" } } diff --git a/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/properties.json b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/properties.json new file mode 100644 index 000000000..42a645da6 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCStickerStoreTests.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClientTests-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCTCStickerStoreTests", + "pools" : [ + ], + "super" : "TCTCNoTdlibTestCase", + "type" : "normal" } diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/README.md b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/README.md new file mode 100644 index 000000000..268b24c1c --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/README.md @@ -0,0 +1 @@ +A TCTCImageStoreTests tests wether the TCCImageStore works as it should. diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/setUp.st b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/setUp.st new file mode 100644 index 000000000..1f4eefa94 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/setUp.st @@ -0,0 +1,5 @@ +running +setUp + + super setUp. + TCTMMocks writeMockImage. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCachesRequests.st b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCachesRequests.st new file mode 100644 index 000000000..e4692e60d --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCachesRequests.st @@ -0,0 +1,16 @@ +testing +testCachesRequests + + | path1 path2 | + self mockTeleClient onRequestType: 'downloadFile' respond: TCTMMocks mockImageResponseJson. + + [self core videoStore getFormFor: TCTMMocks mockImageId.] fork. + 1 seconds wait. + path1 := (self core videoStore at: TCTMMocks mockImageId) value. + + [self core videoStore getFormFor: TCTMMocks mockImageId.] fork. + 1 seconds wait. + path2 := (self core videoStore at: TCTMMocks mockImageId) value. + + self assert: path1 equals: path2. + self assert: 1 equals: self core videoStore size. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImageForm.st b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImageForm.st new file mode 100644 index 000000000..f39dd7097 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImageForm.st @@ -0,0 +1,13 @@ +testing +testCanGetImageForm + + | form | + form := nil. + + self mockTeleClient onRequestType: 'downloadFile' respond: TCTMMocks mockImageResponseJson. + + [form := self core videoStore getFormFor: TCTMMocks mockImageId.] fork. + 1 seconds wait. + + self assert: form notNil. + self assert: form isForm. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImagePath.st b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImagePath.st new file mode 100644 index 000000000..0a987c973 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testCanGetImagePath.st @@ -0,0 +1,9 @@ +testing +testCanGetImagePath + + self mockTeleClient onRequestType: 'downloadFile' respond: TCTMMocks mockImageResponseJson. + + [self core videoStore getFormFor: TCTMMocks mockImageId.] fork. + 1 seconds wait. + + self assert: TCTMMocks mockImagePath equals: (self core videoStore at: TCTMMocks mockImageId) value. \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testDidCreateFile.st b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testDidCreateFile.st new file mode 100644 index 000000000..059be00b2 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/instance/testDidCreateFile.st @@ -0,0 +1,4 @@ +testing +testDidCreateFile + + self assert: (FileDirectory default isAFileNamed: TCTMMocks mockImagePath). \ No newline at end of file diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/methodProperties.json b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/methodProperties.json new file mode 100644 index 000000000..5b6674c77 --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/methodProperties.json @@ -0,0 +1,9 @@ +{ + "class" : { + }, + "instance" : { + "setUp" : "pk 6/19/2021 17:37", + "testCachesRequests" : "JK 6/23/2024 16:56", + "testCanGetImageForm" : "JK 6/23/2024 16:55", + "testCanGetImagePath" : "JK 6/23/2024 16:55", + "testDidCreateFile" : "pk 6/19/2021 17:35" } } diff --git a/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/properties.json b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/properties.json new file mode 100644 index 000000000..106788bff --- /dev/null +++ b/packages/TelegramClientTests-Core.package/TCTCVideoStoreTests.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClientTests-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCTCVideoStoreTests", + "pools" : [ + ], + "super" : "TCTCNoTdlibTestCase", + "type" : "normal" } diff --git a/packages/TelegramClientTests-Misc.package/.squot-contents b/packages/TelegramClientTests-Misc.package/.squot-contents deleted file mode 100644 index 239ddebb0..000000000 --- a/packages/TelegramClientTests-Misc.package/.squot-contents +++ /dev/null @@ -1,5 +0,0 @@ -SquotTrackedObjectMetadata { - #objectClassName : #PackageInfo, - #objectsReplacedByNames : true, - #serializer : #SquotCypressCodeSerializer -} \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockAnimatedStickerMessageJsonFrom..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockAnimatedStickerMessageJsonFrom..st new file mode 100644 index 000000000..10593a0e5 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockAnimatedStickerMessageJsonFrom..st @@ -0,0 +1,27 @@ +message - json +mockAnimatedStickerMessageJsonFrom: aChatId + "@linter-ignore" + + ^ (JsonObject newFrom: { + '@type' -> 'message'. + 'id' -> self mockMessageId. + 'chat_id' -> aChatId. + 'sender_id' -> (JsonObject newFrom: { + '@type' -> 'messageSenderUser'. + 'user_id' -> self mockUser1 id + }). + 'content' -> (JsonObject newFrom: { + '@type' -> 'messageSticker'. + 'sticker' -> (JsonObject newFrom: { + 'is_animated' -> true. + 'height' -> self mockStickerHeight. + 'width' -> self mockStickerWidth. + 'sticker' -> (JsonObject newFrom: { + 'id' -> self mockStickerId + }). + 'emoji' -> self mockValidEmoji + }). + }). + 'is_outgoing' -> false. + 'date' -> self mockMessageTimestamp + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockChatEvent.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockChatEvent.st index 4e6fd6052..0872227e6 100644 --- a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockChatEvent.st +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockChatEvent.st @@ -20,7 +20,7 @@ mockChatEvent }). 'photo' -> (JsonObject newFrom: { '@type' -> 'chatPhotoInfo'. - 'small' -> (JsonObject newFrom: { + 'big' -> (JsonObject newFrom: { '@type' -> 'file'. 'id' -> self mockImageId }). diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentFileName.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentFileName.st new file mode 100644 index 000000000..7efbb5123 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentFileName.st @@ -0,0 +1,4 @@ +message - json +mockDocumentFileName + + ^ 'test_document.pdf' \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentMessageJsonFrom..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentMessageJsonFrom..st new file mode 100644 index 000000000..714bd2db5 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockDocumentMessageJsonFrom..st @@ -0,0 +1,31 @@ +message - json +mockDocumentMessageJsonFrom: aChatId + "@linter-ignore" + + ^ (JsonObject newFrom: { + '@type' -> 'message'. + 'id' -> self mockMessageId. + 'chat_id' -> aChatId. + 'sender_id' -> (JsonObject newFrom: { + '@type' -> 'messageSenderUser'. + 'user_id' -> self mockUser1 id + }). + 'content' -> (JsonObject newFrom: { + '@type' -> 'messageDocument'. + 'caption' -> (JsonObject newFrom: { + 'text' -> self mockText + }). + 'document' -> (JsonObject newFrom: { + 'file_name' -> self mockDocumentFileName. + 'thumbnail' -> (JsonObject newFrom:{ + 'file' -> (JsonObject newFrom: { + 'id' -> self mockImageId + }). + 'width' -> self mockPhotoWidth. + 'height' -> self mockPhotoHeight + }). + }). + }). + 'is_outgoing' -> false. + 'date' -> self mockMessageTimestamp + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollMessageJsonFrom..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollMessageJsonFrom..st new file mode 100644 index 000000000..3cab58e4a --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollMessageJsonFrom..st @@ -0,0 +1,33 @@ +message - json +mockPollMessageJsonFrom: aChatId + "@linter-ignore" + + ^ (JsonObject newFrom: { + '@type' -> 'message'. + 'id' -> self mockMessageId. + 'chat_id' -> aChatId. + 'sender_id' -> (JsonObject newFrom: { + '@type' -> 'messageSenderUser'. + 'user_id' -> self mockUser1 id + }). + 'content' -> (JsonObject newFrom: { + '@type' -> 'messagePoll'. + 'poll' -> (JsonObject newFrom: { + '@type' -> 'poll'. + 'close_date' -> 0. + 'id' -> 1. + 'is_anonymous' -> false. + 'is_closed' -> false. + 'open_period' -> false. + 'question' -> 'Question'. + 'total_voter_count' -> 0. + 'type' -> (JsonObject newFrom: { + '@type' -> 'pollTypeRegular'. + 'allow_multiple_answers' -> true. + }). + 'options' -> self mockPollOptionsJson. + }). + }). + 'is_outgoing' -> false. + 'date' -> self mockMessageTimestamp + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionJson.isBeingChosen.isChosen.votePercentage.voterCount..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionJson.isBeingChosen.isChosen.votePercentage.voterCount..st new file mode 100644 index 000000000..19a564801 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionJson.isBeingChosen.isChosen.votePercentage.voterCount..st @@ -0,0 +1,11 @@ +message - json +mockPollOptionJson: text isBeingChosen: beingChosen isChosen: chosen votePercentage: percentage voterCount: count + + ^ (JsonObject newFrom: { + '@type' -> 'pollOption'. + 'is_being_chosen' -> beingChosen. + 'is_chosen' -> chosen. + 'text' -> text. + 'vote_percentage' -> percentage. + 'voter_count' -> count. + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionsJson.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionsJson.st new file mode 100644 index 000000000..3da9a5c97 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockPollOptionsJson.st @@ -0,0 +1,10 @@ +message - json +mockPollOptionsJson + + | options | + options := Array new: 3. + options at: 1 put: (self mockPollOptionJson: 'Option 1' isBeingChosen: false isChosen: true votePercentage: 50 voterCount: 2). + options at: 2 put: (self mockPollOptionJson: 'Option 2' isBeingChosen: false isChosen: false votePercentage: 25 voterCount: 1). + options at: 3 put: (self mockPollOptionJson: 'Option 3' isBeingChosen: false isChosen: false votePercentage: 25 voterCount: 1). + + ^ options. \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStaticStickerMessageJsonFrom..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStaticStickerMessageJsonFrom..st new file mode 100644 index 000000000..e1b237413 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStaticStickerMessageJsonFrom..st @@ -0,0 +1,26 @@ +message - json +mockStaticStickerMessageJsonFrom: aChatId + "@linter-ignore" + + ^ (JsonObject newFrom: { + '@type' -> 'message'. + 'id' -> self mockMessageId. + 'chat_id' -> aChatId. + 'sender_id' -> (JsonObject newFrom: { + '@type' -> 'messageSenderUser'. + 'user_id' -> self mockUser1 id + }). + 'content' -> (JsonObject newFrom: { + '@type' -> 'messageSticker'. + 'sticker' -> (JsonObject newFrom: { + 'is_animated' -> false. + 'height' -> self mockStickerHeight. + 'width' -> self mockStickerWidth. + 'sticker' -> (JsonObject newFrom: { + 'id' -> self mockStickerId + }). + }). + }). + 'is_outgoing' -> false. + 'date' -> self mockMessageTimestamp + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerHeight.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerHeight.st new file mode 100644 index 000000000..8ed49d81c --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerHeight.st @@ -0,0 +1,4 @@ +image +mockStickerHeight + + ^ 100 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId.st new file mode 100644 index 000000000..6b0bdee8f --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId.st @@ -0,0 +1,4 @@ +image +mockStickerId + + ^ 24 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId2.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId2.st new file mode 100644 index 000000000..bd32c743f --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerId2.st @@ -0,0 +1,4 @@ +sticker +mockStickerId2 + + ^ 20 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSet.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSet.st new file mode 100644 index 000000000..d5a58d45d --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSet.st @@ -0,0 +1,10 @@ +sticker +mockStickerSet + + ^ Dictionary new + at: self mockStickerSetId put: ( + OrderedCollection new + add: self mockStickerId; + add: self mockStickerId2; + yourself); + yourself. \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetId.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetId.st new file mode 100644 index 000000000..f171bc2e2 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetId.st @@ -0,0 +1,4 @@ +sticker +mockStickerSetId + + ^ 13 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetJson.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetJson.st new file mode 100644 index 000000000..c3555c188 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerSetJson.st @@ -0,0 +1,18 @@ +sticker +mockStickerSetJson + + ^ (JsonObject newFrom: { + 'id' -> self mockStickerSetId. + 'stickers' -> { + (JsonObject newFrom:{ + 'sticker' -> (JsonObject newFrom: { + 'id' -> self mockStickerId. + }). + }). + (JsonObject newFrom:{ + 'sticker' -> (JsonObject newFrom: { + 'id' -> self mockStickerId2. + }). + }). + }. + }). \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerWidth.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerWidth.st new file mode 100644 index 000000000..8bd67d452 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockStickerWidth.st @@ -0,0 +1,4 @@ +image +mockStickerWidth + + ^ 100 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoHeight.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoHeight.st new file mode 100644 index 000000000..1a1afed32 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoHeight.st @@ -0,0 +1,4 @@ +message +mockVideoHeight + + ^ 265 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoId.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoId.st new file mode 100644 index 000000000..ddc9cd1a9 --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoId.st @@ -0,0 +1,4 @@ +image +mockVideoId + + ^ 42 \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoMessageJsonFrom..st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoMessageJsonFrom..st new file mode 100644 index 000000000..190889a6a --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoMessageJsonFrom..st @@ -0,0 +1,35 @@ +message - json +mockVideoMessageJsonFrom: aChatId + "@linter-ignore" + + ^ (JsonObject newFrom: { + '@type' -> 'message'. + 'id' -> self mockMessageId. + 'chat_id' -> aChatId. + 'sender_id' -> (JsonObject newFrom: { + '@type' -> 'messageSenderUser'. + 'user_id' -> self mockUser1 id + }). + 'content' -> (JsonObject newFrom: { + '@type' -> 'messageVideo'. + 'caption' -> (JsonObject newFrom: { + 'text' -> self mockText + }). + 'video' -> (JsonObject newFrom: { + 'height' -> self mockVideoHeight. + 'width' -> self mockVideoWidth. + 'thumbnail' -> (JsonObject newFrom:{ + 'file' -> (JsonObject newFrom: { + 'id' -> self mockImageId + }). + 'width' -> self mockPhotoWidth. + 'height' -> self mockPhotoHeight + }). + 'video' -> (JsonObject newFrom:{ + 'id' -> self mockVideoId + }). + }). + }). + 'is_outgoing' -> false. + 'date' -> self mockMessageTimestamp + }) \ No newline at end of file diff --git a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoWidth.st b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoWidth.st new file mode 100644 index 000000000..74921debf --- /dev/null +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/class/mockVideoWidth.st @@ -0,0 +1,4 @@ +message +mockVideoWidth + + ^ 521 \ 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 d3ef0c572..34406cc87 100644 --- a/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json +++ b/packages/TelegramClientTests-Misc.package/TCTMMocks.class/methodProperties.json @@ -1,14 +1,17 @@ { "class" : { + "mockAnimatedStickerMessageJsonFrom:" : "JK 6/23/2024 11:49", "mockBasicGroupChat" : "rgw 6/2/2022 12:06", "mockBasicGroupFullInfoJson" : "per 6/10/2021 19:41", "mockChannelSupergroupChat" : "rgw 6/2/2022 12:07", - "mockChatEvent" : "rgw 6/2/2022 15:45", + "mockChatEvent" : "JK 6/21/2024 15:22", "mockChatEventMutedFor:" : "rgw 6/2/2022 11:48", "mockChatEventNoPhoto" : "rgw 6/2/2022 15:23", "mockChatHistoryJsonContainingMessageId:inChat:" : "aka 6/15/2022 11:49", "mockChats" : "LR 7/16/2022 12:52", "mockChatsFor:" : "JB 7/18/2021 13:15", + "mockDocumentFileName" : "JK 6/23/2024 12:00", + "mockDocumentMessageJsonFrom:" : "JK 6/23/2024 12:01", "mockEmojiSequence1" : "pk 7/10/2021 15:22", "mockEmojiSequence2" : "pk 7/10/2021 15:23", "mockEmojiString" : "pk 7/11/2021 20:23", @@ -39,10 +42,21 @@ "mockPhotoMessageJsonFrom:" : "tom.richter 6/28/2021 15:05", "mockPhotoMessageWith:" : "rgw 8/5/2022 10:22", "mockPhotoWidth" : "tom.richter 6/28/2021 13:57", + "mockPollMessageJsonFrom:" : "TU 6/23/2024 16:36", + "mockPollOptionJson:isBeingChosen:isChosen:votePercentage:voterCount:" : "TU 6/23/2024 16:36", + "mockPollOptionsJson" : "TU 6/23/2024 16:36", "mockPrivateChat" : "LR 7/16/2022 12:03", "mockPrivateChatLastMessageIsLoggedInUser" : "LR 7/16/2022 12:25", "mockSingleEmojiSequence" : "pk 7/10/2021 15:21", "mockSplitCharsAndEmojis" : "pk 7/10/2021 15:23", + "mockStaticStickerMessageJsonFrom:" : "JK 6/23/2024 11:40", + "mockStickerHeight" : "JK 6/23/2024 11:39", + "mockStickerId" : "JK 6/23/2024 11:39", + "mockStickerId2" : "JK 6/23/2024 16:35", + "mockStickerSet" : "JK 6/23/2024 16:46", + "mockStickerSetId" : "JK 6/23/2024 16:35", + "mockStickerSetJson" : "JK 6/23/2024 16:42", + "mockStickerWidth" : "JK 6/23/2024 11:39", "mockSupergroupChat" : "rgw 6/2/2022 12:07", "mockSupergroupMembersJson" : "per 6/10/2021 20:53", "mockText" : "TR 6/25/2021 21:15", @@ -73,6 +87,10 @@ "mockUserStore" : "LR 7/16/2022 12:58", "mockUsers" : "LR 7/16/2022 12:25", "mockValidEmoji" : "pk 7/9/2021 16:07", + "mockVideoHeight" : "JK 6/23/2024 11:11", + "mockVideoId" : "JK 6/23/2024 11:10", + "mockVideoMessageJsonFrom:" : "JK 6/23/2024 11:14", + "mockVideoWidth" : "JK 6/23/2024 11:11", "writeMockImage" : "pk 6/19/2021 17:36" }, "instance" : { } }