Software /
code /
prosody
Comparison
plugins/mod_privacy.lua @ 6365:75bd55e84112
mod_privacy: Fix to correctly sort privacy list rules by order (thanks Flow)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 28 Aug 2014 09:17:07 +0100 |
parent | 5500:eeea0eb2602a |
child | 6367:769a3577dd85 |
child | 7459:94af49ad657e |
comparison
equal
deleted
inserted
replaced
6364:4e93e8768c36 | 6365:75bd55e84112 |
---|---|
155 return {"cancel", "bad-request", "Action must be either deny or allow."}; | 155 return {"cancel", "bad-request", "Action must be either deny or allow."}; |
156 end | 156 end |
157 list.items[#list.items + 1] = tmp; | 157 list.items[#list.items + 1] = tmp; |
158 end | 158 end |
159 | 159 |
160 table.sort(list, function(a, b) return a.order < b.order; end); | 160 table.sort(list.items, function(a, b) return a.order < b.order; end); |
161 | 161 |
162 origin.send(st.reply(stanza)); | 162 origin.send(st.reply(stanza)); |
163 if bare_sessions[bare_jid] ~= nil then | 163 if bare_sessions[bare_jid] ~= nil then |
164 local iq = st.iq ( { type = "set", id="push1" } ); | 164 local iq = st.iq ( { type = "set", id="push1" } ); |
165 iq:tag ("query", { xmlns = "jabber:iq:privacy" } ); | 165 iq:tag ("query", { xmlns = "jabber:iq:privacy" } ); |