From 5a19a4f79793574e991e8cf07bfdf362e8b97a1f Mon Sep 17 00:00:00 2001 From: Jonas Kubeler Date: Fri, 21 Jun 2024 14:10:08 +0200 Subject: [PATCH] fixed stickers. now they can be sent again --- .../TCCFileStore.class/class/imageFormFrom..st | 4 ++++ .../TCCFileStore.class/instance/getFormFor..st | 7 +++++++ .../TCCFileStore.class/instance/getFormPromiseFor..st | 10 ++++++++++ .../TCCFileStore.class/methodProperties.json | 3 +++ .../TCCImageStore.class/methodProperties.json | 10 ++-------- .../TCCRequest.class/methodProperties.json | 2 +- .../TCCStickerStore.class/class/imageFormFrom..st | 9 +++++++++ .../TCCStickerStore.class/methodProperties.json | 9 ++------- .../TCCStickerStore.class/properties.json | 3 +-- .../TCCVideoStore.class/methodProperties.json | 5 +---- .../TCUStickerListItem.class/instance/mouseDown..st | 3 +-- .../TCUStickerListItem.class/methodProperties.json | 2 +- .../instance/buildStickerListItemsFor..st | 3 ++- .../TCUStickerWindow.class/methodProperties.json | 10 ++++------ 14 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/class/imageFormFrom..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormFor..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/instance/getFormPromiseFor..st create mode 100644 packages/TelegramClient-Core.package/TCCStickerStore.class/class/imageFormFrom..st 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..0e4a66223 100644 --- a/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json @@ -1,11 +1,5 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52", - "newWith:" : "6/14/2024 09:21:38" }, + }, "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" } } + } } diff --git a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json index ccecabd9a..a7a484b97 100644 --- a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json @@ -19,7 +19,7 @@ "newSendMessage:to:" : "6/7/2024 09:02:10", "newSendMessage:to:asReplyTo:" : "JS 5/20/2022 10:02", "newSendPhoneNumber:" : "RS 6/23/2021 16:34", - "newSendStickerMessage:to:" : "JK 5/28/2024 10:52", + "newSendStickerMessage:to:" : "JK 6/21/2024 14:08", "newSetPollAnswer:message:options:" : "TU 6/6/2024 01:15", "newUser:" : "JB 8/1/2021 11:55", "newWithType:from:" : "rs 6/6/2020 16:21" }, 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/methodProperties.json b/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json index e9cea139d..9f520c994 100644 --- a/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCStickerStore.class/methodProperties.json @@ -1,14 +1,9 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "newWith:" : "JK 6/20/2024 22:18", - "stickerFormFrom:" : "JK 6/5/2024 11:15" }, + "imageFormFrom:" : "JK 6/21/2024 13:46", + "newWith:" : "JK 6/20/2024 22:18" }, "instance" : { - "core" : "pk 6/19/2021 16:13", - "core:" : "pk 6/19/2021 16:13", "downloadStickerSet:" : "JK 6/19/2024 11:33", - "getFormFor:" : "JK 6/5/2024 11:12", - "getFormPromiseFor:" : "JK 5/16/2024 21:21", "getInstalledStickers" : "JK 6/5/2024 11:37", "loadStickerIds" : "JK 6/20/2024 23:39", "requestStickerFor:with:" : "JK 5/16/2024 21:40", diff --git a/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json b/packages/TelegramClient-Core.package/TCCStickerStore.class/properties.json index 9cdb2b68e..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", "stickerSets" ], "name" : "TCCStickerStore", "pools" : [ ], - "super" : "Dictionary", + "super" : "TCCFileStore", "type" : "normal" } diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json index 18a5f48f4..8085d52e6 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -1,9 +1,6 @@ { "class" : { - "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52" }, + }, "instance" : { - "getFormFor:" : "JK 6/12/2024 19:28", - "getFormPromiseFor:" : "JK 6/12/2024 19:30", "getVideoFor:" : "JK 6/12/2024 19:48", "getVideoPromiseFor:" : "JK 6/12/2024 19:56" } } 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/buildStickerListItemsFor..st b/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItemsFor..st index 73b075dfe..91cfa6bb3 100644 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItemsFor..st +++ b/packages/TelegramClient-UI.package/TCUStickerWindow.class/instance/buildStickerListItemsFor..st @@ -8,7 +8,8 @@ buildStickerListItemsFor: anArray item := (TCUStickerListItem new image: ((self core stickerStore getFormFor: stickerId) scaledToWidth: 100); id: stickerId; - selectedChat: self selectedChat). + 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. diff --git a/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json index b107cff7e..104863d34 100644 --- a/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUStickerWindow.class/methodProperties.json @@ -6,16 +6,14 @@ "addNextButton" : "JK 6/19/2024 12:03", "addPreviousButton" : "JK 6/19/2024 12:04", "buildStickerListItems" : "JK 6/19/2024 11:27", - "buildStickerListItemsFor:" : "JK 6/20/2024 12:40", + "buildStickerListItemsFor:" : "JK 6/21/2024 14:07", "close" : "JK 5/29/2024 20:09", - "collectInstalledStickers" : "6/20/2024 11:30:00", - "convertWebp:" : " 6/21/2024 00:13:58", "core" : "JK 5/31/2024 14:29", "core:" : "JK 5/31/2024 14:29", - "downloadStickerSetFrom:" : "6/20/2024 11:30:00", + "downloadStickerSetFrom:" : " 6/20/2024 11:30:00", "initialize" : "JK 6/20/2024 23:42", - "loadStickers" : "6/20/2024 11:30:00", - "loadStickersFromStore" : "6/20/2024 11:30:00", + "loadStickers" : " 6/20/2024 11:30:00", + "loadStickersFromStore" : " 6/20/2024 11:30:00", "selectedChat" : "JK 5/28/2024 10:22", "selectedChat:" : "JK 5/28/2024 10:23", "selectedSet" : "JK 6/20/2024 11:39",