From 166e742b3cd6f7078bfacd8da069f68bf5f5d7eb Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Fri, 28 May 2010 16:27:04 +0200 Subject: [PATCH] can not use unexpected-request with 'cancel' type --- src/mod_pubsub/node_flat.erl | 4 ++-- src/mod_pubsub/node_flat_odbc.erl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod_pubsub/node_flat.erl b/src/mod_pubsub/node_flat.erl index c4f7c7311..985bc9421 100644 --- a/src/mod_pubsub/node_flat.erl +++ b/src/mod_pubsub/node_flat.erl @@ -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 -> diff --git a/src/mod_pubsub/node_flat_odbc.erl b/src/mod_pubsub/node_flat_odbc.erl index 9b7a1181d..f259260b6 100644 --- a/src/mod_pubsub/node_flat_odbc.erl +++ b/src/mod_pubsub/node_flat_odbc.erl @@ -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 ->