diff --git a/src/jlib.hrl b/src/jlib.hrl index 47c65f68a..fe844be02 100644 --- a/src/jlib.hrl +++ b/src/jlib.hrl @@ -141,6 +141,8 @@ ?STANZA_ERROR("407", "auth", "subscription-required")). -define(ERR_UNEXPECTED_REQUEST, ?STANZA_ERROR("400", "wait", "unexpected-request")). +-define(ERR_UNEXPECTED_REQUEST_CANCEL, + ?STANZA_ERROR("401", "cancel", "unexpected-request")). %-define(ERR_, % ?STANZA_ERROR("", "", "")). diff --git a/src/mod_pubsub/node_hometree.erl b/src/mod_pubsub/node_hometree.erl index 69deef211..5d45492e4 100644 --- a/src/mod_pubsub/node_hometree.erl +++ b/src/mod_pubsub/node_hometree.erl @@ -379,7 +379,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) -> %% {error, ?ERR_EXTENDED(?ERR_NOT_ACCEPTABLE, "invalid-subid")}; %% Requesting entity is not a subscriber Subscriptions == [] -> - {error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST, "not-subscribed")}; + {error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST_CANCEL, "not-subscribed")}; %% Subid supplied, so use that. SubIdExists -> Sub = first_in_list(fun(S) -> @@ -393,7 +393,7 @@ unsubscribe_node(NodeId, Sender, Subscriber, SubId) -> delete_subscriptions(SubKey, NodeId, [S], SubState), {result, default}; false -> - {error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST, "not-subscribed")} + {error, ?ERR_EXTENDED(?ERR_UNEXPECTED_REQUEST_CANCEL, "not-subscribed")} end; %% Asking to remove all subscriptions to the given node SubId == all ->