Open truenicoco opened 2 years ago
Any chance this will be implemented soon™?
Any chances for this being updated?
I specifically need the IQ permission part, which was added in version 0.4.
Not opening a new issue to prevent duplicates...
I wrote a small patch in the xmpp library, and pointed ejabberd to use that one. Can you check if it works as expected?
@truenicoco, @ravermeister, @trungnt2910: Have you tested?
It is good, it can be merged?
@badlop As we have no feedback at the moment, do you think the patch is good enough for inclusion in 24.07 ?
I've tested the latest update. The server reports now iq permissions to the slidge gateway:
<message to="whatsapp.<redacted>" from="<redacted>.de">
<privilege xmlns="urn:xmpp:privilege:2">
<perm type="outgoing" access="message"/>
<perm type="both" access="roster"/>
<perm type="both" access="iq"/>
<perm type="none" access="presence"/>
</privilege>
</message>
Slidge still complains:
WARNING:slidge.core.gateway.base:IQ privileges not granted for pubsub namespace, we cannot create the MDS node of matthias@<redacted>
WARNING:slidge.core.gateway.base:IQ privileges not granted for pubsub#owner namespace, we cannot listen to the MDS events of matthias@<redacted>
/venv/lib/python3.11/site-packages/slidge/group/room.py:901:UserWarning:IQ privileges (XEP0356) are not set, we cannot fetch the user bookmarks
/venv/lib/python3.11/site-packages/slidge/group/room.py:924:UserWarning:IQ privileges (XEP0356) are not set, we cannot add bookmarks for the user
That might be because the iq permissions must be advertised per namespace.
Oh wait, I think what ejabberd sends is actually OK and should be interpreted as "permission for all namespaces", I have to update slidge to interpret it as such.
~Indeed~, cf https://xmpp.org/extensions/xep-0356.html#example-8
<message from='capulet.net' to='pubub.capulet.lit' id='iq_perm_1'>
<privilege xmlns='urn:xmpp:privilege:2'>
<perm access='iq'>
<namespace ns='http://jabber.org/protocol/pubsub' type='set' />
</perm>
</privilege>
</message>
Well, after all it seems that what this patch does is illegal, authorized IQ namespaces MUST be specified:
To grant an "iq" permission, authorised namespaces must be specified
Server adversites "iq" permission by using a
element with an 'access' attribute of the value "iq" and wihout 'type' attribute
I did push a patch in slidge that allows it anyway, so someone can test anyway if they want!
mod_privilege does not implement the latest revision of XEP-0356, which notably includes a namespace version bump, making it incompatible with components relying on this latest revision.