开发者

How to remove a user from all rosters in Ejabberd

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 u开发者_如何学运维nregister 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


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.


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 is where I've done it with openfire.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜