From: Holger Weiss Date: Thu, 26 Jul 2018 22:27:10 +0000 (+0200) Subject: mod_mam: Don't strip offline message stanza IDs X-Git-Tag: 18.09~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83e24628538cb29586686ee88a26d431885105eb;p=ejabberd 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. --- diff --git a/src/mod_mam.erl b/src/mod_mam.erl index 7c5d3af61..2a43322c8 100644 --- a/src/mod_mam.erl +++ b/src/mod_mam.erl @@ -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),