From 2914bea9542be6de2abfa04a9f31f383ef7adf74 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 23 Apr 2009 02:48:22 +0500 Subject: mod_presence: Fix for local presence subscriptions and probes --- plugins/mod_presence.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 2e3c6b18..135d1c67 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -25,6 +25,20 @@ local rostermanager = require "core.rostermanager"; local sessionmanager = require "core.sessionmanager"; local offlinemanager = require "core.offlinemanager"; +local _core_route_stanza = core_route_stanza; +local core_route_stanza; +function core_route_stanza(origin, stanza) + if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then + local node, host = jid_split(stanza.attr.to); + host = hosts[host]; + if host and host.type == "local" then + handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to), core_route_stanza); + return; + end + end + _core_route_stanza(origin, stanza); +end + function handle_presence(origin, stanza, from_bare, to_bare, core_route_stanza, inbound) local type = stanza.attr.type; if type and type ~= "unavailable" and type ~= "error" then -- cgit v1.2.3