diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-05-22 03:20:43 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-05-22 03:20:43 +0500 |
commit | 3aedbba6788ca1ca7fcd491c2797af93c9dd6c35 (patch) | |
tree | 5944957f46d2a01146da4a529cbc689287533c3c /plugins | |
parent | 7b5c488942ef7545fca718153cb83adcf1d18a1f (diff) | |
download | prosody-3aedbba6788ca1ca7fcd491c2797af93c9dd6c35.tar.gz prosody-3aedbba6788ca1ca7fcd491c2797af93c9dd6c35.zip |
mod_presence: Added option 'ignore_presence_priority'.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_presence.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 108ab0d3..535e65d7 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -62,7 +62,17 @@ local function recalc_resource_map(user) end end +local ignore_presence_priority = module:get_option("ignore_presence_priority"); + function handle_normal_presence(origin, stanza, core_route_stanza) + if ignore_presence_priority then + local priority = stanza:child_with_name("priority"); + if priority and priority[1] ~= "0" then + for i=#priority.tags,1,-1 do priority.tags[i] = nil; end + for i=#priority,1,-1 do priority[i] = nil; end + priority[1] = "0"; + end + end if full_sessions[origin.full_jid] then -- if user is still connected origin.send(stanza); -- reflect their presence back to them end |