aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-06-02 07:23:28 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-06-02 07:23:28 +0500
commit7ff04a760ef33520658d505bd5d2e3cc6c8111ca (patch)
treee1d1a3cf49b47c9dee31a3d1e7e5bf92d2bb9bf8 /plugins/mod_presence.lua
parenta039878df668ca0563fa712322b20326eb91fa8b (diff)
downloadprosody-7ff04a760ef33520658d505bd5d2e3cc6c8111ca.tar.gz
prosody-7ff04a760ef33520658d505bd5d2e3cc6c8111ca.zip
mod_presence: Remove JIDs from directed presence list on sending error or unavailable presence
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 468fbd98..f30a1b84 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -285,6 +285,10 @@ module:hook("pre-presence/full", function(data)
local to_bare = jid_bare(to);
if not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence
origin.directed = origin.directed or {};
- origin.directed[to] = true; -- FIXME does it make more sense to add to_bare rather than to?
+ if stanza.attr.type then -- removing from directed presence list on sending an error or unavailable
+ origin.directed[to] = nil; -- FIXME does it make more sense to add to_bare rather than to?
+ else
+ origin.directed[to] = true; -- FIXME does it make more sense to add to_bare rather than to?
+ end
end
end);