From 4094aae19e7c3e6a7e9ac2c350eff19d2343efd6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 12 Dec 2010 06:35:53 +0500 Subject: mod_pep: Handle the case where local contacts send directed presence with caps hash. --- plugins/mod_pep.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/mod_pep.lua') diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 28c31294..f215b8be 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -134,7 +134,8 @@ module:hook("presence/bare", function(event) publish_all(user, recipient, origin); else recipients[user][recipient] = hash; - if self or origin.type ~= "c2s" then + local from_bare = origin.username.."@"..origin.host; + if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then origin.send( st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"}) :query("http://jabber.org/protocol/disco#info") -- cgit v1.2.3 From 66fd1d3e538e3a1b488368ed5fb90fcf522408d8 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 12 Dec 2010 15:42:00 +0500 Subject: mod_pep: Fixed a traceback when non-local users send presence. --- plugins/mod_pep.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_pep.lua') diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index f215b8be..9ff6cac2 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -134,7 +134,7 @@ module:hook("presence/bare", function(event) publish_all(user, recipient, origin); else recipients[user][recipient] = hash; - local from_bare = origin.username.."@"..origin.host; + local from_bare = origin.type == "c2s" and origin.username.."@"..origin.host; if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then origin.send( st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"}) -- cgit v1.2.3