comparison mod_roster_command/mod_roster_command.lua @ 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
comparison
equal deleted inserted replaced
1946:1f263aaba83e 1947:634b42541f5b
7 -- 7 --
8 -- This project is MIT/X11 licensed. Please see the 8 -- This project is MIT/X11 licensed. Please see the
9 -- COPYING file in the source package for more information. 9 -- COPYING file in the source package for more information.
10 ----------------------------------------------------------- 10 -----------------------------------------------------------
11 11
12 if not rawget(_G, "prosodyctl") then 12 if module.host ~= "*" then
13 module:log("error", "Do not load this module in Prosody, for correct usage see: https://modules.prosody.im/mod_roster_command.html"); 13 module:log("error", "Do not load this module in Prosody, for correct usage see: https://modules.prosody.im/mod_roster_command.html");
14 module.host = "*";
15 return; 14 return;
16 end 15 end
17 16
18 17
19 -- Workaround for lack of util.startup... 18 -- Workaround for lack of util.startup...
20 _G.bare_sessions = _G.bare_sessions or {}; 19 _G.bare_sessions = _G.bare_sessions or {};
21 20
21 local usermanager = require "core.usermanager";
22 local rostermanager = require "core.rostermanager"; 22 local rostermanager = require "core.rostermanager";
23 local storagemanager = require "core.storagemanager"; 23 local storagemanager = require "core.storagemanager";
24 local jid = require "util.jid"; 24 local jid = require "util.jid";
25 local warn = prosodyctl.show_warning; 25 local warn = require"util.prosodyctl".show_warning;
26 local prosody = _G.prosody;
27 local hosts = prosody.hosts;
26 28
27 -- Make a *one-way* subscription. User will see when contact is online, 29 -- Make a *one-way* subscription. User will see when contact is online,
28 -- contact will not see when user is online. 30 -- contact will not see when user is online.
29 function subscribe(user_jid, contact_jid) 31 function subscribe(user_jid, contact_jid)
30 local user_username, user_host = jid.split(user_jid); 32 local user_username, user_host = jid.split(user_jid);