aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-07-02 23:46:27 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-07-02 23:46:27 +0500
commit11e4a5fa67c252cd80b5717869b562b2ea69c8b2 (patch)
tree9f66a7d936aaafa5a40e85e619dc2e1c474e015d /plugins/mod_presence.lua
parent9dd7b702f080143c9ef72c6ad5efd5af30a793f0 (diff)
downloadprosody-11e4a5fa67c252cd80b5717869b562b2ea69c8b2.tar.gz
prosody-11e4a5fa67c252cd80b5717869b562b2ea69c8b2.zip
mod_presence: Removed dead code
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua48
1 files changed, 0 insertions, 48 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 80a2ecca..f69c91d8 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -37,21 +37,6 @@ function core_route_stanza(origin, stanza)
_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
- if inbound then
- handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
- else
- handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
- end
- elseif not inbound and not stanza.attr.to then
- handle_normal_presence(origin, stanza, core_route_stanza);
- else
- core_route_stanza(origin, stanza);
- end
-end
-
local function select_top_resources(user)
local priority = 0;
local recipients = {};
@@ -268,39 +253,6 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b
stanza.attr.from, stanza.attr.to = st_from, st_to;
end
-local function presence_handler(data)
- local origin, stanza = data.origin, data.stanza;
- local to = stanza.attr.to;
- local node, host = jid_split(to);
- local to_bare = jid_bare(to);
- local from_bare = jid_bare(stanza.attr.from);
- if origin.type == "c2s" then
- if to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence
- origin.directed = origin.directed or {};
- origin.directed[to] = true; -- FIXME does it make more sense to add to_bare rather than to?
- end
- if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then
- handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
- elseif not to then
- handle_normal_presence(origin, stanza, core_route_stanza);
- else
- core_route_stanza(origin, stanza);
- end
- elseif (origin.type == "s2sin" or origin.type == "component") and hosts[host] then
- if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then
- handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
- else
- core_route_stanza(origin, stanza);
- end
- end
- return true;
-end
-
-prosody.events.add_handler(module:get_host().."/presence", presence_handler);
-module.unload = function()
- prosody.events.remove_handler(module:get_host().."/presence", presence_handler);
-end
-
local outbound_presence_handler = function(data)
-- outbound presence recieved
local origin, stanza = data.origin, data.stanza;