2020-04-30 21:26:58 +00:00
|
|
|
local is_healthcheck_room = module:require "util".is_healthcheck_room;
|
2017-02-03 17:41:08 +00:00
|
|
|
|
2020-04-30 21:26:58 +00:00
|
|
|
module:hook("muc-occupant-joined", function (event)
|
|
|
|
local room, occupant = event.room, event.occupant;
|
2017-02-03 17:41:08 +00:00
|
|
|
|
2020-05-12 21:40:39 +00:00
|
|
|
if is_healthcheck_room(room.jid) then
|
2020-04-30 21:26:58 +00:00
|
|
|
return;
|
|
|
|
end
|
2017-02-03 17:41:08 +00:00
|
|
|
|
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;
|
|
|
|
|
2020-05-12 21:40:39 +00:00
|
|
|
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);
|