diff --git a/telegram/utils.go b/telegram/utils.go index d6f8a20..fa48164 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -1984,13 +1984,16 @@ func (c *Client) SendMessageToGateway(chatId int64, message *client.Message, id // forward message to XMPP var sId string var stanzaId string + var auxId string strId := strconv.FormatInt(message.Id, 10) if id == "" { sId = strId stanzaId = strId + auxId = "c"+strId } else { sId = id stanzaId = strId + auxId = "" } var from string @@ -2031,7 +2034,7 @@ func (c *Client) SendMessageToGateway(chatId int64, message *client.Message, id for _, jid := range jids { gateway.SendMessageWithOOB(jid, from, text, sId, c.xmpp, reply, timestamp, oob, "", isCarbon, isGroupchat, c.Session.Receipts, originalFrom, stanzaId, mamQueryId, mucJID, mucUserItem) if auxText != "" { - gateway.SendMessage(jid, from, auxText, sId, c.xmpp, reply, timestamp, "", isCarbon, isGroupchat, c.Session.Receipts, originalFrom, stanzaId, mamQueryId, mucJID, mucUserItem) + gateway.SendMessage(jid, from, auxText, auxId, c.xmpp, reply, timestamp, "", isCarbon, isGroupchat, c.Session.Receipts, originalFrom, auxId, mamQueryId, mucJID, mucUserItem) } } c.UpdateLastChatMessageId(chatId, sId) diff --git a/xmpp/handlers.go b/xmpp/handlers.go index 194c861..38266da 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -2908,6 +2908,8 @@ func parseMessageId(sId string) (int64, bool) { if len(idParts) >= 1 { sId = idParts[0] } + } else if sId[0] == 'c' { + sId = sId[1:] } id, err := strconv.ParseInt(sId, 10, 64) if err != nil {