aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 541eb63..9caf886 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -254,6 +254,30 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) {
gateway.MessageOutgoingPermissionVersion = 2
}
}
+
+ var displayed stanza.MarkDisplayed
+ msg.Get(&displayed)
+ if displayed.ID != "" {
+ log.Debugf("displayed: %#v", displayed)
+
+ bare, _, ok := gateway.SplitJID(msg.From)
+ if !ok {
+ return
+ }
+ session, ok := sessions[bare]
+ if !ok {
+ return
+ }
+ toID, ok := toToID(msg.To)
+ if !ok {
+ return
+ }
+ msgId, err := strconv.ParseInt(displayed.ID, 10, 64)
+ if err == nil {
+ session.MarkAsRead(toID, msgId)
+ }
+ return
+ }
}
if msg.Type == "error" {