X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmuc%2Fpersistent.lib.lua;h=abceafe1cb784018ef3cc70746aa72adf9d0e916;hb=f9e3cb3d5580b9a66b122da97c3507b57e374825;hp=ccf6fffe41effa35c53d87802da9ccba9e747d1d;hpb=d0825240c38cd809aaee5b3e84b75ad4007ef478;p=prosody.git diff --git a/plugins/muc/persistent.lib.lua b/plugins/muc/persistent.lib.lua index ccf6fffe..abceafe1 100644 --- a/plugins/muc/persistent.lib.lua +++ b/plugins/muc/persistent.lib.lua @@ -15,7 +15,6 @@ local function set_persistent(room, persistent) persistent = persistent and true or nil; if get_persistent(room) == persistent then return false; end room._data.persistent = persistent; - if room.save then room:save(true); end return true; end @@ -26,11 +25,10 @@ module:hook("muc-config-form", function(event) label = "Make Room Persistent?"; value = get_persistent(event.room); }); -end); +end, 100-3); -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);