aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-10 23:16:13 +0200
committerKim Alvefur <zash@zash.se>2017-04-10 23:16:13 +0200
commit8a9dd05b08a3a85b84680547e9b0f2027499fd37 (patch)
treee163b8572f88719bc01ba397d169da78c4fc8d48 /plugins/mod_presence.lua
parentf01822fbfc55fa0cdde361c179f02b044ceb7bcf (diff)
parent91baabfede04fcead2849a35d71a706c9042d074 (diff)
downloadprosody-8a9dd05b08a3a85b84680547e9b0f2027499fd37.tar.gz
prosody-8a9dd05b08a3a85b84680547e9b0f2027499fd37.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 2acc7db2..0c243bc6 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -36,18 +36,15 @@ function handle_normal_presence(origin, stanza)
local priority = stanza:get_child("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
+ for i=#priority,2,-1 do priority[i] = nil; end
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