Mercurial > prosody-modules
comparison mod_mam_muc/mod_mam_muc.lua @ 2835:b69ef062806e
mod_mam_muc: Warn if the storage driver is missing the deletion API (instead of a traceback) (thanks asterix)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 18 Nov 2017 13:55:47 +0100 |
parents | 4f9466be7b46 |
children | 39994c6bb314 |
comparison
equal
deleted
inserted
replaced
2834:3fb5f173f213 | 2835:b69ef062806e |
---|---|
437 module:hook("muc-occupant-left", function (event) | 437 module:hook("muc-occupant-left", function (event) |
438 save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick })); | 438 save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick })); |
439 end); | 439 end); |
440 end | 440 end |
441 | 441 |
442 module:hook("muc-room-destroyed", function(event) | 442 if not archive.delete then |
443 local room_node = jid_split(event.room.jid); | 443 module:log("warn", "Storage driver %s does not support deletion", archive._provided_by); |
444 archive:delete(room_node); | 444 module:log("warn", "Archived message will persist after a room has been destroyed"); |
445 end); | 445 else |
446 module:hook("muc-room-destroyed", function(event) | |
447 local room_node = jid_split(event.room.jid); | |
448 archive:delete(room_node); | |
449 end); | |
450 end | |
446 | 451 |
447 -- And role/affiliation changes? | 452 -- And role/affiliation changes? |
448 | 453 |
449 module:add_feature(xmlns_mam); | 454 module:add_feature(xmlns_mam); |
450 | 455 |