25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Add case on create_room, avoid useless call

This commit is contained in:
Christophe Romain 2018-02-13 11:08:13 +01:00
parent 4632f5520f
commit 9dbdeba6c1

View File

@ -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))),