[ejabberd] pubsub - remove_user does not call unsubscribe_node

Cai, Juliet Z juliet.z.cai at intel.com
Tue Dec 14 23:12:50 MSK 2010

Thanks you for the info. Although I don't have any subscription for the nodes, perhaps that was the problem.

-----Original Message-----
From: ejabberd-bounces at jabber.ru [mailto:ejabberd-bounces at jabber.ru] On Behalf Of Christophe Romain
Sent: Tuesday, December 14, 2010 5:07 AM
To: ejabberd at jabber.ru
Subject: Re: [ejabberd] pubsub - remove_user does not call unsubscribe_node


>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

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.
ejabberd mailing list
ejabberd at jabber.ru

More information about the ejabberd mailing list