Render roomname, allowinvites and allowpm in room disco#info

This commit is contained in:
Evgeniy Khramtsov 2018-06-19 14:02:45 +03:00
parent c2f664f941
commit 6acac7c93f
2 changed files with 17 additions and 5 deletions

View File

@ -25,7 +25,7 @@
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.22"}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.11"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.30"}}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "477ae88"}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "0259a54"}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.14"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.3"}}},

View File

@ -3845,11 +3845,23 @@ process_iq_disco_info(From, #iq{type = get, lang = Lang,
-spec iq_disco_info_extras(binary(), state(), boolean()) -> xdata().
iq_disco_info_extras(Lang, StateData, Static) ->
Fs1 = [{description, (StateData#state.config)#config.description},
Config = StateData#state.config,
AllowPM = case Config#config.allow_private_messages of
false -> none;
true ->
case Config#config.allow_private_messages_from_visitors of
nobody -> participants;
_ -> anyone
end
end,
Fs1 = [{roomname, Config#config.title},
{description, Config#config.description},
{contactjid, get_owners(StateData)},
{changesubject, (StateData#state.config)#config.allow_change_subj},
{lang, (StateData#state.config)#config.lang}],
Fs2 = case (StateData#state.config)#config.pubsub of
{changesubject, Config#config.allow_change_subj},
{allowinvites, Config#config.allow_user_invites},
{allowpm, AllowPM},
{lang, Config#config.lang}],
Fs2 = case Config#config.pubsub of
Node when is_binary(Node), Node /= <<"">> ->
[{pubsub, Node}|Fs1];
_ ->