diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-01-27 05:02:47 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-01-27 05:02:47 +0300 |
commit | e37c428c6764eff8e7b5ea286b1c7a0ba52be11a (patch) | |
tree | ff1dd7c431499e93dff99669b8df90805ea59118 /xmpp/handlers.go | |
parent | b9b6ba14a442f3c4394c535461bd6b1d03a7ef7b (diff) |
XEP-0333 read markers for outgoing messages
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index 4c27b3c..088cb21 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -199,10 +199,12 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) { if err != nil { log.Errorf("Failed to replace id %v with %v %v", replace.Id, msg.Id, tgMessageId) } */ - session.AddToOutbox(replace.Id, resource) + session.AddToEditOutbox(replace.Id, resource) } else { err = gateway.IdsDB.Set(session.Session.Login, bare, toID, tgMessageId, msg.Id) - if err != nil { + if err == nil { + session.AddToOutbox(msg.Id, resource) + } else { log.Errorf("Failed to save ids %v/%v %v", toID, tgMessageId, msg.Id) } } @@ -458,6 +460,7 @@ func handleGetDiscoInfo(s xmpp.Sender, iq *stanza.IQ) { _, ok := toToID(iq.To) if ok { disco.AddIdentity("", "account", "registered") + disco.AddFeatures(stanza.NSMsgChatMarkers) } else { disco.AddIdentity("Telegram Gateway", "gateway", "telegram") disco.AddFeatures("jabber:iq:register") |