I received an email with questions about roster management in ejabberd. Since I think this discusion may be interesting also to other people, I bring it to a public forum:
---------------------------
Hi Badlop!
[...]
I decided to take the opportunity to check out ejabberd, as I'd been hearing some good things about it. I spent the last three days getting to know it better, reading the forums, checking out Erlang, and playing with all the bells and whistles. I'm *really* enjoying it, but I feel like a complete babe in the woods with Erlang. ;)
So, I was very excited about the shared roster support. With jabberd2, we were using an sqlite backend for rosters, and within a transaction, we torched each user's roster and repopulated (with subscription = both) from our LDAP. This is a corporate, internal server, so there is
no expectation of individual rosters or users fiddling with presence subscription, we manage it all.
According to what I've seen in the forums, it looks like there are still some problems with shared rosters. Enough so that I don't think we can use them yet. Okay - no prob. I found and installed your mod_cltextra, and went to try the pushroster-all command.
Whew... and now to my questions.
1) Looks like pushroster-all appends to the rosters. How can I purge the roster before pushing a new one?
2) Can I include full names somewhere in the roster file? Our users have been used to them with our jabberd2 manipulations, it would be 'weird' to go to JIDs for them.
3) Am I even headed in the right direction with your additions to ejabberd_ctl? Would this sort of action be better suited as a erlang 'one-off'?
4) Or is all this shared roster madness fixed in trunk, including namespace stuff? (I didn't see that it was, but thought I'd ask.)
I'm not opposed to digging through the existing erlang code and hacking my way through this myself, but I'd really, really appreciate some pointers on where to start. :)
Thanks for your time!
-Mahlon
---------------------------
Partial answers
1) Looks like pushroster-all appends to the rosters. How can I purge the roster before pushing a new one?
Well, you can destroy all rosters at 3:00 AM in the morning: clean the Mnesia table 'roster'. It's easy to add a command to mod_ctlextra to do this.
It's also possible to improve the pushroster command to first remove all roster items for the user.
2) Can I include full names somewhere in the roster file? Our users have been used to them with our jabberd2 manipulations, it would be 'weird' to go to JIDs for them.
Yes, probably improving the command.
3) Am I even headed in the right direction with your additions to ejabberd_ctl? Would this sort of action be better suited as a erlang 'one-off'?
I don't understand the meaning of one-off.
4) Or is all this shared roster madness fixed in trunk, including namespace stuff? (I didn't see that it was, but thought I'd ask.)
I don't know what exact problems you are mentioning, so I don't know if they are fixed. ;) If shared-roster works for you, you will save a lot of time in setting mod_ctlextra+roster text files. So let's investigate this possibility before.
mod_ctlextra delete-and-push-shared
[...]
Well, you can destroy all rosters at 3:00 AM in the morning: clean the Mnesia table 'roster'. It's easy to add a command to mod_ctlextra to do this.
It's also possible to improve the pushroster command to first remove all roster items for the user.
[...]
I don't understand the meaning of one-off.
Oh, sorry. I meant writing a standalone .beam or whatever to do the custom roster management rather than tinker inside of ejabberd_ctl, but it sounds like ejabberdctl modifications are the way to go.
I don't know what exact problems you are mentioning, so I don't know if they are fixed. ;) If shared-roster works for you, you will save a lot of time in setting mod_ctlextra+roster text files. So let's investigate this possibility before.
I was referring to the presence stuff athttp://www.jabber.ru/bugzilla/show_bug.cgi?id=223 . There was another bug I saw while trolling around, involving a user modifying a shared roster from within their client -- but I can't find a reference to that one now, of course. ;)
I'd far prefer doing the 'right thing' and go down the shared roster path (assuming the above is no longer a problem), and potentially adding a command to mod_ctlextra like 'push-sharedroster' that wipes current shared roster data, and repopulates it from a text file, along with optional Nicknames. Then I can setup a 3am job that polls our LDAP, builds the file (Employees arranged by their respective department), and runs the ejabberdctl command. Employees might actually like organizing their rosters for once instead of getting them blown away each night. :)
Thanks for the response!