Comparison

mod_csi_muc_priorities/mod_csi_muc_priorities.lua @ 3537:7d6fb9570395

mod_csi_muc_priorities: Sort list of JIDs Finding anything is easier if it's not randomized by hash table order
author Kim Alvefur <zash@zash.se>
date Mon, 01 Apr 2019 08:40:22 +0200
parent 3536:eed657091329
child 3538:946902fa4088
comparison
equal deleted inserted replaced
3536:eed657091329 3537:7d6fb9570395
66 local unimportant = {}; 66 local unimportant = {};
67 if prioritized_jids then 67 if prioritized_jids then
68 for jid in pairs(prioritized_jids) do 68 for jid in pairs(prioritized_jids) do
69 table.insert(unimportant, jid); 69 table.insert(unimportant, jid);
70 end 70 end
71 table.sort(unimportant);
71 end 72 end
72 return { unimportant = unimportant }; 73 return { unimportant = unimportant };
73 end, function(fields, form_err, data) 74 end, function(fields, form_err, data)
74 if form_err then 75 if form_err then
75 return { status = "completed", error = { message = "Problem in submitted form" } }; 76 return { status = "completed", error = { message = "Problem in submitted form" } };