ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

Module Shared Roster removes subscription instead of updating groups

Open jlemangarin opened this issue 6 years ago • 0 comments

Hello !

I've opened a JSXC issue that explains this issue if you want to have a look : https://github.com/jsxc/jsxc/issues/793

It seems, after investigations, that this is a server-side issue according to the XMPP specifications (https://tools.ietf.org/html/rfc6121#section-2.1.6 page 22).

When a contact is removed from a shared roster where we are but still here in another shared roster where we also are, Ejabberd should send this kind of request (from specs) :

The user who has this item in her roster might want to add the item
   to another group.

   C: <iq from='[email protected]/balcony'
          id='di43b2x9'
          type='set'>
        <query xmlns='jabber:iq:roster'>
          <item jid='[email protected]'
                name='Romeo'>
            <group>Friends</group>
            <group>Lovers</group>
          </item>
        </query>
      </iq>

   Sometime later, the user might want to remove the item from the
   original group.

   C: <iq from='[email protected]/balcony'
          id='lf72v157'
          type='set'>
        <query xmlns='jabber:iq:roster'>
          <item jid='[email protected]'
                name='Romeo'>
            <group>Lovers</group>
          </item>
        </query>
      </iq>

But instead, Ejabberd sends a subscription="remove" request (from my implementation) :

<item xmlns="jabber:iq:roster" subscription="both" jid="[email protected]">
    <group>**4_Group**</group>
    <group>**5_Orga**</group>
</item>
.......
<iq xmlns="jabber:client" to="[email protected]/jsxc-d4c069ff" from="[email protected]" type="set" id="push14351270947443124645">
    <query xmlns="jabber:iq:roster">
        <item subscription="remove" jid="[email protected]">
            <group>**5_Orga**</group>
        </item>
    </query>
</iq>

Instead of sending a remove request on 5_Orga, ejabberd should send a set request on 4_Groups in this case.

Thanks in advance !

jlemangarin avatar Jul 24 '19 11:07 jlemangarin