]> granicus.if.org Git - ejabberd/commitdiff
remove pubsub_state record when unsubscribing node without affiliation (EJAB-776)
authorChristophe Romain <christophe.romain@process-one.net>
Mon, 8 Dec 2008 21:47:50 +0000 (21:47 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Mon, 8 Dec 2008 21:47:50 +0000 (21:47 +0000)
SVN Revision: 1717

ChangeLog
src/mod_pubsub/node_default.erl

index 3ec6af245069ccd22baa5a1edb543a114107767c..d0c53ad70f6753ce384c0c373aa54e4c9e56ae94 100644 (file)
--- 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  <mremond@process-one.net>
 
        * src/ejabberd_c2s.erl: Enforce client stanza from attribute
index 97e363f799f04c2f18e223432b2563834deb495a..9bf26b9925f94a500e1b4bc19ed099dd5d6f7018 100644 (file)
@@ -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}