aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-06-20 02:56:18 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-06-20 02:56:18 +0300
commit3f96664ef3bc9faf61f837dddfc379ab2e69b904 (patch)
treeaf82aef8d9b2529115a315856d9213a956c0a078 /xmpp/handlers.go
parent70841a2bea61728c75f6675bcd3355e8dfdcd087 (diff)
Respond correctly to disco queries about account JIDs
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index d68838b..4f048fb 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -319,10 +319,16 @@ func handleGetDiscoInfo(s xmpp.Sender, iq *stanza.IQ) {
})
if err != nil {
log.Errorf("Failed to create answer IQ: %v", err)
+ return
}
disco := answer.DiscoInfo()
- disco.AddIdentity("Telegram Gateway", "gateway", "telegram")
+ _, ok := toToID(iq.To)
+ if ok {
+ disco.AddIdentity("", "account", "registered")
+ } else {
+ disco.AddIdentity("Telegram Gateway", "gateway", "telegram")
+ }
answer.Payload = disco
log.Debugf("%#v", answer)