aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-04 18:24:09 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-04 18:24:09 +0500
commita5f32b09de02ecd7ca7eb49bfde8b423e56cdd49 (patch)
tree2216cc514872b7086aea9b51d63f675cff5e0552 /plugins/mod_presence.lua
parentc294b198d31be8f2f9448442aad893462ff5e1c5 (diff)
downloadprosody-a5f32b09de02ecd7ca7eb49bfde8b423e56cdd49.tar.gz
prosody-a5f32b09de02ecd7ca7eb49bfde8b423e56cdd49.zip
mod_presence: Small refactoring.
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 943e318f..a74e24c3 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -219,6 +219,7 @@ function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_
core_route_stanza(origin, stanza);
end
stanza.attr.from, stanza.attr.to = st_from, st_to;
+ return true;
end
function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare)
@@ -268,6 +269,7 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b
end
end -- discard any other type
stanza.attr.from, stanza.attr.to = st_from, st_to;
+ return true;
end
local outbound_presence_handler = function(data)
@@ -278,8 +280,7 @@ local outbound_presence_handler = function(data)
if to then
local t = stanza.attr.type;
if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes
- handle_outbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
- return true;
+ return handle_outbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
end
local to_bare = jid_bare(to);
@@ -306,8 +307,7 @@ module:hook("presence/bare", function(data)
local t = stanza.attr.type;
if to then
if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes sent to bare JID
- handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
- return true;
+ return handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
end
local user = bare_sessions[to];
@@ -329,8 +329,7 @@ module:hook("presence/full", function(data)
local t = stanza.attr.type;
if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes sent to full JID
- handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
- return true;
+ return handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
end
local session = full_sessions[stanza.attr.to];