Mercurial > prosody-hg
comparison plugins/muc/subject.lib.lua @ 8848:402d8febfa43
MUC: Advertise in whether participants are allowed to change the subject (#1155)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Jun 2018 08:02:43 +0200 |
| parents | b6b1f0f9b381 |
| children | cd186331ab1f |
comparison
equal
deleted
inserted
replaced
| 8847:74526c425dec | 8848:402d8febfa43 |
|---|---|
| 25 changesubject = changesubject and true or nil; | 25 changesubject = changesubject and true or nil; |
| 26 if get_changesubject(room) == changesubject then return false; end | 26 if get_changesubject(room) == changesubject then return false; end |
| 27 room._data.changesubject = changesubject; | 27 room._data.changesubject = changesubject; |
| 28 return true; | 28 return true; |
| 29 end | 29 end |
| 30 | |
| 31 module:hook("muc-disco#info", function (event) | |
| 32 table.insert(event.form, { | |
| 33 name = "muc#roominfo_changesubject"; | |
| 34 type = "boolean"; | |
| 35 }); | |
| 36 event.formdata["muc#roominfo_changesubject"] = get_changesubject(event.room); | |
| 37 end); | |
| 30 | 38 |
| 31 module:hook("muc-config-form", function(event) | 39 module:hook("muc-config-form", function(event) |
| 32 table.insert(event.form, { | 40 table.insert(event.form, { |
| 33 name = "muc#roomconfig_changesubject"; | 41 name = "muc#roomconfig_changesubject"; |
| 34 type = "boolean"; | 42 type = "boolean"; |
