jiti-meet/resources/prosody-plugins/mod_muc_allowners.lua

22 lines
547 B
Lua
Raw Normal View History

2020-04-30 21:26:58 +00:00
local is_healthcheck_room = module:require "util".is_healthcheck_room;
2020-04-30 21:26:58 +00:00
module:hook("muc-occupant-joined", function (event)
local room, occupant = event.room, event.occupant;
2020-04-30 21:26:58 +00:00
if is_healthcheck_room(room) then
return;
end
2020-04-30 21:26:58 +00:00
room:set_affiliation(true, occupant.bare_jid, "owner");
end, 2);
module:hook("muc-occupant-left", function (event)
local room, occupant = event.room, event.occupant;
if is_healthcheck_room(room) then
return;
end
room:set_affiliation(true, occupant.bare_jid, nil);
end, 2);