From 3aedbba6788ca1ca7fcd491c2797af93c9dd6c35 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 22 May 2010 03:20:43 +0500 Subject: mod_presence: Added option 'ignore_presence_priority'. --- plugins/mod_presence.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/mod_presence.lua') 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 -- cgit v1.2.3