Comparison

plugins/muc/affiliation_notify.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 6394:fe034fa564ee
child 7352:50b24b3476e6
comparison
equal deleted inserted replaced
6990:f476e2497568 6991:84e01dbb739e
35 label = "Notify users when their affiliation changes when they are not in the room?"; 35 label = "Notify users when their affiliation changes when they are not in the room?";
36 value = get_affiliation_notify(event.room); 36 value = get_affiliation_notify(event.room);
37 }); 37 });
38 end); 38 end);
39 39
40 module:hook("muc-config-submitted", function(event) 40 module:hook("muc-config-submitted/muc#roomconfig_affiliationnotify", function(event)
41 local new = event.fields["muc#roomconfig_affiliationnotify"]; 41 if set_affiliation_notify(event.room, event.value) then
42 if new ~= nil and set_affiliation_notify(event.room, new) then
43 event.status_codes["104"] = true; 42 event.status_codes["104"] = true;
44 end 43 end
45 end); 44 end);
46 45
47 module:hook("muc-set-affiliation", function(event) 46 module:hook("muc-set-affiliation", function(event)