Don't differentiate between account and resource in disco#info

- So the entity caps stuff didn't actually work, because we don't implement
  XEP-0030 properly and don't honour the "node" attribute on the query.
- To hack around this, we misimplement XEP-0030 some more, and always return the
  bridged user disco info list, even if they ask for the bare JID instead of the
  full JID. That way, the caps stuff works as it should.
This commit is contained in:
eta 2020-08-01 17:54:37 +01:00
parent 912c09edc4
commit 99df4a56fe

View file

@ -44,7 +44,7 @@
,@(multiple-value-bind
(to-hostname to-localpart to-resource)
(parse-jid to)
(declare (ignore to-hostname))
(declare (ignore to-hostname to-resource))
(let* ((uid (get-user-id from))
(user-name (get-contact-name uid to-localpart))
(chat-subject (get-user-chat-subject uid to-localpart)))
@ -53,9 +53,7 @@
`((disco-identity "whatsxmpp bridge" "xmpp" "gateway")
(disco-feature ,+disco-items-ns+)
(disco-feature ,+muc-ns+)))
((and user-name (not to-resource))
`((disco-identity ,user-name "registered" "account")))
((and user-name (equal to-resource "whatsapp"))
(user-name
+whatsapp-user-disco-info-list+)
(chat-subject
`((disco-identity ,chat-subject "text" "conference")