mod_roster_command: Fix traceback and log error message when loaded into Prosody (thanks epaulin)
authorMatthew Wild <mwild1@gmail.com>
Sat, 03 Dec 2011 15:29:00 +0000
changeset 492 f806c8a7f985
parent 491 5b3db688213d
child 493 b1b80319bbf6
mod_roster_command: Fix traceback and log error message when loaded into Prosody (thanks epaulin)
mod_roster_command/mod_roster_command.lua
--- a/mod_roster_command/mod_roster_command.lua	Fri Dec 02 20:53:09 2011 +0000
+++ b/mod_roster_command/mod_roster_command.lua	Sat Dec 03 15:29:00 2011 +0000
@@ -9,6 +9,13 @@
 -- COPYING file in the source package for more information.
 -----------------------------------------------------------
 
+if not rawget(_G, "prosodyctl") then
+	module:log("error", "Do not load this module in Prosody, for correct usage see: http://code.google.com/p/prosody-modules/wiki/mod_roster_command");
+	module.host = "*";
+	return;
+end
+
+
 -- Workaround for lack of util.startup...
 _G.bare_sessions = _G.bare_sessions or {};