Comparison

plugins/muc/muc.lib.lua @ 8888:cbcac5b9b7ce

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 08 Jun 2018 16:15:32 +0200
parent 8865:2a8bbfcb6868
parent 8887:c47f220580fd
child 8891:d9b7db6f140f
comparison
equal deleted inserted replaced
8885:d4f5d47f874d 8888:cbcac5b9b7ce
351 table.insert(event.form, { name = "muc#roominfo_occupants", label = "Number of occupants" }); 351 table.insert(event.form, { name = "muc#roominfo_occupants", label = "Number of occupants" });
352 event.formdata["muc#roominfo_occupants"] = tostring(iterators.count(event.room:each_occupant())); 352 event.formdata["muc#roominfo_occupants"] = tostring(iterators.count(event.room:each_occupant()));
353 end); 353 end);
354 354
355 function room_mt:get_disco_items(stanza) 355 function room_mt:get_disco_items(stanza)
356 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items"); 356 return st.reply(stanza):query("http://jabber.org/protocol/disco#items");
357 for room_jid in self:each_occupant() do
358 reply:tag("item", {jid = room_jid, name = room_jid:match("/(.*)")}):up();
359 end
360 return reply;
361 end 357 end
362 358
363 function room_mt:handle_kickable(origin, stanza) -- luacheck: ignore 212 359 function room_mt:handle_kickable(origin, stanza) -- luacheck: ignore 212
364 local real_jid = stanza.attr.from; 360 local real_jid = stanza.attr.from;
365 local occupant = self:get_occupant_by_real_jid(real_jid); 361 local occupant = self:get_occupant_by_real_jid(real_jid);