25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

mod_mam: Don't strip offline message stanza IDs

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.
This commit is contained in:
Holger Weiss 2018-07-27 00:27:10 +02:00
parent cdfd0cce7b
commit 83e2462853

View File

@ -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),