]> 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:49:40 +0000 (21:49 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Mon, 8 Dec 2008 21:49:40 +0000 (21:49 +0000)
SVN Revision: 1718

ChangeLog
src/mod_pubsub/node_default.erl

index 3fd58a8f7e35f78f1ec148658161a921292a3e80..bea8772d938bee4b0a91d9440c6c2a36181d66c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
 
        * src/mod_pubsub/pubsub.hrl: remove unused pubsub_presence record
 
+       * 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 dca41d4ac318da9cb66bd6404122b72e68fb8d9c..ba8e2edd79a33f7116761bb41aaceee9159a98ed 100644 (file)
@@ -378,6 +378,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}