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 { if err != nil {
log.Errorf("Failed to create answer IQ: %v", err) log.Errorf("Failed to create answer IQ: %v", err)
return
} }
disco := answer.DiscoInfo() disco := answer.DiscoInfo()
_, ok := toToID(iq.To)
if ok {
disco.AddIdentity("", "account", "registered")
} else {
disco.AddIdentity("Telegram Gateway", "gateway", "telegram") disco.AddIdentity("Telegram Gateway", "gateway", "telegram")
}
answer.Payload = disco answer.Payload = disco
log.Debugf("%#v", answer) log.Debugf("%#v", answer)