Respond correctly to disco queries about account JIDs

This commit is contained in:
Bohdan Horbeshko 2022-06-19 19:56:18 -04:00
parent 70841a2bea
commit 3f96664ef3

View file

@ -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)