aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2010-01-12 14:39:52 +0000
committerChristophe Romain <christophe.romain@process-one.net>2010-01-12 14:39:52 +0000
commit6ddff15b390a0e4b45d10a92cb2e18655e102a98 (patch)
treedd3515cd8729188da19f51dc5c59e2f68f71e7de /src
parentfix NodeName issue from r2880 (thanks to Karim Gemayel) (diff)
allow unsubscribe with 'all' SubId, as mod_pubsub already does
SVN Revision: 2884
Diffstat (limited to 'src')
-rw-r--r--src/mod_pubsub/node_hometree.erl4
-rw-r--r--src/mod_pubsub/node_hometree_odbc.erl4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mod_pubsub/node_hometree.erl b/src/mod_pubsub/node_hometree.erl
index 5ce7b9724..6ba6bb910 100644
--- a/src/mod_pubsub/node_hometree.erl
+++ b/src/mod_pubsub/node_hometree.erl
@@ -395,6 +395,10 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
{error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST,
"not-subscribed")}
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
%% subscription, so use that.
length(Subscriptions) == 1 ->
diff --git a/src/mod_pubsub/node_hometree_odbc.erl b/src/mod_pubsub/node_hometree_odbc.erl
index 141d3275c..20f131062 100644
--- a/src/mod_pubsub/node_hometree_odbc.erl
+++ b/src/mod_pubsub/node_hometree_odbc.erl
@@ -394,6 +394,10 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) ->
false ->
{error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST, "not-subscribed")}
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
%% subscription, so use that.
length(Subscriptions) == 1 ->