remove pubsub_state record when unsubscribing node without affiliation (EJAB-776)

SVN Revision: 1718
This commit is contained in:
Christophe Romain 2008-12-08 21:49:40 +00:00
parent 6f71558e18
commit bba71d464e
2 changed files with 7 additions and 0 deletions

View File

@ -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

View 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}