diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore..st b/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore..st new file mode 100644 index 00000000..4e51ed1a --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore..st @@ -0,0 +1,4 @@ +accessing +documentStore: aDocumentStore + + documentStore := aDocumentStore \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore.st b/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore.st new file mode 100644 index 00000000..18a5fa0f --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore.st @@ -0,0 +1,4 @@ +accessing +documentStore + + ^ documentStore \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st index 71e419f7..0cb4746f 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st +++ b/packages/TelegramClient-Core.package/TCCCore.class/instance/initialize.st @@ -10,6 +10,7 @@ initialize imageStore: (TCCImageStore newWith: self); videoStore: (TCCVideoStore newWith: self); stickerStore: (TCCStickerStore newWith: self); + documentStore: (TCCDocumentStore 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/methodProperties.json b/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json index 83f675f4..f94e6646 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCCore.class/methodProperties.json @@ -14,6 +14,8 @@ "checkAuthenticationPassword:" : "aka 5/21/2022 11:31", "client" : "R.S 5/20/2020 16:08", "client:" : "pk 8/5/2021 16:39", + "documentStore" : "JK 6/26/2024 14:19", + "documentStore:" : "JK 6/26/2024 14:19", "freeClient" : "6/9/2021 14:12:18", "generateCallbackId" : "pk 8/5/2021 17:04", "getOwnProfile" : "pk 8/5/2021 17:05", @@ -22,7 +24,7 @@ "handlePendingEvent:" : "per 8/2/2021 15:05", "imageStore" : "pk 6/19/2021 17:15", "imageStore:" : "TR 6/22/2021 09:33", - "initialize" : "JK 6/20/2024 22:16", + "initialize" : "JK 6/26/2024 14:18", "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/TCCCore.class/properties.json b/packages/TelegramClient-Core.package/TCCCore.class/properties.json index ee2cf160..af325268 100644 --- a/packages/TelegramClient-Core.package/TCCCore.class/properties.json +++ b/packages/TelegramClient-Core.package/TCCCore.class/properties.json @@ -15,7 +15,8 @@ "callbackCounter", "userStore", "videoStore", - "stickerStore" ], + "stickerStore", + "documentStore" ], "name" : "TCCCore", "pools" : [ ], diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st index b170102c..8bd211c3 100644 --- a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/class/newFrom..st @@ -3,4 +3,5 @@ newFrom: aJsonObject ^ self new filename: ((aJsonObject at: 'document') at: 'file_name'); + documentId: (((aJsonObject at: 'document') at: 'document') at: 'id'); yourself diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId..st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId..st new file mode 100644 index 00000000..98a9aee8 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId..st @@ -0,0 +1,4 @@ +accessing +documentId: aNumber + + documentId := aNumber \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId.st b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId.st new file mode 100644 index 00000000..c75da9f3 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId.st @@ -0,0 +1,4 @@ +accessing +documentId + + ^ documentId \ 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 index d7c6e18f..b2d29d74 100644 --- a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json @@ -1,8 +1,10 @@ { "class" : { - "newFrom:" : "JK 6/23/2024 11:52" }, + "newFrom:" : "JK 6/26/2024 14:23" }, "instance" : { "asSnippet" : "AH 6/21/2024 13:54", "asText" : "AH 6/21/2024 13:54", + "documentId" : "JK 6/26/2024 14:14", + "documentId:" : "JK 6/26/2024 14:14", "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 index 7aaf0762..cb317ca1 100644 --- a/packages/TelegramClient-Core.package/TCCDocumentMessage.class/properties.json +++ b/packages/TelegramClient-Core.package/TCCDocumentMessage.class/properties.json @@ -6,7 +6,8 @@ ], "commentStamp" : "", "instvars" : [ - "filename" ], + "filename", + "documentId" ], "name" : "TCCDocumentMessage", "pools" : [ ], diff --git a/packages/TelegramClient-Core.package/TCCDocumentStore.class/README.md b/packages/TelegramClient-Core.package/TCCDocumentStore.class/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentFor..st b/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentFor..st new file mode 100644 index 00000000..b0f52fe2 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentFor..st @@ -0,0 +1,7 @@ +as yet unclassified +getDocumentFor: aDocumentId + + | promise | + promise := self getDocumentPromiseFor: aDocumentId. + promise wait. + ^ promise value \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentPromiseFor..st b/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentPromiseFor..st new file mode 100644 index 00000000..a1b5b20c --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentPromiseFor..st @@ -0,0 +1,10 @@ +as yet unclassified +getDocumentPromiseFor: aDocumentId + + | promise | + promise := self at: aDocumentId ifAbsent: [ + self at: aDocumentId put: Promise new. + self requestFileFor: aDocumentId with: (self at: aDocumentId). + self at: aDocumentId + ]. + ^ promise \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCDocumentStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCDocumentStore.class/methodProperties.json new file mode 100644 index 00000000..995fe810 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentStore.class/methodProperties.json @@ -0,0 +1,6 @@ +{ + "class" : { + }, + "instance" : { + "getDocumentFor:" : "JK 6/26/2024 14:17", + "getDocumentPromiseFor:" : "JK 6/26/2024 14:17" } } diff --git a/packages/TelegramClient-Core.package/TCCDocumentStore.class/properties.json b/packages/TelegramClient-Core.package/TCCDocumentStore.class/properties.json new file mode 100644 index 00000000..d68c711f --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCDocumentStore.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "TelegramClient-Core", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "TCCDocumentStore", + "pools" : [ + ], + "super" : "TCCFileStore", + "type" : "normal" } diff --git a/packages/TelegramClient-UI.package/TCUChatPollEditor.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatPollEditor.class/methodProperties.json index 186c7f6f..778162d1 100644 --- a/packages/TelegramClient-UI.package/TCUChatPollEditor.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatPollEditor.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "newFor:withBounds:" : "jkon 6/17/2024 11:14" }, "instance" : { - "addChoices" : " 6/24/2024 10:41:19", + "addChoices" : "6/24/2024 10:41:19", "addChoices:" : "jkon 6/19/2024 21:34", "addConfirmButton:" : "jkon 6/18/2024 10:05", "addInputFieldFor:" : "jkon 6/19/2024 21:44", diff --git a/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json index b4a21c1e..eddc26e0 100644 --- a/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChatWindow.class/methodProperties.json @@ -8,7 +8,7 @@ "addChatTitle" : "RK 8/4/2021 12:06", "addFileButton" : "ED 6/19/2024 10:59", "addHiddenInfoPage" : "per 6/15/2021 09:02", - "addHiddenPollEditor" : " 6/24/2024 10:41:19", + "addHiddenPollEditor" : "6/24/2024 10:41:19", "addInputBar" : "ED 6/19/2024 12:20", "addMemberCount" : "RK 8/4/2021 12:06", "addPollButton" : "jkon 6/18/2024 13:38", @@ -45,7 +45,7 @@ "sendButton" : "ek 6/19/2022 18:53", "sendButton:" : "ek 6/19/2022 18:53", "showInfoPage" : "per 5/30/2021 11:51", - "showPollEditor" : " 6/24/2024 10:41:19", + "showPollEditor" : "6/24/2024 10:41:19", "stickerButton" : "JK 5/21/2024 10:04", "stickerButton:" : "JK 5/21/2024 10:04", "stickerWindow" : "JK 5/29/2024 14:46", diff --git a/packages/TelegramClient-UI.package/TCUChoice.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUChoice.class/methodProperties.json index 23d23aee..45c34103 100644 --- a/packages/TelegramClient-UI.package/TCUChoice.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUChoice.class/methodProperties.json @@ -1,15 +1,15 @@ { "class" : { "newFor:" : "jkon 6/19/2024 18:26", - "newFor:isExclusive:" : " 6/24/2024 10:41:19" }, + "newFor:isExclusive:" : "6/24/2024 10:41:19" }, "instance" : { "addSelectionMorph" : "jkon 6/19/2024 18:32", "addTextMorph" : "jkon 6/17/2024 15:32", "content" : "jkon 6/17/2024 15:32", "content:" : "jkon 6/17/2024 15:32", "initialize" : "jkon 6/18/2024 10:03", - "isExclusive" : " 6/24/2024 10:41:19", - "isExclusive:" : " 6/24/2024 10:41:19", + "isExclusive" : "6/24/2024 10:41:19", + "isExclusive:" : "6/24/2024 10:41:19", "isSelected" : "jkon 6/17/2024 14:52", "isSelected:" : "jkon 6/17/2024 14:52", "selectionMorph" : "jkon 6/17/2024 15:20", diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st index 94ac59d7..10b2f8c9 100644 --- a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st @@ -1,7 +1,8 @@ constructing addIcon - | iconForm | + | iconForm iconMorph| iconForm := self class getIcon. - iconForm := iconForm scaledToHeight: self class maxHeight. - self addMorphBack: iconForm asMorph + iconMorph := (iconForm scaledToHeight: self class maxHeight) asMorph. + iconMorph on: #mouseDown send: #moveDocument to: self. + self addMorphBack: iconMorph diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/moveDocument.st b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/moveDocument.st new file mode 100644 index 00000000..fc5ebd64 --- /dev/null +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/moveDocument.st @@ -0,0 +1,17 @@ +constructing +moveDocument + + | sourceFile destinationFile sourceStream destinationStream | + + sourceFile := self messageModel core documentStore getDocumentFor: self messageModel documentId. + destinationFile := (DirectoryChooserDialog openOn:FileDirectory default label: 'Select Directory for download') pathName, '\', self messageModel filename. + Transcript show: destinationFile. + + sourceStream := StandardFileStream readOnlyFileNamed: sourceFile. + destinationStream := StandardFileStream newFileNamed: destinationFile. + destinationStream binary. + [sourceStream atEnd] whileFalse: [ + destinationStream nextPutAll: (sourceStream next: 1024). + ]. + sourceStream close. + destinationStream close. \ No newline at end of file diff --git a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json index 37bd35cc..f611c91f 100644 --- a/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json +++ b/packages/TelegramClient-UI.package/TCUDocumentMessage.class/methodProperties.json @@ -4,4 +4,5 @@ "maxHeight" : "AH 6/21/2024 14:32" }, "instance" : { "addContent" : "AH 6/21/2024 14:07", - "addIcon" : "AH 6/21/2024 14:10" } } + "addIcon" : "JK 6/26/2024 12:31", + "moveDocument" : "JK 6/26/2024 14:23" } }