I have a use case, in which as an admin user in ejabberd, I should be able to edit rosters for all other users. I am using smack library to connect to the ejabberd server using TCP connection.
Reading the documentation of ejabberd 14.07 here is the what it says under mod_roster:
managers List of remote entities that can manage users rosters using Remote Roster Management (XEP-0321). The protocol sections implemented are: 4.2. The remote entity requests current user’s roster. 4.3. The user updates roster. 4.4. The remote entity updates the user’s roster. A remote entity cab only get or modify roster items that have the same domain as the entity. Default value is: []. This example configuration enables Roster Versioning with storage of current id. The ICQ and MSN transports can get ICQ and MSN contacts, add them, or remove them for any local account:
I made the config changes in ejabberd and sent the following packets :
<iq id='PCe38-23' to='%[email protected]/Smack' type='set'>
<query xmlns='jabber:iq:roster'>
<item jid='%[email protected]/Smack'
name='Siddharth Banerjee'
subscription='both'>
</item>
</query>
</iq>
<iq id='PCe38-24' to='%[email protected]/Smack' type='set'>
<query xmlns='jabber:iq:roster'>
<item jid='%[email protected]/Smack'
name='deco'
subscription='both'>
</item>
</query>
</iq>
But I am getting the following :
<iq from='%[email protected]/Smack' to='[email protected]/75250b26-a52a-4e1d-a5fb-4b263cd2f451' type='error' id='PCe38-23'>
<query xmlns='jabber:iq:roster'>
<item jid='%[email protected]/Smack' name='Siddharth Banerjee' subscription='both'>
</item>
</query>
<error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>
How do I modify another user's roster using smack ?
Please advise.