views:

345

answers:

3

Hi,

I want to delete a chat account and at the same time :

  1. Delete his roster
  2. Delete him from all of his friends rosters

How can i do this?

I have tried the various options of ejabberdctl. I can unregister a user, and even purge his roster, but i cant find a way to remove him from other rosters.

PS : All my users are currently on one server/host

A: 

If you save the roster data in mnesia (mod_roster) and not in an external database (mod_roster_odbc), then mod_admin_extra:delete_rosteritem/4 might help you to delete the user's roster. Otherwise you will have to use odbc_queries functionality.

If the user's contacts are your users as well (no s2s connections allowed), then you might use delete_rosteritem with swapped arguments, or use mnesia/odbc hackery. In a federated setup you will not have access to the contact's roster, but you can probably send his server both, an presence unsubscribe and a presence unsubscribed stanza. See RFC 3921 or ask for detail.

Unfortunately, I do not know a ready-to-use solution, but might come up with one in the following weeks.

A: 

Usually deleting a user will unsubscribe them from all the local user's rosters, as well as send remote users unsubscribe requests through the server-to-server component. You may want to look at ad-hoc commands, which ejabberd supports. This way you can script a tool to do it from the command line, which is what it looks like you want from your question tags.

The web admin UI may be a popular place to do it. I know that's where I've done it with openfire.

A. R. Diederich
A: 

I can write extra module for do this action if you want.

vinnitu