Comparison

plugins/muc/mod_muc.lua @ 6246:45b8ad2b14c5

plugins/muc/mod_muc: Don't use rooms object directory in adhoc section
author daurnimator <quae@daurnimator.com>
date Wed, 30 Apr 2014 12:43:04 -0400
parent 6245:8ec4ff630eb4
child 6247:851647eb6657
comparison
equal deleted inserted replaced
6245:8ec4ff630eb4 6246:45b8ad2b14c5
237 errmsg[#errmsg + 1] = name .. ": " .. err; 237 errmsg[#errmsg + 1] = name .. ": " .. err;
238 end 238 end
239 return { status = "completed", error = { message = t_concat(errmsg, "\n") } }; 239 return { status = "completed", error = { message = t_concat(errmsg, "\n") } };
240 end 240 end
241 for _, room in ipairs(fields.rooms) do 241 for _, room in ipairs(fields.rooms) do
242 rooms[room]:destroy(); 242 get_room_from_jid(room):destroy();
243 rooms[room] = nil;
244 end 243 end
245 return { status = "completed", info = "The following rooms were destroyed:\n"..t_concat(fields.rooms, "\n") }; 244 return { status = "completed", info = "The following rooms were destroyed:\n"..t_concat(fields.rooms, "\n") };
246 end); 245 end);
247 local destroy_rooms_desc = adhoc_new("Destroy Rooms", "http://prosody.im/protocol/muc#destroy", destroy_rooms_handler, "admin"); 246 local destroy_rooms_desc = adhoc_new("Destroy Rooms", "http://prosody.im/protocol/muc#destroy", destroy_rooms_handler, "admin");
248 247