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