[ejabberd] add_rosteritem behavior

Yiorgis Gozadinos ggozad at crypho.com
Mon Nov 7 15:55:48 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
> 
> See
> https://github.com/processone/ejabberd/commit/bd060bc1bb0b5078ddc00189556256418cac1a6f
> 
> 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
> 

Hey Badlop,
Thanks for the fix. Would it not make more sense to decouple add groups to a subscription from adding a subscription?
Then you would modify groups regardless of subscriptions. This would also be in sync with having separate tables for roster groups.


More information about the ejabberd mailing list