mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Make mod_muc_room:set_opts process persistent flag first
As processing some other options depends on this setting flag in room state.
This commit is contained in:
parent
dfe4884d16
commit
9503beca6c
@ -3882,14 +3882,23 @@ remove_nonmembers(StateData) ->
|
|||||||
end, StateData, get_users_and_subscribers(StateData)).
|
end, StateData, get_users_and_subscribers(StateData)).
|
||||||
|
|
||||||
-spec set_opts([{atom(), any()}], state()) -> state().
|
-spec set_opts([{atom(), any()}], state()) -> state().
|
||||||
set_opts([], StateData) ->
|
set_opts(Opts, StateData) ->
|
||||||
|
case lists:keytake(persistent, 1, Opts) of
|
||||||
|
false ->
|
||||||
|
set_opts2(Opts, StateData);
|
||||||
|
{value, Tuple, Rest} ->
|
||||||
|
set_opts2([Tuple | Rest], StateData)
|
||||||
|
end.
|
||||||
|
|
||||||
|
-spec set_opts2([{atom(), any()}], state()) -> state().
|
||||||
|
set_opts2([], StateData) ->
|
||||||
set_vcard_xupdate(StateData);
|
set_vcard_xupdate(StateData);
|
||||||
set_opts([{vcard, Val} | Opts], StateData)
|
set_opts2([{vcard, Val} | Opts], StateData)
|
||||||
when is_record(Val, vcard_temp) ->
|
when is_record(Val, vcard_temp) ->
|
||||||
%% default_room_options is setting a default room vcard
|
%% default_room_options is setting a default room vcard
|
||||||
ValRaw = fxml:element_to_binary(xmpp:encode(Val)),
|
ValRaw = fxml:element_to_binary(xmpp:encode(Val)),
|
||||||
set_opts([{vcard, ValRaw} | Opts], StateData);
|
set_opts2([{vcard, ValRaw} | Opts], StateData);
|
||||||
set_opts([{Opt, Val} | Opts], StateData) ->
|
set_opts2([{Opt, Val} | Opts], StateData) ->
|
||||||
NSD = case Opt of
|
NSD = case Opt of
|
||||||
title ->
|
title ->
|
||||||
StateData#state{config =
|
StateData#state{config =
|
||||||
@ -4058,7 +4067,7 @@ set_opts([{Opt, Val} | Opts], StateData) ->
|
|||||||
?INFO_MSG("Unknown MUC room option, will be discarded: ~p", [Other]),
|
?INFO_MSG("Unknown MUC room option, will be discarded: ~p", [Other]),
|
||||||
StateData
|
StateData
|
||||||
end,
|
end,
|
||||||
set_opts(Opts, NSD).
|
set_opts2(Opts, NSD).
|
||||||
|
|
||||||
-spec set_vcard_xupdate(state()) -> state().
|
-spec set_vcard_xupdate(state()) -> state().
|
||||||
set_vcard_xupdate(#state{config =
|
set_vcard_xupdate(#state{config =
|
||||||
|
Loading…
Reference in New Issue
Block a user