Software /
code /
prosody
Comparison
plugins/muc/name.lib.lua @ 6991:84e01dbb739e
MUC: Update all config form handlers to take advantage of the new per-option events
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 11 Dec 2015 15:33:58 +0000 (2015-12-11) |
parent | 6209:cc00e78e6a31 |
child | 7119:50b9a7e86de9 |
comparison
equal
deleted
inserted
replaced
6990:f476e2497568 | 6991:84e01dbb739e |
---|---|
32 label = "Name"; | 32 label = "Name"; |
33 value = get_name(event.room) or ""; | 33 value = get_name(event.room) or ""; |
34 }); | 34 }); |
35 end); | 35 end); |
36 | 36 |
37 module:hook("muc-config-submitted", function(event) | 37 module:hook("muc-config-submitted/muc#roomconfig_roomname", function(event) |
38 local new = event.fields["muc#roomconfig_roomname"]; | 38 if set_name(event.room, event.value) then |
39 if new ~= nil and set_name(event.room, new) then | |
40 event.status_codes["104"] = true; | 39 event.status_codes["104"] = true; |
41 end | 40 end |
42 end); | 41 end); |
43 | 42 |
44 return { | 43 return { |