diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-07-09 00:59:51 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-07-09 00:59:51 +0300 |
commit | 7eaf28ad7c4d2bdf5aa6313503d751de90a6811c (patch) | |
tree | 4ef33fb17e541fda4744fa1afaba191583d44e67 /xmpp/handlers.go | |
parent | 63521b8f90af65cad9ca7510be3c2b76307d8090 (diff) |
Advertise gateway first, MUC next
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index fde7382..0de33b8 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -340,6 +340,10 @@ func handleGetDisco(dt discoType, s xmpp.Sender, iq *stanza.IQ) { if dt == discoTypeInfo { disco := answer.DiscoInfo() toID, toOk := toToID(iq.To) + if !toOk { + disco.AddIdentity("Telegram Gateway", "gateway", "telegram") + } + var isMuc bool bare, _, fromOk := splitFrom(iq.From) if fromOk { @@ -386,12 +390,8 @@ func handleGetDisco(dt discoType, s xmpp.Sender, iq *stanza.IQ) { } } } - if toOk { - if !isMuc { - disco.AddIdentity("", "account", "registered") - } - } else { - disco.AddIdentity("Telegram Gateway", "gateway", "telegram") + if toOk && !isMuc { + disco.AddIdentity("", "account", "registered") } answer.Payload = disco } else if dt == discoTypeItems { |