MUC: Advertise in whether participants are allowed to change the subject (#1155)
authorKim Alvefur <zash@zash.se>
Fri, 01 Jun 2018 08:02:43 +0200
changeset 8851 402d8febfa43
parent 8850 74526c425dec
child 8852 cd186331ab1f
MUC: Advertise in whether participants are allowed to change the subject (#1155)
plugins/muc/subject.lib.lua
--- a/plugins/muc/subject.lib.lua	Wed May 30 22:43:45 2018 +0100
+++ b/plugins/muc/subject.lib.lua	Fri Jun 01 08:02:43 2018 +0200
@@ -28,6 +28,14 @@
 	return true;
 end
 
+module:hook("muc-disco#info", function (event)
+	table.insert(event.form, {
+		name = "muc#roominfo_changesubject";
+		type = "boolean";
+	});
+	event.formdata["muc#roominfo_changesubject"] = get_changesubject(event.room);
+end);
+
 module:hook("muc-config-form", function(event)
 	table.insert(event.form, {
 		name = "muc#roomconfig_changesubject";