mod_mam: Don't replace existing stanza ID

Preserve the original stanza ID for resent messages.  This avoids
storing duplicates in the MAM archive.
This commit is contained in:
Holger Weiss 2018-06-16 00:43:22 +02:00
parent 3099702039
commit bb76da03ea
1 changed files with 2 additions and 0 deletions

View File

@ -404,6 +404,8 @@ get_stanza_id(#message{meta = #{stanza_id := ID}}) ->
ID.
-spec init_stanza_id(stanza(), binary()) -> stanza().
init_stanza_id(#message{meta = #{stanza_id := _ID}} = Pkt, _LServer) ->
Pkt;
init_stanza_id(Pkt, LServer) ->
ID = p1_time_compat:system_time(micro_seconds),
Pkt1 = strip_my_stanza_id(Pkt, LServer),