aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-06-26 23:42:59 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-06-26 23:42:59 +0500
commit9f5e655df1e75d39f7a57c9284fa7dbe73a670d5 (patch)
treec013af95f5f810e73c0d73d9e7f29bcbd08701ca
parente9438b7d04e3f5b82f7d027050fdd1f7a29ab476 (diff)
downloadprosody-9f5e655df1e75d39f7a57c9284fa7dbe73a670d5.tar.gz
prosody-9f5e655df1e75d39f7a57c9284fa7dbe73a670d5.zip
mod_pep: Ignore presence subscriptions when extractng hash information
-rw-r--r--plugins/mod_pep.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 95c18eec..da6e42f0 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -49,7 +49,8 @@ local function publish(session, node, item)
end
local function get_caps_hash_from_presence(stanza, current)
- if not stanza.attr.type then
+ local t = stanza.attr.type;
+ if not t then
for _, child in pairs(stanza.tags) do
if child.name == "c" and child.attr.xmlns == "http://jabber.org/protocol/caps" then
local attr = child.attr;
@@ -61,8 +62,10 @@ local function get_caps_hash_from_presence(stanza, current)
return; -- bad caps format
end
end
- return current; -- no caps, could mean caps optimization, so return current
+ elseif t == "unavailable" or t == "error" then
+ return;
end
+ return current; -- no caps, could mean caps optimization, so return current
end
module:hook("presence/bare", function(event)