[ejabberd] pubsub - remove_user does not call unsubscribe_node

Christophe Romain cromain at process-one.net
Tue Dec 14 16:06:48 MSK 2010


Hello

>remove_user(User, Server) ->
>...
>          lists:foreach(fun
>            ({#pubsub_node{id = NodeId}, _, _, JID}) -> node_action(Host, PType, unsubscribe_node, [NodeId, Entity, JID, all])
>              %%% I think there is an extra '_,' before JID, once I removed one underscore, the code seems be running again. %%%
>          end, Subscriptions),

you're right
there are 2 possible notations here:
{Node, Sub, SubId, JID}  % all should be like this
{Node, Sub, JID}  % backward compatible

both are supported from mnesia and sql backend
for the sql backend, look at node_hometree_odbc
to have new notation, subscriptions should be coded like
"Sub:SubId"

in your case, you have a database with data filled with a previous
version of mod_pubsub that did not supported the subid correctly.

best is to bulk change your subscriptions to let them have a subid
directly from your database.

but indeed, remove_user should handle both cases for backward
compatibility. i'll apply that patch to 2.1.x.


More information about the ejabberd mailing list