aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2009-11-04 17:38:51 +0000
committerBadlop <badlop@process-one.net>2009-11-04 17:38:51 +0000
commit64bc97d47156331e09449ef0cbf7ca805f39cedc (patch)
treee16b01045921760a02e4cc68200691993d8921db /src/mod_pubsub
parentExtend explanation of mod_pubsub "default" rename to "hometree". (diff)
Send authorization messages outside of get-pending transaction (thanks to Brian Cully)(EJAB-1090)
SVN Revision: 2719
Diffstat (limited to 'src/mod_pubsub')
-rw-r--r--src/mod_pubsub/mod_pubsub.erl15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl
index 8ab29ea05..d3e1f155a 100644
--- a/src/mod_pubsub/mod_pubsub.erl
+++ b/src/mod_pubsub/mod_pubsub.erl
@@ -1424,17 +1424,12 @@ send_pending_auth_events(Host, Node, Owner) ->
?DEBUG("Sending pending auth events for ~s on ~s:~s",
[jlib:jid_to_string(Owner), Host, node_to_string(Node)]),
Action =
- fun (#pubsub_node{id = NodeID, type = Type} = N) ->
+ fun (#pubsub_node{id = NodeID, type = Type}) ->
case lists:member("get-pending", features(Type)) of
true ->
case node_call(Type, get_affiliation, [NodeID, Owner]) of
{result, owner} ->
- {result, Subscriptions} = node_call(Type, get_node_subscriptions, [NodeID]),
- lists:foreach(fun({J, pending, _SubID}) -> send_authorization_request(N, jlib:make_jid(J));
- ({J, pending}) -> send_authorization_request(N, jlib:make_jid(J));
- (_) -> ok
- end, Subscriptions),
- {result, ok};
+ node_call(Type, get_node_subscriptions, [NodeID]);
_ ->
{error, ?ERR_FORBIDDEN}
end;
@@ -1443,7 +1438,11 @@ send_pending_auth_events(Host, Node, Owner) ->
end
end,
case transaction(Host, Node, Action, sync_dirty) of
- {result, _} ->
+ {result, {N, Subscriptions}} ->
+ lists:foreach(fun({J, pending, _SubID}) -> send_authorization_request(N, jlib:make_jid(J));
+ ({J, pending}) -> send_authorization_request(N, jlib:make_jid(J));
+ (_) -> ok
+ end, Subscriptions),
#adhoc_response{};
Err ->
Err