From f963d6de4a808f498233b4dfa5cb01ebd0e26655 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 25 Dec 2008 04:58:15 +0500 Subject: Directed presence --- core/stanza_router.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/stanza_router.lua') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 2fef1e34..ac32baa2 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -110,6 +110,10 @@ function core_process_stanza(origin, stanza) elseif origin.type ~= "c2s" and stanza.name == "iq" and not resource then -- directed at bare JID core_handle_stanza(origin, stanza); else + if origin.type == "c2s" and stanza.name == "presence" and to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then + origin.directed = origin.directed or {}; + t_insert(origin.directed, to); -- FIXME does it make more sense to add to_bare rather than to? + end core_route_stanza(origin, stanza); end else -- cgit v1.2.3