Update create_room to work with ejabberd master
This commit is contained in:
parent
d98d55e1f7
commit
18c9d87206
|
@ -76,8 +76,8 @@ commands() ->
|
||||||
#ejabberd_commands{name = create_room, tags = [muc_room],
|
#ejabberd_commands{name = create_room, tags = [muc_room],
|
||||||
desc = "Create a MUC room name@service in host",
|
desc = "Create a MUC room name@service in host",
|
||||||
module = ?MODULE, function = create_room,
|
module = ?MODULE, function = create_room,
|
||||||
args = [{name, string}, {service, string},
|
args = [{name, binary}, {service, binary},
|
||||||
{host, string}],
|
{host, binary}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
#ejabberd_commands{name = destroy_room, tags = [muc_room],
|
#ejabberd_commands{name = destroy_room, tags = [muc_room],
|
||||||
desc = "Destroy a MUC room",
|
desc = "Destroy a MUC room",
|
||||||
|
@ -379,18 +379,19 @@ create_room(Name, Host, ServerHost) ->
|
||||||
|
|
||||||
%% Get the default room options from the muc configuration
|
%% Get the default room options from the muc configuration
|
||||||
DefRoomOpts = gen_mod:get_module_opt(ServerHost, mod_muc,
|
DefRoomOpts = gen_mod:get_module_opt(ServerHost, mod_muc,
|
||||||
default_room_options, []),
|
default_room_options, fun(X) -> X end, []),
|
||||||
|
|
||||||
%% Store the room on the server, it is not started yet though at this point
|
%% Store the room on the server, it is not started yet though at this point
|
||||||
mod_muc:store_room(ServerHost, Host, Name, DefRoomOpts),
|
mod_muc:store_room(ServerHost, Host, Name, DefRoomOpts),
|
||||||
|
|
||||||
%% Get all remaining mod_muc parameters that might be utilized
|
%% Get all remaining mod_muc parameters that might be utilized
|
||||||
Access = gen_mod:get_module_opt(ServerHost, mod_muc, access, all),
|
Access = gen_mod:get_module_opt(ServerHost, mod_muc, access, fun(X) -> X end, all),
|
||||||
AcCreate = gen_mod:get_module_opt(ServerHost, mod_muc, access_create, all),
|
AcCreate = gen_mod:get_module_opt(ServerHost, mod_muc, access_create, fun(X) -> X end, all),
|
||||||
AcAdmin = gen_mod:get_module_opt(ServerHost, mod_muc, access_admin, none),
|
AcAdmin = gen_mod:get_module_opt(ServerHost, mod_muc, access_admin, fun(X) -> X end, none),
|
||||||
AcPer = gen_mod:get_module_opt(ServerHost, mod_muc, access_persistent, all),
|
AcPer = gen_mod:get_module_opt(ServerHost, mod_muc, access_persistent, fun(X) -> X end, all),
|
||||||
HistorySize = gen_mod:get_module_opt(ServerHost, mod_muc, history_size, 20),
|
PersistHistory = gen_mod:get_module_opt(ServerHost, mod_muc, persist_history, fun(X) -> X end, false),
|
||||||
RoomShaper = gen_mod:get_module_opt(ServerHost, mod_muc, room_shaper, none),
|
HistorySize = gen_mod:get_module_opt(ServerHost, mod_muc, history_size, fun(X) -> X end, 20),
|
||||||
|
RoomShaper = gen_mod:get_module_opt(ServerHost, mod_muc, room_shaper, fun(X) -> X end, none),
|
||||||
|
|
||||||
%% If the room does not exist yet in the muc_online_room
|
%% If the room does not exist yet in the muc_online_room
|
||||||
case mnesia:dirty_read(muc_online_room, {Name, Host}) of
|
case mnesia:dirty_read(muc_online_room, {Name, Host}) of
|
||||||
|
|
Loading…
Reference in New Issue