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

22 lines
555 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;
if is_healthcheck_room(room.jid) then
2020-04-30 21:26:58 +00:00
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.jid) then
2020-04-30 21:26:58 +00:00
return;
end
room:set_affiliation(true, occupant.bare_jid, nil);
end, 2);