Software / code / prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 11757:8141645e3865
mod_mam: "Handle" messages that have been archived in the absense of mod_offline
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 25 Jun 2020 18:01:38 +0200 |
| parent | 11727:f3aee8a825cc |
| child | 11758:c35b81575d5d |
comparison
equal
deleted
inserted
replaced
| 11756:a0e17b7c8b05 | 11757:8141645e3865 |
|---|---|
| 472 end | 472 end |
| 473 | 473 |
| 474 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); | 474 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); |
| 475 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); | 475 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); |
| 476 | 476 |
| 477 module:hook("message/offline/handle", function(event) | |
| 478 local stanza = event.stanza; | |
| 479 if stanza:get_child("stanza-id", xmlns_st_id) then | |
| 480 return true; | |
| 481 end | |
| 482 end, -2); | |
| 483 | |
| 477 if cleanup_after ~= "never" then | 484 if cleanup_after ~= "never" then |
| 478 local cleanup_storage = module:open_store("archive_cleanup"); | 485 local cleanup_storage = module:open_store("archive_cleanup"); |
| 479 local cleanup_map = module:open_store("archive_cleanup", "map"); | 486 local cleanup_map = module:open_store("archive_cleanup", "map"); |
| 480 | 487 |
| 481 local day = 86400; | 488 local day = 86400; |