Comparison

plugins/muc/persistent.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 6222:355b29881117
child 7352:50b24b3476e6
comparison
equal deleted inserted replaced
6990:f476e2497568 6991:84e01dbb739e
26 label = "Make Room Persistent?"; 26 label = "Make Room Persistent?";
27 value = get_persistent(event.room); 27 value = get_persistent(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_persistentroom", function(event)
32 local new = event.fields["muc#roomconfig_persistentroom"]; 32 if set_persistent(event.room, event.value) then
33 if new ~= nil and set_persistent(event.room, 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)