mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02: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
1 changed files with 2 additions and 0 deletions
|
@ -419,6 +419,8 @@ get_stanza_id(#message{meta = #{stanza_id := ID}}) ->
|
||||||
-spec init_stanza_id(stanza(), binary()) -> stanza().
|
-spec init_stanza_id(stanza(), binary()) -> stanza().
|
||||||
init_stanza_id(#message{meta = #{stanza_id := _ID}} = Pkt, _LServer) ->
|
init_stanza_id(#message{meta = #{stanza_id := _ID}} = Pkt, _LServer) ->
|
||||||
Pkt;
|
Pkt;
|
||||||
|
init_stanza_id(#message{meta = #{from_offline := true}} = Pkt, _LServer) ->
|
||||||
|
Pkt;
|
||||||
init_stanza_id(Pkt, LServer) ->
|
init_stanza_id(Pkt, LServer) ->
|
||||||
ID = p1_time_compat:system_time(micro_seconds),
|
ID = p1_time_compat:system_time(micro_seconds),
|
||||||
Pkt1 = strip_my_stanza_id(Pkt, LServer),
|
Pkt1 = strip_my_stanza_id(Pkt, LServer),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue