# HG changeset patch # User Waqas Hussain # Date 1274480443 -18000 # Node ID 9b17449fb5f48adc7051134d756a0dd76f36a487 # Parent cb15fa9242f9c9cb9ba3e36a378d43bce804037c mod_presence: Added option 'ignore_presence_priority'. diff -r cb15fa9242f9 -r 9b17449fb5f4 plugins/mod_presence.lua --- a/plugins/mod_presence.lua Fri May 21 19:45:33 2010 +0100 +++ b/plugins/mod_presence.lua Sat May 22 03:20:43 2010 +0500 @@ -62,7 +62,17 @@ 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