changeset 1947:634b42541f5b

mod_roster_command: Attempt to update for compatibility with 0.10
author Kim Alvefur <zash@zash.se>
date Tue, 10 Nov 2015 17:47:43 +0100
parents 1f263aaba83e
children 2748aa8f36e0
files mod_roster_command/mod_roster_command.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_roster_command/mod_roster_command.lua	Tue Nov 10 17:44:22 2015 +0100
+++ b/mod_roster_command/mod_roster_command.lua	Tue Nov 10 17:47:43 2015 +0100
@@ -9,9 +9,8 @@
 -- COPYING file in the source package for more information.
 -----------------------------------------------------------
 
-if not rawget(_G, "prosodyctl") then
+if module.host ~= "*" then
 	module:log("error", "Do not load this module in Prosody, for correct usage see: https://modules.prosody.im/mod_roster_command.html");
-	module.host = "*";
 	return;
 end
 
@@ -19,10 +18,13 @@
 -- Workaround for lack of util.startup...
 _G.bare_sessions = _G.bare_sessions or {};
 
+local usermanager = require "core.usermanager";
 local rostermanager = require "core.rostermanager";
 local storagemanager = require "core.storagemanager";
 local jid = require "util.jid";
-local warn = prosodyctl.show_warning;
+local warn = require"util.prosodyctl".show_warning;
+local prosody = _G.prosody;
+local hosts = prosody.hosts;
 
 -- Make a *one-way* subscription. User will see when contact is online,
 -- contact will not see when user is online.