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