aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-08 20:27:40 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-08 20:27:40 +0300
commit79fc0ddbe5010f54707441cb3f15c43192124ed2 (patch)
tree7b75034527a5dfc1952b2ddec7d0ebbc06754afc /telegram/utils.go
parent945b9c063b8bcf20f0df370fd1f68457f84f3361 (diff)
Set origin id, if available, to replies bridged from Telegram
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/telegram/utils.go b/telegram/utils.go
index ecce6da..a4a2bd4 100644
--- a/telegram/utils.go
+++ b/telegram/utils.go
@@ -330,9 +330,13 @@ func (c *Client) getMessageReply(message *client.Message) (reply *gateway.Reply,
return
}
+ replyId, err := gateway.IdsDB.GetByTgIds(c.Session.Login, c.jid, message.ChatId, message.ReplyToMessageId)
+ if err != nil {
+ replyId = strconv.FormatInt(message.ReplyToMessageId, 10)
+ }
reply = &gateway.Reply{
Author: fmt.Sprintf("%v@%s", c.getSenderId(replyMsg), gateway.Jid.Full()),
- Id: strconv.FormatInt(message.ReplyToMessageId, 10),
+ Id: replyId,
}
}