25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

mod_muc_room: Don't leak owner JIDs (#3615)

Avoid publishing room owner JIDs (via the muc#roominfo form) without
their explicit consent.

Closes #3609.
This commit is contained in:
Holger Weiß 2021-05-28 16:43:49 +02:00 committed by GitHub
parent 33fd45a960
commit 3b5ddf0254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1482,17 +1482,6 @@ expulse_participant(Packet, From, StateData, Reason1) ->
end, end,
remove_online_user(From, NewState). remove_online_user(From, NewState).
-spec get_owners(state()) -> [jid:jid()].
get_owners(StateData) ->
maps:fold(
fun(LJID, owner, Acc) ->
[jid:make(LJID)|Acc];
(LJID, {owner, _}, Acc) ->
[jid:make(LJID)|Acc];
(_, _, Acc) ->
Acc
end, [], StateData#state.affiliations).
-spec set_affiliation(jid(), affiliation(), state()) -> state(). -spec set_affiliation(jid(), affiliation(), state()) -> state().
set_affiliation(JID, Affiliation, StateData) -> set_affiliation(JID, Affiliation, StateData) ->
set_affiliation(JID, Affiliation, StateData, <<"">>). set_affiliation(JID, Affiliation, StateData, <<"">>).
@ -4132,7 +4121,6 @@ iq_disco_info_extras(Lang, StateData, Static) ->
end, end,
Fs1 = [{roomname, Config#config.title}, Fs1 = [{roomname, Config#config.title},
{description, Config#config.description}, {description, Config#config.description},
{contactjid, get_owners(StateData)},
{changesubject, Config#config.allow_change_subj}, {changesubject, Config#config.allow_change_subj},
{allowinvites, Config#config.allow_user_invites}, {allowinvites, Config#config.allow_user_invites},
{allowpm, AllowPM}, {allowpm, AllowPM},