aboutsummaryrefslogtreecommitdiff
path: root/src/mod_muc_admin.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-10-15 16:24:50 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-10-15 16:24:50 +0200
commit73dbd34f95f3959b8ffb08cf2699e1bca941af58 (patch)
tree63805c40d8cac106f77daa60512be3bd0bbc67ea /src/mod_muc_admin.erl
parentsend_direct_invitation command is now asynchronous (diff)
Store room options in create_room_with_opts only if we will start room
Previously we could overwrite existing room options and then later return error because room was already started.
Diffstat (limited to 'src/mod_muc_admin.erl')
-rw-r--r--src/mod_muc_admin.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl
index c5b5437f3..8a34f765f 100644
--- a/src/mod_muc_admin.erl
+++ b/src/mod_muc_admin.erl
@@ -640,13 +640,6 @@ create_room_with_opts(Name1, Host1, ServerHost1, CustomRoomOpts) ->
lists:keysort(1, FormattedRoomOpts),
lists:keysort(1, DefRoomOpts)),
- %% Store the room on the server, it is not started yet though at this point
- 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),
@@ -661,6 +654,13 @@ create_room_with_opts(Name1, Host1, ServerHost1, CustomRoomOpts) ->
%% If the room does not exist yet in the muc_online_room
case get_room_pid(Name, Host) of
room_not_found ->
+ %% Store the room on the server, it is not started yet though at this point
+ case lists:keyfind(persistent, 1, RoomOpts) of
+ {persistent, true} ->
+ mod_muc:store_room(ServerHost, Host, Name, RoomOpts);
+ _ ->
+ ok
+ end,
%% Start the room
{ok, Pid} = mod_muc_room:start(
Host,