mod_presence: Use get_child_text on priority child element (fixes #552)

remotes/origin/0.11
Kim Alvefur 9 years ago
parent abdd9866e5
commit d8b1435c70
  1. 13
      plugins/mod_presence.lua

@ -40,14 +40,11 @@ function handle_normal_presence(origin, stanza)
priority[1] = "0";
end
end
local priority = stanza:get_child("priority");
if priority and #priority > 0 then
priority = t_concat(priority);
if s_find(priority, "^[+-]?[0-9]+$") then
priority = tonumber(priority);
if priority < -128 then priority = -128 end
if priority > 127 then priority = 127 end
else priority = 0; end
local priority = stanza:get_child_text("priority");
if priority and s_find(priority, "^[+-]?[0-9]+$") then
priority = tonumber(priority);
if priority < -128 then priority = -128 end
if priority > 127 then priority = 127 end
else priority = 0; end
if full_sessions[origin.full_jid] then -- if user is still connected
origin.send(stanza); -- reflect their presence back to them

Loading…
Cancel
Save