diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-01-27 05:09:19 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-01-27 05:09:19 +0300 |
commit | 6da0fd56fff386f19ae982cc02c8f0996c51e2f1 (patch) | |
tree | f8e491d6bf2a77655e74b0523e460c514425cd4f /telegram/handlers.go | |
parent | 02444d7a044fad74414e7d55905ab5a13df61aae (diff) |
Force downloading the chat photo when vCard is requested
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r-- | telegram/handlers.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go index a28d5da..cf8b3d8 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -134,11 +134,7 @@ func (c *Client) updateUserStatus(update *client.UpdateUserStatus) { func (c *Client) updateNewChat(update *client.UpdateNewChat) { go func() { if update.Chat != nil && update.Chat.Photo != nil && update.Chat.Photo.Small != nil { - _, err := c.client.DownloadFile(&client.DownloadFileRequest{ - FileId: update.Chat.Photo.Small.Id, - Priority: 32, - Synchronous: false, - }) + _, err := c.DownloadFile(update.Chat.Photo.Small.Id, 32, true) if err != nil { log.Error("Failed to download the chat photo") @@ -196,11 +192,7 @@ func (c *Client) updateNewMessage(update *client.UpdateNewMessage) { // download file(s) if file != nil && !file.Local.IsDownloadingCompleted { - c.client.DownloadFile(&client.DownloadFileRequest{ - FileId: file.Id, - Priority: 10, - Synchronous: false, - }) + c.DownloadFile(file.Id, 10, false) } // OTR support (I do not know why would you need it, seriously) if !strings.HasPrefix(text, "?OTR") { |