diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-11-28 15:02:56 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-11-28 15:02:56 +0500 |
commit | af3c75f9a19e457286a66ad112920f90b7714c5f (patch) | |
tree | 87dd415d453ca9db45ebb71324de42e7002fb66f | |
parent | 839ce608c849c22f9fa867fcf3b86c9341cf696a (diff) | |
download | prosody-af3c75f9a19e457286a66ad112920f90b7714c5f.tar.gz prosody-af3c75f9a19e457286a66ad112920f90b7714c5f.zip |
mod_pep: Remove PEP subscriptions on getting a presence unsubscribe.
-rw-r--r-- | plugins/mod_pep.lua | 10 |
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); |