Open guusdk opened 8 months ago
This should be fixed by a3265f5d702fcac045add37aa7b526e884b15022
Hi @prefiks - apologies for the late response. It took me a while to test this. I believe that this change is over-doing it. The pub/sub data published by this version of the module now excludes domains that do not support the feature completely. That's undesired. Instead, we'd like to still have remote-domain
elements for every connection, but those elements should only have a name
attribute when the remote supports our protocol.
With your changes, this is logged on a server that has many server-to-server connections (note that it shows only one connection, to a remote domain that supports the feature):
<message to="xmppnetwork.goodbytes.im/networkinfocrawler" from="pubsub.example.org" type="headline">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="serverinfo">
<item id="current">
<serverinfo xmlns="urn:xmpp:serverinfo:0">
<domain name="example.org">
<federation>
<remote-domain name="igniterealtime.org">
<connection type="incoming"/>
</remote-domain>
</federation>
</domain>
</serverinfo>
</item>
</items>
</event>
</message>
Instead, we expect to see something like this (manually crafted example, excuse any error):
<message to="xmppnetwork.goodbytes.im/networkinfocrawler" from="pubsub.example.org" type="headline">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="serverinfo">
<item id="current">
<serverinfo xmlns="urn:xmpp:serverinfo:0">
<domain name="example.org">
<federation>
<remote-domain name="igniterealtime.org">
<connection type="incoming"/>
</remote-domain>
<remote-domain>
<connection type="incoming"/>
</remote-domain>
<remote-domain>
<connection type="incoming"/>
</remote-domain>
<remote-domain>
<connection type="incoming"/>
</remote-domain>
<remote-domain>
<connection type="incoming"/>
</remote-domain>
<remote-domain>
<connection type="incoming"/>
</remote-domain>
</federation>
</domain>
</serverinfo>
</item>
</items>
</event>
</message>
mod_pubsub_serverinfo implements XEP-0485: PubSub Server Information. The mod publishes the names of domains with which it federates.
The XEP contains this privacy consideration:
The implementation of mod_pubsub_serverinfo does not perform this check: it always publish the name of a the remote domains.
A modification should be made so that the
name
attribute of aremote-domain
element is added only after support the XEP has been detected. Support can be detected by performing a disco/info query to the remote domain, and check for the presence of the featureurn:xmpp:serverinfo:0
(as specified here)