From ff9ab821f7bdee398860dc8aae464113ee18c009 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 13 Mar 2013 07:01:57 +0100 Subject: hostmanager: Import core_post_stanza from the global prosody table --- core/hostmanager.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'core') diff --git a/core/hostmanager.lua b/core/hostmanager.lua index cee4a1d6..7c9298cd 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -23,6 +23,7 @@ if not _G.prosody.incoming_s2s then require "core.s2smanager"; end local incoming_s2s = _G.prosody.incoming_s2s; +local core_route_stanza = _G.prosody.core_route_stanza; local pairs, select = pairs, select; local tostring, type = tostring, type; -- cgit v1.2.3 From 608eb6194a2bbc3816121e440af1ef4349c49d54 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 13 Mar 2013 07:03:34 +0100 Subject: rostermanager: Remove unused imports --- core/rostermanager.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'core') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index fdb890f9..f14bb435 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -11,10 +11,7 @@ local log = require "util.logger".init("rostermanager"); -local setmetatable = setmetatable; -local format = string.format; -local pcall = pcall; -local pairs, ipairs = pairs, ipairs; +local pairs = pairs; local tostring = tostring; local hosts = hosts; -- cgit v1.2.3 From 3f4b64ddb6fe95948f104235d159a583e3269772 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 13 Mar 2013 07:33:36 +0100 Subject: s2smanager: Use unused local, reduce table indexing --- core/s2smanager.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 6049e12e..86389d8d 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -12,7 +12,6 @@ local hosts = hosts; local tostring, pairs, ipairs, getmetatable, newproxy, setmetatable = tostring, pairs, ipairs, getmetatable, newproxy, setmetatable; -local fire_event = prosody.events.fire_event; local logger_init = require "util.logger".init; local log = logger_init("s2smanager"); @@ -23,6 +22,7 @@ local prosody = _G.prosody; incoming_s2s = {}; prosody.incoming_s2s = incoming_s2s; local incoming_s2s = incoming_s2s; +local fire_event = prosody.events.fire_event; module "s2smanager" @@ -91,7 +91,7 @@ function mark_connected(session) local event_data = { session = session }; if session.type == "s2sout" then - prosody.events.fire_event("s2sout-established", event_data); + fire_event("s2sout-established", event_data); hosts[from].events.fire_event("s2sout-established", event_data); else local host_session = hosts[to]; @@ -99,7 +99,7 @@ function mark_connected(session) return host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza }); end; - prosody.events.fire_event("s2sin-established", event_data); + fire_event("s2sin-established", event_data); hosts[to].events.fire_event("s2sin-established", event_data); end @@ -158,12 +158,12 @@ function destroy_session(session, reason) local event_data = { session = session, reason = reason }; if session.type == "s2sout" then - prosody.events.fire_event("s2sout-destroyed", event_data); + fire_event("s2sout-destroyed", event_data); if hosts[session.from_host] then hosts[session.from_host].events.fire_event("s2sout-destroyed", event_data); end elseif session.type == "s2sin" then - prosody.events.fire_event("s2sin-destroyed", event_data); + fire_event("s2sin-destroyed", event_data); if hosts[session.to_host] then hosts[session.to_host].events.fire_event("s2sin-destroyed", event_data); end -- cgit v1.2.3