diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-05 11:22:13 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-05 11:22:13 +0300 |
commit | 7215d11d7973b9896c6223938649c75165fa3ae7 (patch) | |
tree | 0aa0bf028cc899a283eb55654ee7618eba167681 /telegram/handlers.go | |
parent | a5c90340ad2da16a68ddcbfa3d9573f0664067ca (diff) |
XEP-0308 message editing
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r-- | telegram/handlers.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go index bd768ae..6de59e7 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -272,6 +272,11 @@ func (c *Client) updateAuthorizationState(update *client.UpdateAuthorizationStat // clean uploaded files func (c *Client) updateMessageSendSucceeded(update *client.UpdateMessageSendSucceeded) { + log.Debugf("replace message %v with %v", update.OldMessageId, update.Message.Id) + if err := gateway.IdsDB.ReplaceTgId(c.Session.Login, c.jid, update.Message.ChatId, update.OldMessageId, update.Message.Id); err != nil { + log.Error("failed to replace %v with %v: %v", update.OldMessageId, update.Message.Id, err.Error()) + } + file, _ := c.contentToFile(update.Message.Content) if file != nil && file.Local != nil { c.cleanTempFile(file.Local.Path) |