MUC: Update all config form handlers to take advantage of the new per-option events
[prosody.git] / plugins / muc / persistent.lib.lua
index ccf6fffe41effa35c53d87802da9ccba9e747d1d..a72bcbb54bb19354bed042a2473e63c8ce3f278a 100644 (file)
@@ -28,9 +28,8 @@ module:hook("muc-config-form", function(event)
        });
 end);
 
-module:hook("muc-config-submitted", function(event)
-       local new = event.fields["muc#roomconfig_persistentroom"];
-       if new ~= nil and set_persistent(event.room, new) then
+module:hook("muc-config-submitted/muc#roomconfig_persistentroom", function(event)
+       if set_persistent(event.room, event.value) then
                event.status_codes["104"] = true;
        end
 end);