mod_mam_muc/mod_mam_muc.lua
changeset 2839 b69ef062806e
parent 2837 4f9466be7b46
child 2953 39994c6bb314
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Nov 18 01:01:59 2017 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Nov 18 13:55:47 2017 +0100
@@ -439,10 +439,15 @@
 	end);
 end
 
-module:hook("muc-room-destroyed", function(event)
-	local room_node = jid_split(event.room.jid);
-	archive:delete(room_node);
-end);
+if not archive.delete then
+	module:log("warn", "Storage driver %s does not support deletion", archive._provided_by);
+	module:log("warn", "Archived message will persist after a room has been destroyed");
+else
+	module:hook("muc-room-destroyed", function(event)
+		local room_node = jid_split(event.room.jid);
+		archive:delete(room_node);
+	end);
+end
 
 -- And role/affiliation changes?