changeset 492:f806c8a7f985

mod_roster_command: Fix traceback and log error message when loaded into Prosody (thanks epaulin)
author Matthew Wild <mwild1@gmail.com>
date Sat, 03 Dec 2011 15:29:00 +0000
parents 5b3db688213d
children b1b80319bbf6
files mod_roster_command/mod_roster_command.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {};