diff options
author | Kim Alvefur <zash@zash.se> | 2017-04-10 23:16:13 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-04-10 23:16:13 +0200 |
commit | 61c1325aa6509896b202f731c546e980ef97fff4 (patch) | |
tree | e163b8572f88719bc01ba397d169da78c4fc8d48 /plugins/mod_presence.lua | |
parent | fcca450715b5ccb94002dc9dd2babfe214955f4b (diff) | |
parent | 1796c0795624152f8415ad64f9cdab62a9ad6402 (diff) | |
download | prosody-61c1325aa6509896b202f731c546e980ef97fff4.tar.gz prosody-61c1325aa6509896b202f731c546e980ef97fff4.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r-- | plugins/mod_presence.lua | 15 |
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 |