diff mod_mam_muc/mod_mam_muc.lua @ 1973:9329a11c03a6

mod_mam_muc: Add guard to prevent loading on normal hosts
author Kim Alvefur <zash@zash.se>
date Mon, 14 Dec 2015 11:02:13 +0100
parents db8b256f51ff
children f21147d56bc4
line wrap: on
line diff
--- 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";