diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-07-09 06:52:30 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-07-09 06:52:30 +0300 |
commit | 959dc061ff30ba1cf5c699adc0f7d1d991d7afa5 (patch) | |
tree | c9c0b6c97ec703ad6fbc2f75b250dd9930f2a653 /xmpp/handlers.go | |
parent | 30b3fd16153fab727315f014150d98b367ccd6ad (diff) |
Send carbons for outgoing messages to other resources
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index 1286914..e6671bc 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -167,6 +167,8 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) { } } + session.SendMessageLock.Lock() + defer session.SendMessageLock.Unlock() tgMessageId := session.ProcessOutgoingMessage(toID, text, msg.From, replyId, replaceId) if tgMessageId != 0 { if replaceId != 0 { @@ -181,6 +183,7 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) { log.Errorf("Failed to save ids %v/%v %v", toID, tgMessageId, msg.Id) } } + session.AddToOutbox(msg.Id, resource) } else { /* // if a message failed to edit on Telegram side, match new XMPP ID with old Telegram ID anyway |