diff --git a/rebar.config b/rebar.config index ffb2a94bd..583ca0b9b 100644 --- a/rebar.config +++ b/rebar.config @@ -24,7 +24,7 @@ {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.1.0"}}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.15"}}}, {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.35"}}}, - {xmpp, ".*", {git, "https://github.com/processone/xmpp", "f3e953e8"}}, + {xmpp, ".*", {git, "https://github.com/processone/xmpp", "d8e770495a42c22cd23536c85af5b1fd92a2139a"}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.18"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}, {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.4"}}}, diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index f016f696a..5778569df 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -4089,13 +4089,23 @@ process_iq_mucsub(From, #iq{type = get, lang = Lang, StateData) -> FAffiliation = get_affiliation(From, StateData), FRole = get_role(From, StateData), - if FRole == moderator; FAffiliation == owner; FAffiliation == admin -> + IsModerator = FRole == moderator orelse FAffiliation == owner orelse + FAffiliation == admin, + case IsModerator orelse is_subscriber(From, StateData) of + true -> + ShowJid = IsModerator orelse + (StateData#state.config)#config.anonymous == false, Subs = maps:fold( - fun(_, #subscriber{jid = J, nodes = Nodes}, Acc) -> - [#muc_subscription{jid = J, events = Nodes}|Acc] + fun(_, #subscriber{jid = J, nick = N, nodes = Nodes}, Acc) -> + case ShowJid of + true -> + [#muc_subscription{jid = J, events = Nodes}|Acc]; + _ -> + [#muc_subscription{nick = N, events = Nodes}|Acc] + end end, [], StateData#state.subscribers), {result, #muc_subscriptions{list = Subs}, StateData}; - true -> + _ -> Txt = <<"Moderator privileges required">>, {error, xmpp:err_forbidden(Txt, Lang)} end;