mirror of
https://github.com/bjc/prosody.git
synced 2025-04-06 06:37:37 +03:00
mod_pep: Ignore presence subscriptions when extractng hash information
This commit is contained in:
parent
e9438b7d04
commit
9f5e655df1
1 changed files with 5 additions and 2 deletions
|
@ -49,7 +49,8 @@ local function publish(session, node, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_caps_hash_from_presence(stanza, current)
|
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
|
for _, child in pairs(stanza.tags) do
|
||||||
if child.name == "c" and child.attr.xmlns == "http://jabber.org/protocol/caps" then
|
if child.name == "c" and child.attr.xmlns == "http://jabber.org/protocol/caps" then
|
||||||
local attr = child.attr;
|
local attr = child.attr;
|
||||||
|
@ -61,8 +62,10 @@ local function get_caps_hash_from_presence(stanza, current)
|
||||||
return; -- bad caps format
|
return; -- bad caps format
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return current; -- no caps, could mean caps optimization, so return current
|
elseif t == "unavailable" or t == "error" then
|
||||||
|
return;
|
||||||
end
|
end
|
||||||
|
return current; -- no caps, could mean caps optimization, so return current
|
||||||
end
|
end
|
||||||
|
|
||||||
module:hook("presence/bare", function(event)
|
module:hook("presence/bare", function(event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue