mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
Fix num_subscribers on node metadata (#2122)
This commit is contained in:
parent
8639da0e00
commit
a5849a0dab
|
@ -939,14 +939,18 @@ node_disco_info(Host, Node, _From, _Identity, _Features) ->
|
||||||
_ -> <<"leaf">>
|
_ -> <<"leaf">>
|
||||||
end,
|
end,
|
||||||
Affs = case node_call(Host, Type, get_node_affiliations, [Nidx]) of
|
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,
|
end,
|
||||||
Meta = [{title, get_option(Options, title, <<>>)},
|
Meta = [{title, get_option(Options, title, <<>>)},
|
||||||
{description, get_option(Options, description, <<>>)},
|
{description, get_option(Options, description, <<>>)},
|
||||||
{owner, [jid:make(LJID) || {LJID, Aff} <- Affs, Aff =:= owner]},
|
{owner, [jid:make(LJID) || {LJID, Aff} <- Affs, Aff =:= owner]},
|
||||||
{publisher, [jid:make(LJID) || {LJID, Aff} <- Affs, Aff =:= publisher]},
|
{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,
|
XData = #xdata{type = result,
|
||||||
fields = pubsub_meta_data:encode(Meta)},
|
fields = pubsub_meta_data:encode(Meta)},
|
||||||
Is = [#identity{category = <<"pubsub">>, type = NodeType}],
|
Is = [#identity{category = <<"pubsub">>, type = NodeType}],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user