mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
allow unsubscribe with 'all' SubId, as mod_pubsub already does
SVN Revision: 2885
This commit is contained in:
parent
f8886ee36c
commit
dd159242e3
@ -396,6 +396,10 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
|
|||||||
{error, ?ERR_EXTENDED('unexpected-request',
|
{error, ?ERR_EXTENDED('unexpected-request',
|
||||||
"not-subscribed")}
|
"not-subscribed")}
|
||||||
end;
|
end;
|
||||||
|
%% Asking to remove all subscriptions to the given node
|
||||||
|
SubId == all ->
|
||||||
|
[delete_subscription(SubKey, NodeId, S, SubState) || S <- Subscriptions],
|
||||||
|
{result, default};
|
||||||
%% No subid supplied, but there's only one matching
|
%% No subid supplied, but there's only one matching
|
||||||
%% subscription, so use that.
|
%% subscription, so use that.
|
||||||
length(Subscriptions) == 1 ->
|
length(Subscriptions) == 1 ->
|
||||||
|
@ -400,6 +400,10 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
|
|||||||
false ->
|
false ->
|
||||||
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}
|
{error, ?ERR_EXTENDED('unexpected-request', "not-subscribed")}
|
||||||
end;
|
end;
|
||||||
|
%% Asking to remove all subscriptions to the given node
|
||||||
|
SubId == all ->
|
||||||
|
[delete_subscription(SubKey, NodeId, S, Affiliation, Subscriptions) || S <- Subscriptions],
|
||||||
|
{result, default};
|
||||||
%% No subid supplied, but there's only one matching
|
%% No subid supplied, but there's only one matching
|
||||||
%% subscription, so use that.
|
%% subscription, so use that.
|
||||||
length(Subscriptions) == 1 ->
|
length(Subscriptions) == 1 ->
|
||||||
|
Loading…
Reference in New Issue
Block a user