From 9dbdeba6c107e4f09ed0e83f330bcd7c0278e56f Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 13 Feb 2018 11:08:13 +0100 Subject: [PATCH] Add case on create_room, avoid useless call --- src/mod_muc_admin.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 0bd47dcaa..b1fd27d29 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -569,8 +569,10 @@ prepare_room_info(Room_info) -> %% ok | error %% @doc Create a room immediately with the default options. create_room(Name1, Host1, ServerHost) -> - create_room_with_opts(Name1, Host1, ServerHost, []), - change_room_option(Name1, Host1, <<"persistent">>, <<"true">>). + 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, CustomRoomOpts) -> true = (error /= (Name = jid:nodeprep(Name1))), -- 2.40.0