aboutsummaryrefslogtreecommitdiff
path: root/xmpp
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-07 03:04:49 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-07 03:04:49 +0300
commit9377d7a15538a6c0af97937806ecd55eb112beb3 (patch)
treec9bad96394b4b67c23268d8355eb066c73ae7a69 /xmpp
parentc03ccfdfb713d4fcb089600d9fd91f03e469daca (diff)
Save/read unavailable presence type in cachev1.7.5
Diffstat (limited to 'xmpp')
-rw-r--r--xmpp/handlers.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 6679a72..e85dfc9 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -15,6 +15,7 @@ import (
"dev.narayana.im/narayana/telegabber/xmpp/gateway"
log "github.com/sirupsen/logrus"
+ "github.com/soheilhy/args"
"gosrc.io/xmpp"
"gosrc.io/xmpp/stanza"
)
@@ -349,11 +350,18 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
log.Error(errors.Wrap(err, "TDlib connection failure"))
} else {
for status := range session.StatusesRange() {
+ show, description, typ := status.Destruct()
+ newArgs := []args.V{
+ gateway.SPImmed(false),
+ }
+ if typ != "" {
+ newArgs = append(newArgs, gateway.SPType(typ))
+ }
go session.ProcessStatusUpdate(
status.ID,
- status.Description,
- status.XMPP,
- gateway.SPImmed(false),
+ description,
+ show,
+ newArgs...,
)
}
session.UpdateChatNicknames()