Skip to content

Commit

Permalink
mod_mam: Don't strip offline message stanza IDs
Browse files Browse the repository at this point in the history
As mod_offline currently doesn't preserve metadata, add an explicit
check for messages retrieved from offline storage to avoid stripping
their stanza IDs.

Thanks to Zuglufttier for spotting this.
  • Loading branch information
weiss committed Jul 26, 2018
1 parent cdfd0cc commit 83e2462
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mod_mam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ get_stanza_id(#message{meta = #{stanza_id := ID}}) ->
-spec init_stanza_id(stanza(), binary()) -> stanza().
init_stanza_id(#message{meta = #{stanza_id := _ID}} = Pkt, _LServer) ->
Pkt;
init_stanza_id(#message{meta = #{from_offline := true}} = Pkt, _LServer) ->
Pkt;
init_stanza_id(Pkt, LServer) ->
ID = p1_time_compat:system_time(micro_seconds),
Pkt1 = strip_my_stanza_id(Pkt, LServer),
Expand Down

0 comments on commit 83e2462

Please sign in to comment.