[ejabberd] add_rosteritem behavior

Badlop badlop at gmail.com
Fri Nov 4 20:50:00 MSK 2016


I've committed an improvement to the add_rosteritem command, so now it
is possible to provide several groups as argument:
$ ejabberdctl add_rosteritem user1 localhost user3 localhost UsER3
"g1;g2;g3" both


As you noticed, this command overwrites the previous roster item,
which means any previous information, like previous groups, is lost.

If you want to preserve old groups, and simply add more, then you will
have to write that yourself. For example, get previous groups with
this, and add them to your argument:
$ ejabberdctl get_roster user1 localhost
user3 at localhost UsER3   both    none    g3
user3 at localhost UsER3   both    none    g2
user3 at localhost UsER3   both    none    g1


On 1 November 2016 at 09:36, Yiorgis Gozadinos <ggozad at crypho.com> wrote:
> Reviving an old thread as I managed to find some time to look into this
> again :) Badlop sorry for such a delay…
> I did configure xmlrpc and mod_admin_extra to try it out. There is one
> additional problem though.
> We rely on having multiple groups for users, i.e. a user belongs to several
> groups for some other user’s roster.
> When using add_rosteritem, all previous group associations in the
> rostergroups table are lost.
> Shouldn’t it be the case that the groups are preserved and new entries
> created in rostergroups?
> Alternatively, is there a way to use add_rosteritem WITHOUT a group? We
> could then keep updating rostergroups manuall...
> Hi,
> If you enable mod_admin_extra, it provides several ejabberd commands
> for managing user rosters. I hope some of those commands will not have
> the problem you mention.
> You can execute those commands using the the ejabberdctl shell script
> (good for testing), xmlrpc queries (enabling ejabberd_xmlrpc), ReST
> queries (enabling mod_http_api, or installing mod_rest).
> --
> Badlop
> ProcessOne
> On 29 August 2016 at 10:39, Yiorgis Gozadinos <ggozad at crypho.com> wrote:
>> Hey all,
>> In our application for certain things we would like to directly manipulate
>> rosterusers and rostergroups outside ejabberd. While this works fine after
>> a
>> while, ejabberd seems to rely on a cache for some time giving roster to
>> users which is not in sync with the db. Is there a way of notifying
>> ejabberd
>> to invalidate its cache or managing this in a better way?
>> --
>> Yiorgis Gozadinos
>> www.crypho.com
>> www.about.me/gozadinos
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd

More information about the ejabberd mailing list