Comparison

plugins/muc/whois.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 6214:9813c74ce006
child 7075:47a2deb74b56
comparison
equal deleted inserted replaced
6990:f476e2497568 6991:84e01dbb739e
39 { value = 'anyone', label = 'Anyone', default = whois == 'anyone' } 39 { value = 'anyone', label = 'Anyone', default = whois == 'anyone' }
40 } 40 }
41 }); 41 });
42 end); 42 end);
43 43
44 module:hook("muc-config-submitted", function(event) 44 module:hook("muc-config-submitted/muc#roomconfig_whois", function(event)
45 local new = event.fields["muc#roomconfig_whois"]; 45 if set_whois(event.room, event.value) then
46 if new ~= nil and set_whois(event.room, new) then
47 local code = (new == 'moderators') and "173" or "172"; 46 local code = (new == 'moderators') and "173" or "172";
48 event.status_codes[code] = true; 47 event.status_codes[code] = true;
49 end 48 end
50 end); 49 end);
51 50