aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub.erl
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2017-11-30 15:27:34 +0100
committerChristophe Romain <christophe.romain@process-one.net>2017-11-30 15:27:34 +0100
commita5849a0daba904a1a46edad3ad8d22a0270a8462 (patch)
tree63a8aabed910bb3de8056116597faa8d9b42ee4e /src/mod_pubsub.erl
parentFix session table cleanup (diff)
Fix num_subscribers on node metadata (#2122)
Diffstat (limited to 'src/mod_pubsub.erl')
-rw-r--r--src/mod_pubsub.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index d2e1f6c5c..bc816b519 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -939,14 +939,18 @@ node_disco_info(Host, Node, _From, _Identity, _Features) ->
_ -> <<"leaf">>
end,
Affs = case node_call(Host, Type, get_node_affiliations, [Nidx]) of
- {result, Result} -> Result;
+ {result, As} -> As;
+ _ -> []
+ end,
+ Subs = case node_call(Host, Type, get_node_subscriptions, [Nidx]) of
+ {result, Ss} -> Ss;
_ -> []
end,
Meta = [{title, get_option(Options, title, <<>>)},
{description, get_option(Options, description, <<>>)},
{owner, [jid:make(LJID) || {LJID, Aff} <- Affs, Aff =:= owner]},
{publisher, [jid:make(LJID) || {LJID, Aff} <- Affs, Aff =:= publisher]},
- {num_subscribers, length([LJID || {LJID, Aff} <- Affs, Aff =:= subscriber])}],
+ {num_subscribers, length(Subs)}],
XData = #xdata{type = result,
fields = pubsub_meta_data:encode(Meta)},
Is = [#identity{category = <<"pubsub">>, type = NodeType}],