aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-28 15:02:56 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-28 15:02:56 +0500
commit2fd7797f35de1e31834e53d8a87f907f286b6afb (patch)
tree5de44ae8549be8d1bbf0af60dd5c500ae36a048e /plugins
parent8a3189b1453c33278de261d61d2251ec4d2207c5 (diff)
downloadprosody-2fd7797f35de1e31834e53d8a87f907f286b6afb.tar.gz
prosody-2fd7797f35de1e31834e53d8a87f907f286b6afb.zip
mod_pep: Remove PEP subscriptions on getting a presence unsubscribe.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pep.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 0d42ac0f..28c31294 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -145,6 +145,16 @@ module:hook("presence/bare", function(event)
end
elseif t == "unavailable" then
if recipients[user] then recipients[user][stanza.attr.from] = nil; end
+ elseif not self and t == "unsubscribe" then
+ local from = jid_bare(stanza.attr.from);
+ local subscriptions = recipients[user];
+ if subscriptions then
+ for subscriber in pairs(subscriptions) do
+ if jid_bare(subscriber) == from then
+ recipients[user][subscriber] = nil;
+ end
+ end
+ end
end
end, 10);