mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-16 17:15:55 +01:00
can not use unexpected-request with 'cancel' type
This commit is contained in:
parent
76447a8810
commit
166e742b3c
@ -356,7 +356,7 @@ unsubscribe_node(NodeId, Sender, {U, S, R} = Subscriber, SubId) ->
|
||||
%% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")};
|
||||
%% Requesting entity is not a subscriber
|
||||
Subscriptions == [] ->
|
||||
{error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")};
|
||||
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")};
|
||||
%% Subid supplied, so use that.
|
||||
SubIdExists ->
|
||||
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),
|
||||
{result, default};
|
||||
false ->
|
||||
{error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")}
|
||||
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}
|
||||
end;
|
||||
%% Asking to remove all subscriptions to the given node
|
||||
SubId == all ->
|
||||
|
@ -369,7 +369,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
|
||||
%% {error, ?ERR_EXTENDED('not-acceptable', "invalid-subid")};
|
||||
%% Requesting entity is not a subscriber
|
||||
Subscriptions == [] ->
|
||||
{error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")};
|
||||
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")};
|
||||
%% Subid supplied, so use that.
|
||||
SubIdExists ->
|
||||
Sub = first_in_list(fun(S) ->
|
||||
@ -383,7 +383,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
|
||||
delete_subscription(SubKey, NodeId, S, Affiliation, Subscriptions),
|
||||
{result, default};
|
||||
false ->
|
||||
{error, ?ERR_EXTENDED('unexpected-request-cancel', "not-subscribed")}
|
||||
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}
|
||||
end;
|
||||
%% Asking to remove all subscriptions to the given node
|
||||
SubId == all ->
|
||||
|
Loading…
Reference in New Issue
Block a user