From 3f96664ef3bc9faf61f837dddfc379ab2e69b904 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sun, 19 Jun 2022 19:56:18 -0400 Subject: [PATCH] Respond correctly to disco queries about account JIDs --- xmpp/handlers.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)