diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-04-12 03:59:49 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-04-12 03:59:49 +0300 |
commit | f15e44436beb9629bbd57607faba072b1f9a9b18 (patch) | |
tree | e80a3a0a2a89c8328c2bcc857a8dab1148fb8d3f /telegram | |
parent | a36856b76852c98681fd7c30fbdededb3cfc5470 (diff) |
Use carbons for non-native edits too
Diffstat (limited to 'telegram')
-rw-r--r-- | telegram/handlers.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go index 64280e6..3c54746 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -304,20 +304,21 @@ func (c *Client) updateMessageContent(update *client.UpdateMessageContent) { } if ok && lastXmppId == xmppId { replaceId = xmppId - message, err := c.client.GetMessage(&client.GetMessageRequest{ - ChatId: update.ChatId, - MessageId: update.MessageId, - }) - if err == nil { - isCarbon = c.isCarbonsEnabled() && message.IsOutgoing - } else { - log.Errorf("No message %v/%v found, cannot reliably determine if it's a carbon", update.ChatId, update.MessageId) - } } else { log.Infof("Mismatching message ids: %v %v, falling back to separate edit message", lastXmppId, xmppId) } } + message, err := c.client.GetMessage(&client.GetMessageRequest{ + ChatId: update.ChatId, + MessageId: update.MessageId, + }) + if err == nil { + isCarbon = c.isCarbonsEnabled() && message.IsOutgoing + } else { + log.Errorf("No message %v/%v found, cannot reliably determine if it's a carbon", update.ChatId, update.MessageId) + } + text := formatter.Format( textContent.Text.Text, textContent.Text.Entities, |