25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

fix error code when unsubscribing from a non-existent node (needs exmpp from e8f1096) (EJAB-1227)

This commit is contained in:
Christophe Romain 2010-05-28 14:25:06 +02:00
parent 0232f5958f
commit 76447a8810
2 changed files with 4 additions and 4 deletions

View File

@ -356,7 +356,7 @@ unsubscribe_node(NodeId, Sender, {U, S, R} = Subscriber, SubId) ->
%% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")}; %% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")};
%% Requesting entity is not a subscriber %% Requesting entity is not a subscriber
Subscriptions == [] -> Subscriptions == [] ->
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}; {error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")};
%% Subid supplied, so use that. %% Subid supplied, so use that.
SubIdExists -> SubIdExists ->
Sub = first_in_list(fun({_, Id}) when Id == SubId -> true; Sub = first_in_list(fun({_, Id}) when Id == SubId -> true;
@ -367,7 +367,7 @@ unsubscribe_node(NodeId, Sender, {U, S, R} = Subscriber, SubId) ->
delete_subscriptions(Subscriber, NodeId, [Subscribed], SubState), delete_subscriptions(Subscriber, NodeId, [Subscribed], SubState),
{result, default}; {result, default};
false -> false ->
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")} {error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")}
end; end;
%% Asking to remove all subscriptions to the given node %% Asking to remove all subscriptions to the given node
SubId == all -> SubId == all ->

View File

@ -369,7 +369,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
%% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")}; %% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")};
%% Requesting entity is not a subscriber %% Requesting entity is not a subscriber
Subscriptions == [] -> Subscriptions == [] ->
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}; {error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")};
%% Subid supplied, so use that. %% Subid supplied, so use that.
SubIdExists -> SubIdExists ->
Sub = first_in_list(fun(S) -> Sub = first_in_list(fun(S) ->
@ -383,7 +383,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
delete_subscription(SubKey, NodeId, S, Affiliation, Subscriptions), delete_subscription(SubKey, NodeId, S, Affiliation, Subscriptions),
{result, default}; {result, default};
false -> false ->
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")} {error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")}
end; end;
%% Asking to remove all subscriptions to the given node %% Asking to remove all subscriptions to the given node
SubId == all -> SubId == all ->