25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Test retractons in mam_tests

This commit is contained in:
Paweł Chmielowski 2024-03-18 12:42:03 +01:00
parent 1639471250
commit 8f20dd8425

View File

@ -431,12 +431,21 @@ set_default(Config, Default) ->
send_messages(Config, Range) -> send_messages(Config, Range) ->
Peer = ?config(peer, Config), Peer = ?config(peer, Config),
send_message_extra(Config, 0, <<"to-retract-1">>, []),
lists:foreach( lists:foreach(
fun(N) -> fun
(1) ->
send_message_extra(Config, 1, <<"retraction-1">>, [#message_retract{id = <<"to-retract-1">>}]);
(N) ->
Body = xmpp:mk_text(integer_to_binary(N)), Body = xmpp:mk_text(integer_to_binary(N)),
send(Config, #message{to = Peer, body = Body}) send(Config, #message{to = Peer, body = Body})
end, Range). end, Range).
send_message_extra(Config, N, Id, Sub) ->
Peer = ?config(peer, Config),
Body = xmpp:mk_text(integer_to_binary(N)),
send(Config, #message{id = Id, to = Peer, body = Body, sub_els = Sub}).
recv_messages(Config, Range) -> recv_messages(Config, Range) ->
Peer = ?config(peer, Config), Peer = ?config(peer, Config),
lists:foreach( lists:foreach(
@ -448,7 +457,7 @@ recv_messages(Config, Range) ->
xmpp:get_subtag(Msg, #mam_archived{}), xmpp:get_subtag(Msg, #mam_archived{}),
#stanza_id{by = BareMyJID} = #stanza_id{by = BareMyJID} =
xmpp:get_subtag(Msg, #stanza_id{}) xmpp:get_subtag(Msg, #stanza_id{})
end, Range). end, [0 | Range]).
recv_archived_messages(Config, From, To, QID, Range) -> recv_archived_messages(Config, From, To, QID, Range) ->
MyJID = my_jid(Config), MyJID = my_jid(Config),