From 271a9f097d251fb76912f935f83b29bae833799b Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Jul 2021 17:32:55 +0200 Subject: After create_room, store in DB if it's persistent (#3632) --- src/mod_muc_admin.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mod_muc_admin.erl') diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index a595d00c3..47b28f7a8 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -696,7 +696,7 @@ create_room_with_opts(Name1, Host1, ServerHost1, CustomRoomOpts) -> lists:keysort(1, DefRoomOpts)), case mod_muc:create_room(Host, Name, RoomOpts) of ok -> - ok; + maybe_store_room(ServerHost, Host, Name, RoomOpts); {error, _} -> throw({error, "Unable to start room"}) end; @@ -705,6 +705,15 @@ create_room_with_opts(Name1, Host1, ServerHost1, CustomRoomOpts) -> end end. +maybe_store_room(ServerHost, Host, Name, RoomOpts) -> + case proplists:get_bool(persistent, RoomOpts) of + true -> + {atomic, ok} = mod_muc:store_room(ServerHost, Host, Name, RoomOpts), + ok; + false -> + ok + end. + %% Create the room only in the database. %% It is required to restart the MUC service for the room to appear. muc_create_room(ServerHost, {Name, Host, _}, DefRoomOpts) -> -- cgit v1.2.3 From e22ed8081af971d5e875f6ad4a0a9714b82c67e2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 8 Jul 2021 12:48:19 +0200 Subject: Provide proper error message when create_room fails with invalid_service --- src/mod_muc_admin.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mod_muc_admin.erl') diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 47b28f7a8..88ae041f9 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -700,6 +700,8 @@ create_room_with_opts(Name1, Host1, ServerHost1, CustomRoomOpts) -> {error, _} -> throw({error, "Unable to start room"}) end; + invalid_service -> + throw({error, "Invalid 'service'"}); _ -> throw({error, "Room already exists"}) end -- cgit v1.2.3 From 6e4e5a019071db565cb2c4ac6089e8ef809142a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Fri, 23 Jul 2021 10:14:45 +0200 Subject: Add missing fields from config inside mod_muc_admin:change_options --- src/mod_muc_admin.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mod_muc_admin.erl') diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 88ae041f9..72a29a45b 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -1166,6 +1166,7 @@ change_option(Option, Value, Config) -> anonymous -> Config#config{anonymous = Value}; captcha_protected -> Config#config{captcha_protected = Value}; description -> Config#config{description = Value}; + lang -> Config#config{lang = Value}; logging -> Config#config{logging = Value}; mam -> Config#config{mam = Value}; max_users -> Config#config{max_users = Value}; @@ -1178,8 +1179,10 @@ change_option(Option, Value, Config) -> presence_broadcast -> Config#config{presence_broadcast = Value}; public -> Config#config{public = Value}; public_list -> Config#config{public_list = Value}; + pubsub -> Config#config{pubsub = Value}; title -> Config#config{title = Value}; vcard -> Config#config{vcard = Value}; + vcard_xupdate -> Config#config{vcard_xupdate = Value}; voice_request_min_interval -> Config#config{voice_request_min_interval = Value} end. -- cgit v1.2.3 From ccb4328d06bd39a10c2ecc109a6647cf1eafdaa9 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 29 Jul 2021 23:13:17 +0200 Subject: Store who defines a command, specially when defined by ejabberd modules --- src/mod_muc_admin.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mod_muc_admin.erl') diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 72a29a45b..360d414b1 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -57,7 +57,7 @@ %%---------------------------- start(Host, _Opts) -> - ejabberd_commands:register_commands(get_commands_spec()), + ejabberd_commands:register_commands(?MODULE, get_commands_spec()), ejabberd_hooks:add(webadmin_menu_main, ?MODULE, web_menu_main, 50), ejabberd_hooks:add(webadmin_menu_host, Host, ?MODULE, web_menu_host, 50), ejabberd_hooks:add(webadmin_page_main, ?MODULE, web_page_main, 50), -- cgit v1.2.3 From 506e2f3b972a7e1b6d4fdd40836b9574c4937908 Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 21 Aug 2021 18:31:21 +0200 Subject: Use specific syntax so modules and top-level will be links If we use _`whatever`_ here in ejabberd man pages, it is converted to *`whatever`* in markdown, and docs.ejabberd.im/Makefile converts to the proper links --- src/mod_muc_admin.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mod_muc_admin.erl') diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 360d414b1..2abeee45c 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -1413,4 +1413,4 @@ mod_doc() -> [?T("This module provides commands to administer local MUC " "services and their MUC rooms. It also provides simple " "WebAdmin pages to view the existing rooms."), "", - ?T("This module depends on 'mod_muc'.")]}. + ?T("This module depends on _`mod_muc`_.")]}. -- cgit v1.2.3