Use carbons for non-native edits too
This commit is contained in:
parent
a36856b768
commit
f15e44436b
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue