mod_mam_muc: Add guard to prevent loading on normal hosts
authorKim Alvefur <zash@zash.se>
Mon, 14 Dec 2015 11:02:13 +0100
changeset 1977 9329a11c03a6
parent 1976 b10118d7c0df
child 1978 5be671db83a3
mod_mam_muc: Add guard to prevent loading on normal hosts
mod_mam_muc/mod_mam_muc.lua
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Dec 12 17:00:25 2015 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Mon Dec 14 11:02:13 2015 +0100
@@ -3,6 +3,11 @@
 --
 -- This file is MIT/X11 licensed.
 
+if module:get_host_type() ~= "component" then
+	module:log("error", "mod_%s should be loaded only on a MUC component, not normal hosts", module.name);
+	return;
+end
+
 local xmlns_mam     = "urn:xmpp:mam:0";
 local xmlns_delay   = "urn:xmpp:delay";
 local xmlns_forward = "urn:xmpp:forward:0";