aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-06-02 16:06:02 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-06-02 16:06:02 +0500
commit78eea929eb0ad7b889a619c3ee4911ae37747a7b (patch)
tree23fd2ab0de930f3f965ab513045c3698b26b4e59 /plugins/mod_presence.lua
parent739fcf0e20f8884a1b7de3aa857f978faf568db2 (diff)
downloadprosody-78eea929eb0ad7b889a619c3ee4911ae37747a7b.tar.gz
prosody-78eea929eb0ad7b889a619c3ee4911ae37747a7b.zip
mod_presence: Handle subscriptions and probes
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 3ae6a0bd..075c8f85 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -273,11 +273,11 @@ module.unload = function()
end
local outbound_presence_handler = function(data)
- -- outbound presence to recieved
+ -- outbound presence recieved
local origin, stanza = data.origin, data.stanza;
local t = stanza.attr.type;
- if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes sent to full JID
+ 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), core_route_stanza);
return true;
end
@@ -301,8 +301,20 @@ module:hook("pre-presence/host", outbound_presence_handler);
module:hook("presence/bare", function(data)
-- inbound presence to bare JID recieved
local origin, stanza = data.origin, data.stanza;
+
+ local t = stanza.attr.type;
+ 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), core_route_stanza);
+ return true;
+ end
end);
module:hook("presence/full", function(data)
-- inbound presence to full JID recieved
local origin, stanza = data.origin, data.stanza;
+
+ 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), core_route_stanza);
+ return true;
+ end
end);