]> granicus.if.org Git - ejabberd/commitdiff
Render roomname, allowinvites and allowpm in room disco#info
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 19 Jun 2018 11:02:45 +0000 (14:02 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 19 Jun 2018 11:02:45 +0000 (14:02 +0300)
rebar.config
src/mod_muc_room.erl

index f4a697038b71c8bdaad949379bf35942bb6024a2..2bed420aa5ea15fe67aabb2a8397175f2dd1817d 100644 (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"}}},
index edddd13cf4525fdd5729815a50ab3bdd5ef4d2e8..0778cc1577e3c7e9bd41580fac84c0bd8b886f37 100644 (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];
              _ ->