Comparison

plugins/muc/hidden.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
parent 6225:12537f1c1fec
child 7352:50b24b3476e6
comparison
equal deleted inserted replaced
6990:f476e2497568 6991:84e01dbb739e
26 label = "Make Room Publicly Searchable?"; 26 label = "Make Room Publicly Searchable?";
27 value = not get_hidden(event.room); 27 value = not get_hidden(event.room);
28 }); 28 });
29 end); 29 end);
30 30
31 module:hook("muc-config-submitted", function(event) 31 module:hook("muc-config-submitted/muc#roomconfig_publicroom", function(event)
32 local new = event.fields["muc#roomconfig_publicroom"]; 32 if set_hidden(event.room, not event.value) then
33 if new ~= nil and set_hidden(event.room, not new) then
34 event.status_codes["104"] = true; 33 event.status_codes["104"] = true;
35 end 34 end
36 end); 35 end);
37 36
38 module:hook("muc-disco#info", function(event) 37 module:hook("muc-disco#info", function(event)