From: Christophe Romain Date: Mon, 8 Dec 2008 21:47:50 +0000 (+0000) Subject: remove pubsub_state record when unsubscribing node without affiliation (EJAB-776) X-Git-Tag: v2.1.0~18^2~521 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23ce0b312dd141f1a9f2f1563bdbc40e0316d72d;p=ejabberd remove pubsub_state record when unsubscribing node without affiliation (EJAB-776) SVN Revision: 1717 --- diff --git a/ChangeLog b/ChangeLog index 3ec6af245..d0c53ad70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,9 @@ * src/mod_pubsub/mod_pubsub.erl: reply to suscriptions options queries with unsupported feature error (EJAB-713) + * src/mod_pubsub/node_default.erl: remove pubsub_state record when + unsubscribing node without affiliation (EJAB-776) + 2008-12-08 Mickael Remond * src/ejabberd_c2s.erl: Enforce client stanza from attribute diff --git a/src/mod_pubsub/node_default.erl b/src/mod_pubsub/node_default.erl index 97e363f79..9bf26b992 100644 --- a/src/mod_pubsub/node_default.erl +++ b/src/mod_pubsub/node_default.erl @@ -381,6 +381,10 @@ unsubscribe_node(Host, Node, Sender, Subscriber, _SubId) -> %% Requesting entity is prohibited from unsubscribing entity not Authorized -> {error, ?ERR_FORBIDDEN}; + %% Was just subscriber, remove the record + State#pubsub_state.affiliation == none -> + mnesia:delete({pubsub_state, State#pubsub_state.stateid}), + {result, default}; true -> set_state(State#pubsub_state{subscription = none}), {result, default}