diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-06-20 02:56:18 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-06-20 02:56:18 +0300 |
commit | 3f96664ef3bc9faf61f837dddfc379ab2e69b904 (patch) | |
tree | af82aef8d9b2529115a315856d9213a956c0a078 /xmpp | |
parent | 70841a2bea61728c75f6675bcd3355e8dfdcd087 (diff) |
Respond correctly to disco queries about account JIDs
Diffstat (limited to 'xmpp')
-rw-r--r-- | xmpp/handlers.go | 8 |
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) |