From e7b15f395b9cf9d966d9f023eb7f7eef0bf498b2 Mon Sep 17 00:00:00 2001 From: Jonas Kubeler Date: Wed, 12 Jun 2024 11:24:09 +0200 Subject: [PATCH 1/5] TEST added TCUVideoMessage cclass as compy from Photo --- .../TCUChatInfoPage.class/methodProperties.json | 4 ++++ .../TCUChatPhotoPage.class/methodProperties.json | 3 +++ .../TCUVideoMessage.class/README.md | 1 + .../TCUVideoMessage.class/class/maxHeight.st | 4 ++++ .../TCUVideoMessage.class/instance/addContent.st | 5 +++++ .../TCUVideoMessage.class/instance/addPhoto.st | 11 +++++++++++ .../TCUVideoMessage.class/methodProperties.json | 6 ++++++ .../TCUVideoMessage.class/properties.json | 14 ++++++++++++++ 8 files changed, 48 insertions(+) create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/README.md create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/class/maxHeight.st create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addPhoto.st create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/properties.json diff --git a/packages/TelegramClient-UI.package/TCUChatInfoPage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatInfoPage.class/methodProperties.json index 41c55ec18..cc0b60781 100644 --- a/packages/TelegramClient-UI.package/TCUChatInfoPage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatInfoPage.class/methodProperties.json @@ -17,6 +17,7 @@ "addInfoBar" : "RS 5/20/2021 21:28", "addInfoText" : "jkon 5/15/2024 11:04", "addPhoto" : "jkon 5/22/2024 10:26", + "addTestmorph" : " 6/12/2024 11:22:13", "addTitle" : "jkon 5/22/2024 10:55", "addTitleText" : "jkon 5/22/2024 11:04", "addUserList" : "jkon 5/15/2024 11:55", @@ -30,6 +31,7 @@ "createContentWrapper" : "jkon 5/15/2024 11:53", "createDescription" : "RS 5/29/2021 18:32", "createInfoBar" : "RS 5/20/2021 21:31", + "createTestMorph" : " 6/12/2024 11:22:13", "createTitle" : "jkon 5/22/2024 10:54", "description" : "RS 5/29/2021 18:46", "description:" : "RK 8/4/2021 10:26", @@ -41,6 +43,8 @@ "photoPage" : "jkon 5/15/2024 15:05", "photoPage:" : "jkon 5/15/2024 15:05", "showPhotoPage" : "jkon 5/15/2024 15:07", + "testmorph" : " 6/12/2024 11:22:13", + "testmorph:" : " 6/12/2024 11:22:13", "title" : "jkon 5/22/2024 10:50", "title:" : "jkon 5/22/2024 10:50", "userList" : "per 6/3/2021 17:27", diff --git a/packages/TelegramClient-UI.package/TCUChatPhotoPage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatPhotoPage.class/methodProperties.json index 8baa92cb9..c788fcea5 100644 --- a/packages/TelegramClient-UI.package/TCUChatPhotoPage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatPhotoPage.class/methodProperties.json @@ -1,8 +1,11 @@ { "class" : { + "newFor:withBounds:andSize:" : " 6/12/2024 11:22:13", "newWithBounds:andPhoto:andSize:" : "jkon 5/22/2024 10:27" }, "instance" : { "addPhoto" : "jkon 5/22/2024 10:21", + "chat" : " 6/12/2024 11:22:13", + "chat:" : " 6/12/2024 11:22:13", "initialize" : "jkon 5/15/2024 15:11", "photo" : "jkon 5/22/2024 10:30", "photo:" : "jkon 5/22/2024 10:31", diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/README.md b/packages/TelegramClient-UI.package/TCUVideoMessage.class/README.md new file mode 100644 index 000000000..fd235147a --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/README.md @@ -0,0 +1 @@ +a single message with photo displayed in a TCUMessageList \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/class/maxHeight.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/class/maxHeight.st new file mode 100644 index 000000000..c80102041 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/class/maxHeight.st @@ -0,0 +1,4 @@ +default values +maxHeight + + ^ 500 \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st new file mode 100644 index 000000000..2e62c15b9 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st @@ -0,0 +1,5 @@ +constructing +addContent + + self addPhoto. + self messageModel hasCaption ifTrue: [self addText]. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addPhoto.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addPhoto.st new file mode 100644 index 000000000..a3d125332 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addPhoto.st @@ -0,0 +1,11 @@ +constructing +addPhoto + + | photoForm | + photoForm := self messageModel core imageStore getFormFor: self messageModel fileId. + photoForm := photoForm scaledToWidth: self class defaultWidth. + + (photoForm height > self class maxHeight) ifTrue: [ + photoForm := photoForm scaledToHeight: self class maxHeight. + ]. + self addMorphBack: photoForm asMorph. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json new file mode 100644 index 000000000..441dae8aa --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json @@ -0,0 +1,6 @@ +{ + "class" : { + "maxHeight" : "TR 6/22/2021 10:07" }, + "instance" : { + "addContent" : "TR 6/22/2021 10:46", + "addPhoto" : "tr 8/4/2021 13:35" } } diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/properties.json b/packages/TelegramClient-UI.package/TCUVideoMessage.class/properties.json new file mode 100644 index 000000000..6bb206081 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-UI", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCUVideoMessage", + "pools" : [ + ], + "super" : "TCUUserMessage", + "type" : "normal" } From 5c9db9e71c603c811706011610546a26df56a2e4 Mon Sep 17 00:00:00 2001 From: Jonas Kubeler Date: Wed, 12 Jun 2024 11:32:21 +0200 Subject: [PATCH 2/5] added videoMessages and the ability to open videos on click (on windows) --- .../TCCMessage.class/class/newMessageWith..st | 1 + .../TCCMessage.class/methodProperties.json | 2 +- .../TCCVideoMessage.class/README.md | 1 + .../TCCVideoMessage.class/class/newFrom..st | 13 +++++++++++++ .../instance/asSnippet.st | 8 ++++++++ .../TCCVideoMessage.class/instance/asText.st | 4 ++++ .../TCCVideoMessage.class/instance/caption..st | 4 ++++ .../TCCVideoMessage.class/instance/caption.st | 4 ++++ .../instance/hasCaption.st | 4 ++++ .../TCCVideoMessage.class/instance/height..st | 4 ++++ .../TCCVideoMessage.class/instance/height.st | 4 ++++ .../instance/thumbnailId..st | 4 ++++ .../instance/thumbnailId.st | 4 ++++ .../TCCVideoMessage.class/instance/videoId..st | 4 ++++ .../TCCVideoMessage.class/instance/videoId.st | 4 ++++ .../TCCVideoMessage.class/instance/width..st | 4 ++++ .../TCCVideoMessage.class/instance/width.st | 4 ++++ .../methodProperties.json | 17 +++++++++++++++++ .../TCCVideoMessage.class/properties.json | 18 ++++++++++++++++++ .../TCUMessage.class/class/newFrom..st | 1 + .../TCUMessage.class/methodProperties.json | 2 +- .../instance/addContent.st | 2 +- .../instance/addThumbnail.st | 11 +++++++++++ .../instance/openVideo.st | 6 ++++++ .../methodProperties.json | 5 +++-- 25 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/README.md create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asSnippet.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asText.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/hasCaption.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width.st create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json create mode 100644 packages/TelegramClient-Core.package/TCCVideoMessage.class/properties.json create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st diff --git a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st index a03d3b669..850bffcdf 100644 --- a/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st +++ b/packages/TelegramClient-Core.package/TCCMessage.class/class/newMessageWith..st @@ -4,6 +4,7 @@ newMessageWith: aJsonObject ^ (aJsonObject at: '@type') caseOf: { ['messageText'] -> [TCCTextMessage newFrom: aJsonObject]. ['messagePhoto'] -> [TCCPhotoMessage newFrom: aJsonObject]. + ['messageVideo'] -> [TCCVideoMessage 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 d89b42bcc..0bfdeec32 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:" : "js 7/31/2022 09:28", + "newMessageWith:" : "JK 6/12/2024 11:30", "timeStampToDateAndTime:" : "JB 5/16/2021 09:42" }, "instance" : { "asReplySnippet" : "rgw 5/12/2022 16:05", diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/README.md b/packages/TelegramClient-Core.package/TCCVideoMessage.class/README.md new file mode 100644 index 000000000..4315e3265 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/README.md @@ -0,0 +1 @@ +data-represantation of a single message with a photo in a chat \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st new file mode 100644 index 000000000..6738d4a09 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st @@ -0,0 +1,13 @@ +instance creation +newFrom: aJsonObject + + | thumbnailData | + thumbnailData := ((aJsonObject at: 'video') at: 'thumbnail'). + + ^ self new + caption: ((aJsonObject at: 'caption') at: 'text'); + thumbnailId: ((thumbnailData at: 'file') at: 'id'); + videoId: (((aJsonObject at: 'video') at: 'video') at: 'id'); + width: (thumbnailData at: 'width'); + height: (thumbnailData at: 'height'); + yourself \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asSnippet.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asSnippet.st new file mode 100644 index 000000000..0397ce76c --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asSnippet.st @@ -0,0 +1,8 @@ +accessing +asSnippet + + self hasCaption ifTrue: [ + ^ 'Video: ', self caption + ] ifFalse: [ + ^ 'Video' + ] \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asText.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asText.st new file mode 100644 index 000000000..8a4f9bd9d --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/asText.st @@ -0,0 +1,4 @@ +accessing +asText + + ^ self caption \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption..st new file mode 100644 index 000000000..f715fe8d2 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption..st @@ -0,0 +1,4 @@ +accessing +caption: aString + + caption := aString \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption.st new file mode 100644 index 000000000..ddad829af --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/caption.st @@ -0,0 +1,4 @@ +accessing +caption + + ^ caption \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/hasCaption.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/hasCaption.st new file mode 100644 index 000000000..c851a3e7d --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/hasCaption.st @@ -0,0 +1,4 @@ +accessing +hasCaption + + ^ self caption notEmpty \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height..st new file mode 100644 index 000000000..e51d4ef62 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height..st @@ -0,0 +1,4 @@ +accessing +height: aNumber + + height := aNumber \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height.st new file mode 100644 index 000000000..226430745 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/height.st @@ -0,0 +1,4 @@ +accessing +height + + ^ height \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId..st new file mode 100644 index 000000000..f8b76a233 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId..st @@ -0,0 +1,4 @@ +accessing +thumbnailId: aNumber + + thumbnailId := aNumber \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId.st new file mode 100644 index 000000000..e8be9409e --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/thumbnailId.st @@ -0,0 +1,4 @@ +accessing +thumbnailId + + ^ thumbnailId \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId..st new file mode 100644 index 000000000..2ca07ada5 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId..st @@ -0,0 +1,4 @@ +accessing +videoId: aNumber + + videoId := aNumber \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId.st new file mode 100644 index 000000000..f0174ce55 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/videoId.st @@ -0,0 +1,4 @@ +accessing +videoId + + ^ videoId \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width..st new file mode 100644 index 000000000..6d10e3990 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width..st @@ -0,0 +1,4 @@ +accessing +width: aNumber + + width := aNumber \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width.st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width.st new file mode 100644 index 000000000..584b7f517 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/instance/width.st @@ -0,0 +1,4 @@ +accessing +width + + ^ width \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json new file mode 100644 index 000000000..97f215865 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json @@ -0,0 +1,17 @@ +{ + "class" : { + "newFrom:" : "JK 6/12/2024 11:28" }, + "instance" : { + "asSnippet" : "JK 6/12/2024 11:31", + "asText" : "TR 6/20/2021 10:41", + "caption" : "TR 6/20/2021 10:19", + "caption:" : "pk 8/4/2021 11:44", + "hasCaption" : "TR 6/22/2021 10:40", + "height" : "TR 6/20/2021 10:21", + "height:" : "pk 8/4/2021 11:47", + "thumbnailId" : "JK 6/12/2024 11:29", + "thumbnailId:" : "JK 6/12/2024 11:29", + "videoId" : "JK 6/12/2024 11:29", + "videoId:" : "JK 6/12/2024 11:30", + "width" : "TR 6/20/2021 10:21", + "width:" : "pk 8/4/2021 11:47" } } diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/properties.json b/packages/TelegramClient-Core.package/TCCVideoMessage.class/properties.json new file mode 100644 index 000000000..9fe961cc7 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/properties.json @@ -0,0 +1,18 @@ +{ + "category" : "TelegramClient-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "caption", + "width", + "height", + "thumbnailId", + "videoId" ], + "name" : "TCCVideoMessage", + "pools" : [ + ], + "super" : "TCCMessage", + "type" : "normal" } diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st index 2189082d3..12a18001a 100644 --- a/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st +++ b/packages/TelegramClient-UI.package/TCUMessage.class/class/newFrom..st @@ -4,6 +4,7 @@ newFrom: aCoreMessage ^ (aCoreMessage class caseOf: { [TCCTextMessage] -> [TCUTextMessage]. [TCCPhotoMessage] -> [TCUPhotoMessage]. + [TCCVideoMessage] -> [TCUVideoMessage]. [TCCAddMembersMessage] -> [TCUInfoMessage]. [TCCDeleteMemberMessage] -> [TCUInfoMessage]. } otherwise: [TCUTextMessage]) diff --git a/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUMessage.class/methodProperties.json index c66446a7b..d25d5d325 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:" : "LR 7/23/2022 10:44" }, + "newFrom:" : "JK 6/12/2024 11:26" }, "instance" : { "handlesMouseDown:" : "js 7/31/2022 11:13", "isUserMessage" : "rgw 7/21/2022 14:07", diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st index 2e62c15b9..a7cceeb4b 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addContent.st @@ -1,5 +1,5 @@ constructing addContent - self addPhoto. + self addThumbnail. self messageModel hasCaption ifTrue: [self addText]. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st new file mode 100644 index 000000000..ecb52b170 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st @@ -0,0 +1,11 @@ +constructing +addThumbnail + + | thumbnailForm | + thumbnailForm := self messageModel core imageStore getFormFor: self messageModel thumbnailId. + thumbnailForm := thumbnailForm scaledToWidth: self class defaultWidth. + + (thumbnailForm height > self class maxHeight) ifTrue: [ + thumbnailForm := thumbnailForm scaledToHeight: self class maxHeight. + ]. + self addMorphBack: ((thumbnailForm asMorph) on: #mouseDown send: #openVideo to: self). diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st new file mode 100644 index 000000000..a966a8a4e --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st @@ -0,0 +1,6 @@ +constructing +openVideo + + self messageModel core + send: (TCCRequest newRequestFile: self messageModel videoId) + thenDo: [:videoEvent | OSProcess command: 'cmd.exe /c ""', ((videoEvent at: 'local') at: 'path'), '""']. diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json index 441dae8aa..aa7832586 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json @@ -2,5 +2,6 @@ "class" : { "maxHeight" : "TR 6/22/2021 10:07" }, "instance" : { - "addContent" : "TR 6/22/2021 10:46", - "addPhoto" : "tr 8/4/2021 13:35" } } + "addContent" : "JK 6/12/2024 11:27", + "addThumbnail" : "JK 6/12/2024 11:27", + "openVideo" : "JK 6/12/2024 11:27" } } From 797cd891c6f201efa0eb3337c81cec1311724dd1 Mon Sep 17 00:00:00 2001 From: Jonas Kubeler Date: Wed, 12 Jun 2024 12:15:33 +0200 Subject: [PATCH 3/5] added temporary playbutton asset and display playbutton on video thumbnails --- .squot-materialize | 115 ++++++++++-------- assets/playbutton.jpg | Bin 0 -> 7172 bytes .../instance/addPlaybuttonTo..st | 10 ++ .../instance/addThumbnail.st | 6 +- .../instance/openVideo.st | 6 +- .../methodProperties.json | 5 +- 6 files changed, 83 insertions(+), 59 deletions(-) create mode 100644 assets/playbutton.jpg create mode 100644 packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addPlaybuttonTo..st diff --git a/.squot-materialize b/.squot-materialize index 3253a744e..09462332b 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -2,21 +2,27 @@ SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', - 'pull_request_template.md' + 'discord_actions.yml' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'workflows', - 'ci-linter.yml' + '.smalltalk.release.ston' ], #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClient-Core' + #name : 'TelegramClientTests-Core' + }, + #path : FSAbsolutePath [ + 'packages' + ] + }, + SquotCypressMapper { + #package : MCPackage { + #name : 'TelegramClientTests-Misc' }, #path : FSAbsolutePath [ 'packages' @@ -24,19 +30,21 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.smalltalk.release.ston' + '.smalltalk.lint.ston' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.squot' + '.github', + 'ISSUE_TEMPLATE', + 'bug_report.md' ], #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'BaselineOfTelegramClient' + #name : 'TelegramClient-UI' }, #path : FSAbsolutePath [ 'packages' @@ -44,28 +52,49 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.smalltalk.ston' + '.github', + 'ISSUE_TEMPLATE', + 'feature_request.md' ], #encoding : 'TXT' }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'logo.png' + ], + #encoding : Class [ #PNGReadWriter ] + }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'ISSUE_TEMPLATE', - 'feature_request.md' + '.gitignore' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'discord_actions.yml' + 'LICENSE' + ], + #encoding : 'TXT' + }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'playbutton.jpg' + ], + #encoding : Class [ #JPEGReadWriter2 ] + }, + SquotPlaintextMapper { + #path : FSAbsolutePath [ + 'CONTRIBUTING.md' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.gitignore' + '.github', + 'workflows', + 'ci-linter.yml' ], #encoding : 'TXT' }, @@ -79,42 +108,35 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'LICENSE' + 'README.md' ], #encoding : 'TXT' }, - SquotCypressMapper { - #package : MCPackage { - #name : 'TelegramClientTests-UI' - }, + SquotPlaintextMapper { #path : FSAbsolutePath [ - 'packages' - ] + '.github', + 'stale.yml' + ], + #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClient-UI' + #name : 'TelegramClientTests-UI' }, #path : FSAbsolutePath [ 'packages' ] }, - SquotImageMapper { - #path : FSAbsolutePath [ - 'assets', - 'logo.png' - ], - #encoding : Class [ #PNGReadWriter ] - }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'CONTRIBUTING.md' + 'scripts', + 'preLoading.st' ], #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClientTests-Misc' + #name : 'BaselineOfTelegramClient' }, #path : FSAbsolutePath [ 'packages' @@ -122,22 +144,13 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'workflows', - 'release.yml' - ], - #encoding : 'TXT' - }, - SquotPlaintextMapper { - #path : FSAbsolutePath [ - '.github', - 'stale.yml' + '.smalltalk.ston' ], #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClientTests-Core' + #name : 'TelegramClient-Core' }, #path : FSAbsolutePath [ 'packages' @@ -145,28 +158,22 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'README.md' - ], - #encoding : 'TXT' - }, - SquotPlaintextMapper { - #path : FSAbsolutePath [ - '.smalltalk.lint.ston' + '.squot' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', - 'ISSUE_TEMPLATE', - 'bug_report.md' + 'workflows', + 'release.yml' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'scripts', - 'preLoading.st' + '.github', + 'pull_request_template.md' ], #encoding : 'TXT' } diff --git a/assets/playbutton.jpg b/assets/playbutton.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ba3c745e98f13e2b858d6e0c7e21d1ed119d464f GIT binary patch literal 7172 zcmdT|2{@Gd+y0GV1`UG{5?M|rQ;uxOF2@=%m2HYd_99DJ$}Y;GAxkwa#=dj1M97jX zEy83eWeJ5*AxpNI`QCAsI-Sn)Ki~IV-}Sw&-&~h>-g)2mxu55`pZosNpVNl{myw>K z9)Q6BfI)wN{u1Z_Rs;fxU|~ffk!)?mFi)P@ZxL7t6h-Yr6+B3p!ng||w|NNpA0 zAt5Y`*}Z*->@Ecb1yQLz>dJCzGV%&?jGMsN*w|1TPy!qr0&-%)VsiiSL2m%utS}dt z3mhg6n7CnZZW#Rm5QW~81-5>GUk(@(oS6lIWMyOD09{bQ1(;xPI1@9Rg@u_Jx;hB@ z9x!vW@QCfwMr_0#LyCLx%7rDQu}bW{-N<*KYerJu-aDL)oqv;npwM^Qq%hm16%>_r zEALU!`9W7t-@wr5;30DhODk)Ml~s4E?>9YYZfR|M_=xb z!dQ9tCZyeNWRs9TFvDl>-Nnu?sqp%{S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zDL!3Fyx&P#t|{BjnbuRYW9Vo|pdY+_BBz77w-W8?v$0u4SmA`M{t{K6_mTY{TH%XA z`0cyBr}nHk^ri}Xo66~+Ja-hIx=nhx?H;lzc;k=8FV5zkNLkI-?>R;X{GUjyYS`C0 zZVufG%B}qx^IWoYU`cy+w$HY8>t%0~&86P^O&B{=3B*HxMlt``&*8K_SKGQt7*`D9 zY&}xR=6l@Ow>D9807J`V>pLcFH zADBTT`0wkVz6}|<4jD7*Av!R&+#WQ%)1x!dL#%fH;9+LZhgDRQKpDty2_I*dLB_s% z`O13N;TqSXm*gL?I0Q self class maxHeight) ifTrue: [ thumbnailForm := thumbnailForm scaledToHeight: self class maxHeight. ]. - self addMorphBack: ((thumbnailForm asMorph) on: #mouseDown send: #openVideo to: self). + thumbnailMorph := self addPlaybuttonTo: thumbnailForm. + thumbnailMorph on: #mouseDown send: #openVideo to: self. + self addMorphBack: thumbnailMorph. diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st index a966a8a4e..e6b4da27f 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st @@ -3,4 +3,8 @@ openVideo self messageModel core send: (TCCRequest newRequestFile: self messageModel videoId) - thenDo: [:videoEvent | OSProcess command: 'cmd.exe /c ""', ((videoEvent at: 'local') at: 'path'), '""']. + thenDo: [:videoEvent | Smalltalk platformName caseOf: { + ['Win32'] -> [OSProcess command: 'cmd.exe /c ""', ((videoEvent at: 'local') at: 'path'), '""']. + ['MacOS'] -> [UIManager inform: 'Go buy something else.']. + ['unix'] -> [OSProcess command: 'open "', ((videoEvent at: 'local') at: 'path'), '"']} + ]. diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json index aa7832586..70a8a9d8e 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json @@ -3,5 +3,6 @@ "maxHeight" : "TR 6/22/2021 10:07" }, "instance" : { "addContent" : "JK 6/12/2024 11:27", - "addThumbnail" : "JK 6/12/2024 11:27", - "openVideo" : "JK 6/12/2024 11:27" } } + "addPlaybuttonTo:" : "JK 6/12/2024 12:14", + "addThumbnail" : "JK 6/12/2024 12:14", + "openVideo" : "JK 6/12/2024 11:39" } } From 208faf5a69db9adbd5e3d36ccdc08fe76c1533a8 Mon Sep 17 00:00:00 2001 From: Elia Doumerc Date: Wed, 12 Jun 2024 19:15:51 +0200 Subject: [PATCH 4/5] Prettier playbutton --- .squot-materialize | 135 +++++++++--------- assets/play_circle_outline_icon.png | Bin 0 -> 5520 bytes .../methodProperties.json | 8 +- .../methodProperties.json | 6 +- .../instance/addPlaybuttonTo..st | 2 +- .../methodProperties.json | 3 +- 6 files changed, 81 insertions(+), 73 deletions(-) create mode 100644 assets/play_circle_outline_icon.png diff --git a/.squot-materialize b/.squot-materialize index 09462332b..1ba7c640b 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -1,50 +1,40 @@ [ SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'discord_actions.yml' + '.squot' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.smalltalk.release.ston' + '.github', + 'discord_actions.yml' ], #encoding : 'TXT' }, - SquotCypressMapper { - #package : MCPackage { - #name : 'TelegramClientTests-Core' - }, - #path : FSAbsolutePath [ - 'packages' - ] - }, - SquotCypressMapper { - #package : MCPackage { - #name : 'TelegramClientTests-Misc' - }, + SquotPlaintextMapper { #path : FSAbsolutePath [ - 'packages' - ] + '.github', + 'ISSUE_TEMPLATE', + 'feature_request.md' + ], + #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.smalltalk.lint.ston' + '.gitignore' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'ISSUE_TEMPLATE', - 'bug_report.md' + 'CONTRIBUTING.md' ], #encoding : 'TXT' }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClient-UI' + #name : 'TelegramClientTests-UI' }, #path : FSAbsolutePath [ 'packages' @@ -52,51 +42,45 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.github', - 'ISSUE_TEMPLATE', - 'feature_request.md' + '.smalltalk.ston' ], #encoding : 'TXT' }, - SquotImageMapper { + SquotCypressMapper { + #package : MCPackage { + #name : 'BaselineOfTelegramClient' + }, #path : FSAbsolutePath [ - 'assets', - 'logo.png' - ], - #encoding : Class [ #PNGReadWriter ] + 'packages' + ] }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.gitignore' + 'README.md' ], #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'LICENSE' + '.smalltalk.release.ston' ], #encoding : 'TXT' }, - SquotImageMapper { - #path : FSAbsolutePath [ - 'assets', - 'playbutton.jpg' - ], - #encoding : Class [ #JPEGReadWriter2 ] - }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'CONTRIBUTING.md' + '.github', + 'ISSUE_TEMPLATE', + 'bug_report.md' ], #encoding : 'TXT' }, - SquotPlaintextMapper { + SquotCypressMapper { + #package : MCPackage { + #name : 'TelegramClient-UI' + }, #path : FSAbsolutePath [ - '.github', - 'workflows', - 'ci-linter.yml' - ], - #encoding : 'TXT' + 'packages' + ] }, SquotPlaintextMapper { #path : FSAbsolutePath [ @@ -108,25 +92,47 @@ }, SquotPlaintextMapper { #path : FSAbsolutePath [ - 'README.md' + '.github', + 'stale.yml' ], #encoding : 'TXT' }, + SquotCypressMapper { + #package : MCPackage { + #name : 'TelegramClientTests-Misc' + }, + #path : FSAbsolutePath [ + 'packages' + ] + }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', - 'stale.yml' + 'pull_request_template.md' ], #encoding : 'TXT' }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'logo.png' + ], + #encoding : Class [ #PNGReadWriter ] + }, SquotCypressMapper { #package : MCPackage { - #name : 'TelegramClientTests-UI' + #name : 'TelegramClientTests-Core' }, #path : FSAbsolutePath [ 'packages' ] }, + SquotPlaintextMapper { + #path : FSAbsolutePath [ + '.smalltalk.lint.ston' + ], + #encoding : 'TXT' + }, SquotPlaintextMapper { #path : FSAbsolutePath [ 'scripts', @@ -134,17 +140,17 @@ ], #encoding : 'TXT' }, - SquotCypressMapper { - #package : MCPackage { - #name : 'BaselineOfTelegramClient' - }, + SquotPlaintextMapper { #path : FSAbsolutePath [ - 'packages' - ] + 'LICENSE' + ], + #encoding : 'TXT' }, SquotPlaintextMapper { #path : FSAbsolutePath [ - '.smalltalk.ston' + '.github', + 'workflows', + 'release.yml' ], #encoding : 'TXT' }, @@ -156,25 +162,26 @@ 'packages' ] }, - SquotPlaintextMapper { + SquotImageMapper { #path : FSAbsolutePath [ - '.squot' + 'assets', + 'playbutton.jpg' ], - #encoding : 'TXT' + #encoding : Class [ #JPEGReadWriter2 ] }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.github', 'workflows', - 'release.yml' + 'ci-linter.yml' ], #encoding : 'TXT' }, - SquotPlaintextMapper { + SquotImageMapper { #path : FSAbsolutePath [ - '.github', - 'pull_request_template.md' + 'assets', + 'play_circle_outline_icon.png' ], - #encoding : 'TXT' + #encoding : @40 } ] \ No newline at end of file diff --git a/assets/play_circle_outline_icon.png b/assets/play_circle_outline_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..53719b0afc5f59498909544e91a24ccb952575d4 GIT binary patch literal 5520 zcmcgw_dgq4)Q>7Uj6S7GYqi#6&r&nAYF0wE_HK<>v1f>?Rw-JvHlappua+)}QG10L zMG0coikXB+-aPO7KfFKP`#JY}@45GT&OP_slV}DqV7qkV5&!^TGcweB1OPD5y9|H} z%=E@S@RK_LaLvj{Pxo=S<4Qr)=gB8IJ%VO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pE7zJeu{XJJ>;9pqNRhDlc8M~^>>1Gh-;Qv}l8(rtQnKbbo|0UQ>xF3ib~SL>Yg zuI*AlsFcH(3yR3m4s=_mc))R{PhBjK=b0Kqxk)Hf4u>G$DY;z-%8O!LC!Fx_rf*Fw z#86h(I@cIO)2dgCc6c= Date: Wed, 12 Jun 2024 20:05:37 +0200 Subject: [PATCH 5/5] added videoStore to handle videos and thumbnails --- .../TCCCore.class/instance/initialize.st | 1 + .../TCCCore.class/instance/videoStore..st | 4 ++++ .../TCCCore.class/instance/videoStore.st | 4 ++++ .../TCCCore.class/methodProperties.json | 6 ++++-- .../TCCCore.class/properties.json | 3 ++- .../TCCFileStore.class/README.md | 1 + .../TCCFileStore.class/class/extractPathFrom..st | 4 ++++ .../TCCFileStore.class/class/newWith..st | 6 ++++++ .../TCCFileStore.class/instance/core..st | 4 ++++ .../TCCFileStore.class/instance/core.st | 4 ++++ .../instance/requestFileFor.with..st | 9 +++++++++ .../TCCFileStore.class/methodProperties.json | 8 ++++++++ .../TCCFileStore.class/properties.json | 14 ++++++++++++++ .../TCCImageStore.class/methodProperties.json | 7 ++----- .../TCCImageStore.class/properties.json | 4 ++-- .../TCCVideoStore.class/README.md | 1 + .../TCCVideoStore.class/class/extractPathFrom..st | 4 ++++ .../TCCVideoStore.class/class/imageFormFrom..st | 4 ++++ .../TCCVideoStore.class/instance/getFormFor..st | 7 +++++++ .../instance/getFormPromiseFor..st | 10 ++++++++++ .../TCCVideoStore.class/instance/getVideoFor..st | 7 +++++++ .../instance/getVideoPromiseFor..st | 10 ++++++++++ .../TCCVideoStore.class/methodProperties.json | 9 +++++++++ .../TCCVideoStore.class/properties.json | 14 ++++++++++++++ .../TCUVideoMessage.class/instance/addThumbnail.st | 2 +- .../TCUVideoMessage.class/instance/openVideo.st | 13 ++++++------- .../TCUVideoMessage.class/methodProperties.json | 4 ++-- 27 files changed, 144 insertions(+), 20 deletions(-) create mode 100644 packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore..st create mode 100644 packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore.st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/README.md create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/class/extractPathFrom..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/class/newWith..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/instance/core..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/instance/core.st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/instance/requestFileFor.with..st create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json create mode 100644 packages/TelegramClient-Core.package/TCCFileStore.class/properties.json create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/README.md create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/class/extractPathFrom..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/class/imageFormFrom..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormFor..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormPromiseFor..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoFor..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoPromiseFor..st create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/properties.json diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st index ff1ef264b..f9ab2155a 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st @@ -8,6 +8,7 @@ initialize pendingRequests: Dictionary new; userStore: (TCCUserStore newWith: self); imageStore: (TCCImageStore newWith: self); + videoStore: (TCCVideoStore newWith: self); callbackCounter: 0. "Mac users report serious slowdowns when receiveLoop is running at lower priority" diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore..st b/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore..st new file mode 100644 index 000000000..841387d93 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore..st @@ -0,0 +1,4 @@ +accessing +videoStore: aVideoStore + + videoStore := aVideoStore. \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore.st b/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore.st new file mode 100644 index 000000000..555a16c79 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/videoStore.st @@ -0,0 +1,4 @@ +accessing +videoStore + + ^ videoStore \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json index 639c06f96..235660172 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" : "pk 8/5/2021 17:09", + "initialize" : "JK 6/12/2024 19:42", "initializeHandlers" : "RS 8/1/2021 12:53", "isClientAlive" : "js 5/28/2020 17:18", "loggedInUserId" : "pk 8/5/2021 17:04", @@ -39,4 +39,6 @@ "tryHandleError:" : "aka 5/21/2022 12:07", "update" : "rgw 7/24/2022 15:08", "userStore" : "per 7/15/2021 12:56", - "userStore:" : "tr 7/25/2021 17:57" } } + "userStore:" : "tr 7/25/2021 17:57", + "videoStore" : "JK 6/12/2024 19:42", + "videoStore:" : "JK 6/12/2024 19:43" } } diff --git a/packages/TelegramClient-Core.package/TCCCore.class/properties.json b/packages/TelegramClient-Core.package/TCCCore.class/properties.json index 6b686e23a..55526af8d 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/properties.json +++ b/packages/TelegramClient-Core.package/TCCCore.class/properties.json @@ -13,7 +13,8 @@ "loggedInUserId", "pendingRequests", "callbackCounter", - "userStore" ], + "userStore", + "videoStore" ], "name" : "TCCCore", "pools" : [ ], diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/README.md b/packages/TelegramClient-Core.package/TCCFileStore.class/README.md new file mode 100644 index 000000000..163559385 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/README.md @@ -0,0 +1 @@ +A TCCImageStore is a cache for local image files on disk with a synchronous interface. diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/class/extractPathFrom..st b/packages/TelegramClient-Core.package/TCCFileStore.class/class/extractPathFrom..st new file mode 100644 index 000000000..276d1b715 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/class/extractPathFrom..st @@ -0,0 +1,4 @@ +utility +extractPathFrom: anEvent + + ^ (anEvent at: 'local') at: 'path' \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/class/newWith..st b/packages/TelegramClient-Core.package/TCCFileStore.class/class/newWith..st new file mode 100644 index 000000000..51356af7c --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/class/newWith..st @@ -0,0 +1,6 @@ +instance creation +newWith: aCore + + ^ self new + core: aCore; + yourself \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core..st b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core..st new file mode 100644 index 000000000..bd19251b0 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core..st @@ -0,0 +1,4 @@ +accessing +core: aCore + + core := aCore \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core.st b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core.st new file mode 100644 index 000000000..7652dd8d1 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/core.st @@ -0,0 +1,4 @@ +accessing +core + + ^ core \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/instance/requestFileFor.with..st b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/requestFileFor.with..st new file mode 100644 index 000000000..735e29d67 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/instance/requestFileFor.with..st @@ -0,0 +1,9 @@ +utility +requestFileFor: aFileId with: aPromise + + "documented here:" + "https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1download_file.html" + + self core + send: (TCCRequest newRequestFile: aFileId) + thenDo: [:fileEvent | aPromise resolveWith: (self class extractPathFrom: fileEvent)]. \ 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 new file mode 100644 index 000000000..325d5428f --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/methodProperties.json @@ -0,0 +1,8 @@ +{ + "class" : { + "extractPathFrom:" : "JK 6/12/2024 19:32", + "newWith:" : "pk 6/19/2021 18:09" }, + "instance" : { + "core" : "pk 6/19/2021 16:13", + "core:" : "pk 6/19/2021 16:13", + "requestFileFor:with:" : "JK 6/12/2024 19:23" } } diff --git a/packages/TelegramClient-Core.package/TCCFileStore.class/properties.json b/packages/TelegramClient-Core.package/TCCFileStore.class/properties.json new file mode 100644 index 000000000..0a15dcf9d --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCFileStore.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "core" ], + "name" : "TCCFileStore", + "pools" : [ + ], + "super" : "Dictionary", + "type" : "normal" } diff --git a/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json index ae00ea616..b2a59b017 100644 --- a/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCImageStore.class/methodProperties.json @@ -1,11 +1,8 @@ { "class" : { "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52", - "newWith:" : "pk 6/19/2021 18:09" }, + "imageFormFrom:" : "pk 8/5/2021 16:52" }, "instance" : { - "core" : "pk 6/19/2021 16:13", - "core:" : "pk 6/19/2021 16:13", "getFormFor:" : "rgw 6/6/2022 18:51", "getFormPromiseFor:" : "rgw 6/6/2022 18:43", - "requestImageFor:with:" : "rgw 6/2/2022 11:17" } } + "requestImageFor:with:" : "JK 6/12/2024 19:46" } } diff --git a/packages/TelegramClient-Core.package/TCCImageStore.class/properties.json b/packages/TelegramClient-Core.package/TCCImageStore.class/properties.json index 761a7ed98..d9d81a226 100644 --- a/packages/TelegramClient-Core.package/TCCImageStore.class/properties.json +++ b/packages/TelegramClient-Core.package/TCCImageStore.class/properties.json @@ -6,9 +6,9 @@ ], "commentStamp" : "pk 6/19/2021 16:13", "instvars" : [ - "core" ], + ], "name" : "TCCImageStore", "pools" : [ ], - "super" : "Dictionary", + "super" : "TCCFileStore", "type" : "normal" } diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/README.md b/packages/TelegramClient-Core.package/TCCVideoStore.class/README.md new file mode 100644 index 000000000..163559385 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/README.md @@ -0,0 +1 @@ +A TCCImageStore is a cache for local image files on disk with a synchronous interface. diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/extractPathFrom..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/extractPathFrom..st new file mode 100644 index 000000000..276d1b715 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/extractPathFrom..st @@ -0,0 +1,4 @@ +utility +extractPathFrom: anEvent + + ^ (anEvent at: 'local') at: 'path' \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/imageFormFrom..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/imageFormFrom..st new file mode 100644 index 000000000..01f1dc7a4 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.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/TCCVideoStore.class/instance/getFormFor..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormFor..st new file mode 100644 index 000000000..4619676d9 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormFor..st @@ -0,0 +1,7 @@ +accessing +getFormFor: aThumbnailId + + | promise | + promise := self getFormPromiseFor: aThumbnailId. + promise wait. + ^ promise value \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormPromiseFor..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormPromiseFor..st new file mode 100644 index 000000000..3e615c584 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getFormPromiseFor..st @@ -0,0 +1,10 @@ +accessing +getFormPromiseFor: aThumbnailId + + | promise | + promise := self at: aThumbnailId ifAbsent: [ + self at: aThumbnailId put: Promise new. + self requestFileFor: aThumbnailId with: (self at: aThumbnailId). + self at: aThumbnailId + ]. + ^ promise >>= [:aPath | self class imageFormFrom: aPath] \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoFor..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoFor..st new file mode 100644 index 000000000..c8da72e61 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoFor..st @@ -0,0 +1,7 @@ +accessing +getVideoFor: aVideoId + + | promise | + promise := self getVideoPromiseFor: aVideoId. + promise wait. + ^ promise value \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoPromiseFor..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoPromiseFor..st new file mode 100644 index 000000000..78b7c96dc --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/instance/getVideoPromiseFor..st @@ -0,0 +1,10 @@ +accessing +getVideoPromiseFor: aVideoId + + | promise | + promise := self at: aVideoId ifAbsent: [ + self at: aVideoId put: Promise new. + self requestFileFor: aVideoId with: (self at: aVideoId). + self at: aVideoId + ]. + ^ promise \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json new file mode 100644 index 000000000..18a5f48f4 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -0,0 +1,9 @@ +{ + "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-Core.package/TCCVideoStore.class/properties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/properties.json new file mode 100644 index 000000000..b46843a59 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCCVideoStore", + "pools" : [ + ], + "super" : "TCCFileStore", + "type" : "normal" } diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st index b7a6e5509..6d2d59eb9 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/addThumbnail.st @@ -2,7 +2,7 @@ constructing addThumbnail | thumbnailForm thumbnailMorph | - thumbnailForm := self messageModel core imageStore getFormFor: self messageModel thumbnailId. + thumbnailForm := self messageModel core videoStore getFormFor: self messageModel thumbnailId. thumbnailForm := thumbnailForm scaledToWidth: self class defaultWidth. (thumbnailForm height > self class maxHeight) ifTrue: [ diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st index e6b4da27f..e70a37ace 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/instance/openVideo.st @@ -1,10 +1,9 @@ constructing openVideo - self messageModel core - send: (TCCRequest newRequestFile: self messageModel videoId) - thenDo: [:videoEvent | Smalltalk platformName caseOf: { - ['Win32'] -> [OSProcess command: 'cmd.exe /c ""', ((videoEvent at: 'local') at: 'path'), '""']. - ['MacOS'] -> [UIManager inform: 'Go buy something else.']. - ['unix'] -> [OSProcess command: 'open "', ((videoEvent at: 'local') at: 'path'), '"']} - ]. + | path | + path := self messageModel core videoStore getVideoFor: self messageModel videoId. + Smalltalk platformName caseOf: { + ['Win32'] -> [OSProcess command: 'cmd.exe /c ""', path, '""']. + ['MacOS'] -> [UIManager inform: 'Mac is not supported for videoplaying yet.']. + ['unix'] -> [OSProcess command: 'open "', path, '"']}. diff --git a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json index 70a8a9d8e..834427ba3 100644 --- a/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUVideoMessage.class/methodProperties.json @@ -4,5 +4,5 @@ "instance" : { "addContent" : "JK 6/12/2024 11:27", "addPlaybuttonTo:" : "JK 6/12/2024 12:14", - "addThumbnail" : "JK 6/12/2024 12:14", - "openVideo" : "JK 6/12/2024 11:39" } } + "addThumbnail" : "JK 6/12/2024 19:53", + "openVideo" : "JK 6/12/2024 19:41" } }