# HG changeset patch # User Waqas Hussain # Date 1290938576 -18000 # Node ID 6bd4305044a8c072381924fc90de4599366ffa1a # Parent 56add628d838dc13cfd505a56b5a0efe1da3c526 mod_pep: Remove PEP subscriptions on getting a presence unsubscribe. diff -r 56add628d838 -r 6bd4305044a8 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Sun Nov 28 13:11:42 2010 +0500 +++ b/plugins/mod_pep.lua Sun Nov 28 15:02:56 2010 +0500 @@ -145,6 +145,16 @@ 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);