Comparison

mod_muc_restrict_media/mod_muc_restrict_media.lua @ 4905:e9ac68f9bc16

mod_muc_restrict_media: Fix traceback when checking default (thanks Martin)
author Matthew Wild <mwild1@gmail.com>
date Fri, 04 Mar 2022 19:57:13 +0000
parent 4904:1919cff763d4
child 4962:5a3031613dbc
comparison
equal deleted inserted replaced
4904:1919cff763d4 4905:e9ac68f9bc16
22 22
23 module:hook("muc-config-submitted", function(event) 23 module:hook("muc-config-submitted", function(event)
24 local room, fields, changed = event.room, event.fields, event.changed; 24 local room, fields, changed = event.room, event.fields, event.changed;
25 local new_restrict_media = not fields["{xmpp:prosody.im}muc#roomconfig_unaffiliated_media"]; 25 local new_restrict_media = not fields["{xmpp:prosody.im}muc#roomconfig_unaffiliated_media"];
26 if new_restrict_media ~= should_restrict_media(room) then 26 if new_restrict_media ~= should_restrict_media(room) then
27 if new_restrict_media == restrict_by_default(room) then 27 if new_restrict_media == restrict_by_default then
28 room._data.restrict_media = nil; 28 room._data.restrict_media = nil;
29 else 29 else
30 room._data.restrict_media = new_restrict_media; 30 room._data.restrict_media = new_restrict_media;
31 end 31 end
32 if type(changed) == "table" then 32 if type(changed) == "table" then