Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 6372:305226a9e581
mod_muc: Fix 'destroy rooms' adhoc command (Thanks Florob)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 31 Aug 2014 20:33:47 +0200 |
parent | 6348:bffc885dc378 |
child | 6479:d016437e01bf |
comparison
equal
deleted
inserted
replaced
6371:624f4689454a | 6372:305226a9e581 |
---|---|
238 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/muc#destroy" }; | 238 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/muc#destroy" }; |
239 { name = "rooms", type = "list-multi", required = true, label = "Rooms to destroy:"}; | 239 { name = "rooms", type = "list-multi", required = true, label = "Rooms to destroy:"}; |
240 }; | 240 }; |
241 | 241 |
242 local destroy_rooms_handler = adhoc_initial(destroy_rooms_layout, function() | 242 local destroy_rooms_handler = adhoc_initial(destroy_rooms_layout, function() |
243 return { rooms = array.collect(each_room):pluck("jid"):sort(); }; | 243 return { rooms = array.collect(each_room()):pluck("jid"):sort(); }; |
244 end, function(fields, errors) | 244 end, function(fields, errors) |
245 if errors then | 245 if errors then |
246 local errmsg = {}; | 246 local errmsg = {}; |
247 for name, err in pairs(errors) do | 247 for name, err in pairs(errors) do |
248 errmsg[#errmsg + 1] = name .. ": " .. err; | 248 errmsg[#errmsg + 1] = name .. ": " .. err; |