mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Update MUC MAM tests
This commit is contained in:
parent
acc162f4f4
commit
ec819b4002
@ -268,22 +268,11 @@ muc_master(Config) ->
|
|||||||
recv_messages_from_room(Config, lists:seq(2, 21)),
|
recv_messages_from_room(Config, lists:seq(2, 21)),
|
||||||
%% Now enable MAM for the conference
|
%% Now enable MAM for the conference
|
||||||
%% Retrieve config first
|
%% Retrieve config first
|
||||||
#iq{type = result, sub_els = [#muc_owner{config = #xdata{} = RoomCfg}]} =
|
CfgOpts = muc_tests:get_config(Config),
|
||||||
send_recv(Config, #iq{type = get, sub_els = [#muc_owner{}],
|
%% Find the MAM field in the config
|
||||||
to = Room}),
|
true = proplists:is_defined(mam, CfgOpts),
|
||||||
%% Find the MAM field in the config and enable it
|
%% Enable MAM
|
||||||
NewFields = lists:flatmap(
|
[104] = muc_tests:set_config(Config, [{mam, true}]),
|
||||||
fun(#xdata_field{var = <<"mam">> = Var}) ->
|
|
||||||
[#xdata_field{var = Var, values = [<<"1">>]}];
|
|
||||||
(_) ->
|
|
||||||
[]
|
|
||||||
end, RoomCfg#xdata.fields),
|
|
||||||
NewRoomCfg = #xdata{type = submit, fields = NewFields},
|
|
||||||
#iq{type = result, sub_els = []} =
|
|
||||||
send_recv(Config, #iq{type = set, to = Room,
|
|
||||||
sub_els = [#muc_owner{config = NewRoomCfg}]}),
|
|
||||||
#message{from = Room, type = groupchat,
|
|
||||||
sub_els = [#muc_user{status_codes = [104]}]} = recv_message(Config),
|
|
||||||
%% Check if MAM has been enabled
|
%% Check if MAM has been enabled
|
||||||
true = is_feature_advertised(Config, ?NS_MAM_1, Room),
|
true = is_feature_advertised(Config, ?NS_MAM_1, Room),
|
||||||
true = is_feature_advertised(Config, ?NS_MAM_2, Room),
|
true = is_feature_advertised(Config, ?NS_MAM_2, Room),
|
||||||
|
Loading…
Reference in New Issue
Block a user