Comparison

plugins/muc/muc.lib.lua @ 8571:44217f40ff4a

MUC: send muc#stanza_id feature as per XEP-0045 v1.31 (fixes #1097)
author Jonas Wielicki <jonas@wielicki.name>
date Thu, 08 Mar 2018 17:35:56 +0100
parent 8527:0a3dced117f7
child 8581:f7c397935872
comparison
equal deleted inserted replaced
8570:a4ef8cfa97bd 8571:44217f40ff4a
342 reply:add_child(form:form(formdata, "result")); 342 reply:add_child(form:form(formdata, "result"));
343 return reply; 343 return reply;
344 end 344 end
345 module:hook("muc-disco#info", function(event) 345 module:hook("muc-disco#info", function(event)
346 event.reply:tag("feature", {var = "http://jabber.org/protocol/muc"}):up(); 346 event.reply:tag("feature", {var = "http://jabber.org/protocol/muc"}):up();
347 event.reply:tag("feature", {var = "http://jabber.org/protocol/muc#stable_id"}):up();
347 end); 348 end);
348 module:hook("muc-disco#info", function(event) 349 module:hook("muc-disco#info", function(event)
349 table.insert(event.form, { name = "muc#roominfo_occupants", label = "Number of occupants" }); 350 table.insert(event.form, { name = "muc#roominfo_occupants", label = "Number of occupants" });
350 event.formdata["muc#roominfo_occupants"] = tostring(iterators.count(event.room:each_occupant())); 351 event.formdata["muc#roominfo_occupants"] = tostring(iterators.count(event.room:each_occupant()));
351 end); 352 end);