Close room properly (prosody custom module)

meet

#1

Hello,

I created a Prosody custom module that closes conference after a participant with specific JWT leaves the room. But I want to fire other participants first before destroying the room.

module:hook("muc-occupant-left", function(event)
if shouldWeCloseRoom(event.origin.auth_token) then
  --FIRE OTHER PARTICIPANTS FIRST
  ...
  --Destroy Room
  event.room:destroy();
end
end,150)

Any ideas guys ?
Many thanks