Mercurial > prosody-modules
comparison mod_privacy_lists/mod_privacy_lists.lua @ 1487:5410f5c30d63
mod_privacy_lists: Correctly sort the list rules by order (thanks Flow). Fixes issue #58
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 16 Aug 2014 17:55:08 +0100 |
| parents | 92b930be261f |
| children | c2fc3516cca1 |
comparison
equal
deleted
inserted
replaced
| 1486:b3e692ee16b5 | 1487:5410f5c30d63 |
|---|---|
| 173 return {"cancel", "bad-request", "Action must be either deny or allow."}; | 173 return {"cancel", "bad-request", "Action must be either deny or allow."}; |
| 174 end | 174 end |
| 175 list.items[#list.items + 1] = tmp; | 175 list.items[#list.items + 1] = tmp; |
| 176 end | 176 end |
| 177 | 177 |
| 178 table.sort(list, function(a, b) return a.order < b.order; end); | 178 table.sort(list.items, function(a, b) return a.order < b.order; end); |
| 179 | 179 |
| 180 origin.send(st.reply(stanza)); | 180 origin.send(st.reply(stanza)); |
| 181 if bare_sessions[bare_jid] ~= nil then | 181 if bare_sessions[bare_jid] ~= nil then |
| 182 local iq = st.iq ( { type = "set", id="push1" } ); | 182 local iq = st.iq ( { type = "set", id="push1" } ); |
| 183 iq:tag ("query", { xmlns = "jabber:iq:privacy" } ); | 183 iq:tag ("query", { xmlns = "jabber:iq:privacy" } ); |
