Software / code / prosody
Comparison
plugins/muc/description.lib.lua @ 7119:50b9a7e86de9
MUC: Separate form data from form in disco#info event
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 03 Feb 2016 02:05:49 +0100 |
| parent | 6991:84e01dbb739e |
| child | 7124:a0764a8d6b26 |
comparison
equal
deleted
inserted
replaced
| 7116:ecba5fee4867 | 7119:50b9a7e86de9 |
|---|---|
| 22 local function add_form_option(event) | 22 local function add_form_option(event) |
| 23 table.insert(event.form, { | 23 table.insert(event.form, { |
| 24 name = "muc#roomconfig_roomdesc"; | 24 name = "muc#roomconfig_roomdesc"; |
| 25 type = "text-single"; | 25 type = "text-single"; |
| 26 label = "Description"; | 26 label = "Description"; |
| 27 value = get_description(event.room) or ""; | |
| 28 }); | 27 }); |
| 28 event.formdata["muc#roomconfig_roomdesc"] = get_description(event.room) or ""; | |
| 29 end | 29 end |
| 30 module:hook("muc-disco#info", add_form_option); | 30 module:hook("muc-disco#info", add_form_option); |
| 31 module:hook("muc-config-form", add_form_option); | 31 module:hook("muc-config-form", add_form_option); |
| 32 | 32 |
| 33 module:hook("muc-config-submitted/muc#roomconfig_roomdesc", function(event) | 33 module:hook("muc-config-submitted/muc#roomconfig_roomdesc", function(event) |