mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-10 15:47:30 +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:
parent
cdfd0cce7b
commit
83e2462853
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user