diff --git a/resources/prosody-plugins/mod_muc_allowners.lua b/resources/prosody-plugins/mod_muc_allowners.lua index 0fca2ebd9..603ef0c1c 100644 --- a/resources/prosody-plugins/mod_muc_allowners.lua +++ b/resources/prosody-plugins/mod_muc_allowners.lua @@ -3,7 +3,7 @@ local is_healthcheck_room = module:require "util".is_healthcheck_room; module:hook("muc-occupant-joined", function (event) local room, occupant = event.room, event.occupant; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end @@ -13,7 +13,7 @@ end, 2); module:hook("muc-occupant-left", function (event) local room, occupant = event.room, event.occupant; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end diff --git a/resources/prosody-plugins/mod_muc_lobby_rooms.lua b/resources/prosody-plugins/mod_muc_lobby_rooms.lua index 424961481..7af0e90aa 100644 --- a/resources/prosody-plugins/mod_muc_lobby_rooms.lua +++ b/resources/prosody-plugins/mod_muc_lobby_rooms.lua @@ -209,7 +209,7 @@ process_host_module(main_muc_component_config, function(host_module, host) host_module:hook('muc-occupant-pre-join', function (event) local room, stanza = event.room, event.stanza; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end diff --git a/resources/prosody-plugins/mod_muc_meeting_id.lua b/resources/prosody-plugins/mod_muc_meeting_id.lua index 24fbff6d6..1d9bc7439 100644 --- a/resources/prosody-plugins/mod_muc_meeting_id.lua +++ b/resources/prosody-plugins/mod_muc_meeting_id.lua @@ -9,7 +9,7 @@ local is_healthcheck_room = module:require "util".is_healthcheck_room; module:hook("muc-room-created", function(event) local room = event.room; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end diff --git a/resources/prosody-plugins/mod_speakerstats_component.lua b/resources/prosody-plugins/mod_speakerstats_component.lua index 7124109b8..6daa6f084 100644 --- a/resources/prosody-plugins/mod_speakerstats_component.lua +++ b/resources/prosody-plugins/mod_speakerstats_component.lua @@ -113,7 +113,7 @@ end function room_created(event) local room = event.room; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end @@ -124,7 +124,7 @@ end function occupant_joined(event) local room = event.room; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end @@ -184,7 +184,7 @@ end function occupant_leaving(event) local room = event.room; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end @@ -205,7 +205,7 @@ end function room_destroyed(event) local room = event.room; - if is_healthcheck_room(room) then + if is_healthcheck_room(room.jid) then return; end diff --git a/resources/prosody-plugins/util.lib.lua b/resources/prosody-plugins/util.lib.lua index 155e5f5c4..9ef355a39 100644 --- a/resources/prosody-plugins/util.lib.lua +++ b/resources/prosody-plugins/util.lib.lua @@ -175,9 +175,10 @@ end function starts_with(str, start) return str:sub(1, #start) == start end + -- healthcheck rooms in jicofo starts with a string '__jicofo-health-check' -function is_healthcheck_room(room) - if starts_with(room.jid, "__jicofo-health-check") then +function is_healthcheck_room(room_jid) + if starts_with(room_jid, "__jicofo-health-check") then return true; end