diff options
Diffstat (limited to 'src/mod_muc_admin.erl')
-rw-r--r-- | src/mod_muc_admin.erl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 2163b5e3e..abc9dd129 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -5,7 +5,7 @@ %%% Created : 8 Sep 2007 by Badlop <badlop@ono.com> %%% %%% -%%% ejabberd, Copyright (C) 2002-2019 ProcessOne +%%% ejabberd, Copyright (C) 2002-2020 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -28,7 +28,7 @@ -behaviour(gen_mod). --export([start/2, stop/1, reload/3, depends/2, +-export([start/2, stop/1, reload/3, depends/2, mod_doc/0, muc_online_rooms/1, muc_online_rooms_by_regex/2, muc_register_nick/3, muc_unregister_nick/2, create_room_with_opts/4, create_room/3, destroy_room/2, @@ -625,10 +625,7 @@ justcreated_to_binary(J) when is_atom(J) -> %% ok | error %% @doc Create a room immediately with the default options. create_room(Name1, Host1, ServerHost) -> - case create_room_with_opts(Name1, Host1, ServerHost, []) of - ok -> change_room_option(Name1, Host1, <<"persistent">>, <<"true">>); - Error -> Error - end. + create_room_with_opts(Name1, Host1, ServerHost, []). create_room_with_opts(Name1, Host1, ServerHost, CustomRoomOpts) -> true = (error /= (Name = jid:nodeprep(Name1))), @@ -643,7 +640,12 @@ create_room_with_opts(Name1, Host1, ServerHost, CustomRoomOpts) -> lists:keysort(1, DefRoomOpts)), %% Store the room on the server, it is not started yet though at this point - mod_muc:store_room(ServerHost, Host, Name, RoomOpts), + case lists:keyfind(persistent, 1, RoomOpts) of + {persistent, true} -> + mod_muc:store_room(ServerHost, Host, Name, RoomOpts); + _ -> + ok + end, %% Get all remaining mod_muc parameters that might be utilized Access = mod_muc_opt:access(ServerHost), @@ -886,7 +888,7 @@ act_on_rooms(Method, Action, Rooms) -> act_on_room(Method, destroy, {N, H, SH, Pid}) -> Message = iolist_to_binary(io_lib:format( - <<"Room destroyed by rooms_~ts_destroy.">>, [Method])), + <<"Room destroyed by rooms_~s_destroy.">>, [Method])), mod_muc_room:destroy(Pid, Message), mod_muc:room_destroyed(H, N, Pid, SH), mod_muc:forget_room(SH, H, N); @@ -1315,3 +1317,10 @@ find_hosts(ServerHost) -> end. mod_options(_) -> []. + +mod_doc() -> + #{desc => + [?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'.")]}. |