mod_mam: Make sure stanza IDs aren't reused

Strip the stanza ID from the metadata of outgoing messages to make sure
it's not reused for the (local) recipient's MAM archive.
This commit is contained in:
Holger Weiss 2018-07-27 00:14:48 +02:00
parent 2d45832a39
commit cdfd0cce7b
1 changed files with 3 additions and 1 deletions

View File

@ -369,7 +369,9 @@ user_send_packet(Acc) ->
-> {stanza(), c2s_state()}.
user_send_packet_strip_tag({#message{} = Pkt, #{jid := JID} = C2SState}) ->
LServer = JID#jid.lserver,
{strip_my_stanza_id(Pkt, LServer), C2SState};
Pkt1 = xmpp:del_meta(Pkt, stanza_id),
Pkt2 = strip_my_stanza_id(Pkt1, LServer),
{Pkt2, C2SState};
user_send_packet_strip_tag(Acc) ->
Acc.