Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix: Fix logs to use module logger.
damenchoe169979babb4
diff --git a/resources/prosody-plugins/mod_auth_token.lua b/resources/prosody-plugins/mod_auth_token.luaindex da579f0e2c..e5353c6963 100644--- a/resources/prosody-plugins/mod_auth_token.lua+++ b/resources/prosody-plugins/mod_auth_token.lua@@ -71,7 +71,7 @@ function provider.get_sasl_handler(session)-- retrieve custom public key from server and save it on the sessionlocal pre_event_result = prosody.events.fire_event("pre-jitsi-authentication-fetch-key", session);if pre_event_result ~= nil and pre_event_result.res == false then- log("warn",+ module:log("warn","Error verifying token on pre authentication stage:%s, reason:%s", pre_event_result.error, pre_event_result.reason);session.auth_token = nil;return pre_event_result.res, pre_event_result.error, pre_event_result.reason;@@ -79,7 +79,7 @@ function provider.get_sasl_handler(session)local res, error, reason = token_util:process_and_verify_token(session);if res == false then- log("warn",+ module:log("warn","Error verifying token err:%s, reason:%s", error, reason);session.auth_token = nil;return res, error, reason;@@ -87,7 +87,7 @@ function provider.get_sasl_handler(session)local shouldAllow = prosody.events.fire_event("jitsi-access-ban-check", session);if shouldAllow == false then- log("warn", "user is banned")+ module:log("warn", "user is banned")return false, "not-allowed", "user is banned";end@@ -109,7 +109,7 @@ function provider.get_sasl_handler(session)local post_event_result = prosody.events.fire_event("post-jitsi-authentication", session);if post_event_result ~= nil and post_event_result.res == false then- log("warn",+ module:log("warn","Error verifying token on post authentication stage :%s, reason:%s", post_event_result.error, post_event_result.reason);session.auth_token = nil;return post_event_result.res, post_event_result.error, post_event_result.reason;diff --git a/resources/prosody-plugins/mod_av_moderation_component.lua b/resources/prosody-plugins/mod_av_moderation_component.luaindex ff41609399..b7903c0903 100644--- a/resources/prosody-plugins/mod_av_moderation_component.lua+++ b/resources/prosody-plugins/mod_av_moderation_component.lua@@ -141,11 +141,11 @@ function on_message(event)local from = event.stanza.attr.from;local occupant = room:get_occupant_by_real_jid(from);if not occupant then- log('warn', 'No occupant %s found for %s', from, room.jid);+ module:log('warn', 'No occupant %s found for %s', from, room.jid);return false;endif occupant.role ~= 'moderator' then- log('warn', 'Occupant %s is not moderator and not allowed this operation for %s', from, room.jid);+ module:log('warn', 'Occupant %s is not moderator and not allowed this operation for %s', from, room.jid);return false;enddiff --git a/resources/prosody-plugins/mod_filter_iq_rayo.lua b/resources/prosody-plugins/mod_filter_iq_rayo.luaindex b40b77e35f..88a1de8b28 100644--- a/resources/prosody-plugins/mod_filter_iq_rayo.lua+++ b/resources/prosody-plugins/mod_filter_iq_rayo.lua@@ -7,7 +7,7 @@ local is_feature_allowed = module:require "util".is_feature_allowed;-- no token configuration but requiredif token_util == nil then- log("error", "no token configuration but it is required");+ module:log("error", "no token configuration but it is required");return;enddiff --git a/resources/prosody-plugins/mod_fmuc.lua b/resources/prosody-plugins/mod_fmuc.luaindex d50a93e989..71a92dcab4 100644--- a/resources/prosody-plugins/mod_fmuc.lua+++ b/resources/prosody-plugins/mod_fmuc.lua@@ -230,7 +230,7 @@ local function stanza_handler(event)local room = get_room_from_jid(room_jid_match_rewrite(room_jid));if not room then- log('warn', 'No room found %s', room_jid);+ module:log('warn', 'No room found %s', room_jid);return;enddiff --git a/resources/prosody-plugins/mod_muc_breakout_rooms.lua b/resources/prosody-plugins/mod_muc_breakout_rooms.luaindex 5113274aa4..4bd41c9538 100644--- a/resources/prosody-plugins/mod_muc_breakout_rooms.lua+++ b/resources/prosody-plugins/mod_muc_breakout_rooms.lua@@ -277,13 +277,13 @@ function on_message(event)endendif not occupant then- log('warn', 'No occupant %s found for %s', from, room.jid);+ module:log('warn', 'No occupant %s found for %s', from, room.jid);return false;endendif occupant.role ~= 'moderator' then- log('warn', 'Occupant %s is not moderator and not allowed this operation for %s', from, room.jid);+ module:log('warn', 'Occupant %s is not moderator and not allowed this operation for %s', from, room.jid);return false;enddiff --git a/resources/prosody-plugins/mod_speakerstats_component.lua b/resources/prosody-plugins/mod_speakerstats_component.luaindex 5b2c646bf2..04598b82ac 100644--- a/resources/prosody-plugins/mod_speakerstats_component.lua+++ b/resources/prosody-plugins/mod_speakerstats_component.lua@@ -65,12 +65,12 @@ function on_message(event)local room = get_room_from_jid(room_jid_match_rewrite(roomAddress));if not room then- log("warn", "No room found %s", roomAddress);+ module:log("warn", "No room found %s", roomAddress);return false;endif not room.speakerStats then- log("warn", "No speakerStats found for %s", roomAddress);+ module:log("warn", "No speakerStats found for %s", roomAddress);return false;end@@ -79,7 +79,7 @@ function on_message(event)local occupant = room:get_occupant_by_real_jid(from);if not occupant then- log("warn", "No occupant %s found for %s", from, roomAddress);+ module:log("warn", "No occupant %s found for %s", from, roomAddress);return false;end@@ -107,18 +107,18 @@ function on_message(event)local room = get_room_from_jid(room_jid_match_rewrite(roomAddress));if not room then- log("warn", "No room found %s", roomAddress);+ module:log("warn", "No room found %s", roomAddress);return false;endif not room.speakerStats then- log("warn", "No speakerStats found for %s", roomAddress);+ module:log("warn", "No speakerStats found for %s", roomAddress);return false;endlocal from = event.stanza.attr.from;local occupant = room:get_occupant_by_real_jid(from);if not occupant then- log("warn", "No occupant %s found for %s", from, roomAddress);+ module:log("warn", "No occupant %s found for %s", from, roomAddress);return false;endlocal faceLandmarks = room.speakerStats[occupant.jid].faceLandmarks;@@ -154,7 +154,7 @@ end-- saves start time if it is new dominat speaker-- or calculates and accumulates time of speakingfunction SpeakerStats:setDominantSpeaker(isNowDominantSpeaker, silence)- -- log("debug", "set isDominant %s for %s", tostring(isNowDominantSpeaker), self.nick);+ -- module:log("debug", "set isDominant %s for %s", tostring(isNowDominantSpeaker), self.nick);local now = socket.gettime()*1000;diff --git a/resources/prosody-plugins/mod_token_verification.lua b/resources/prosody-plugins/mod_token_verification.luaindex 387407cb33..db97e78b3a 100644--- a/resources/prosody-plugins/mod_token_verification.lua+++ b/resources/prosody-plugins/mod_token_verification.lua@@ -13,16 +13,16 @@ endlocal parentHostName = string.gmatch(tostring(host), "%w+.(%w.+)")();if parentHostName == nil then- log("error", "Failed to start - unable to get parent hostname");- return;+ module:log("error", "Failed to start - unable to get parent hostname");+ return;endlocal parentCtx = module:context(parentHostName);if parentCtx == nil then- log("error",- "Failed to start - unable to get parent context for host: %s",- tostring(parentHostName));- return;+ module:log("error",+ "Failed to start - unable to get parent context for host: %s",+ tostring(parentHostName));+ return;endlocal token_util = module:require "token/util".new(parentCtx);@@ -32,7 +32,7 @@ if token_util == nil thenreturn;end-log("debug",+module:log("debug","%s - starting MUC token verifier app_id: %s app_secret: %s allow empty: %s",tostring(host), tostring(token_util.appId), tostring(token_util.appSecret),tostring(token_util.allowEmptyToken));@@ -46,43 +46,42 @@ load_config();-- verify user and whether he is allowed to join a room based on the token informationlocal function verify_user(session, stanza)- log("debug", "Session token: %s, session room: %s",- tostring(session.auth_token),- tostring(session.jitsi_meet_room));-- -- token not required for admin users- local user_jid = stanza.attr.from;- if is_admin(user_jid) then- log("debug", "Token not required from admin user: %s", user_jid);- return true;- end-- log("debug",+ module:log("debug", "Session token: %s, session room: %s",+ tostring(session.auth_token),+ tostring(session.jitsi_meet_room));++ -- token not required for admin users+ local user_jid = stanza.attr.from;+ if is_admin(user_jid) then+ module:log("debug", "Token not required from admin user: %s", user_jid);+ return true;+ end++ module:log("debug","Will verify token for user: %s, room: %s ", user_jid, stanza.attr.to);if not token_util:verify_room(session, stanza.attr.to) then- log("error", "Token %s not allowed to join: %s",+ module:log("error", "Token %s not allowed to join: %s",tostring(session.auth_token), tostring(stanza.attr.to));session.send(st.error_reply(stanza, "cancel", "not-allowed", "Room and token mismatched"));return false; -- we need to just return non nilend- log("debug",- "allowed: %s to enter/create room: %s", user_jid, stanza.attr.to);+ module:log("debug", "allowed: %s to enter/create room: %s", user_jid, stanza.attr.to);return true;endmodule:hook("muc-room-pre-create", function(event)- local origin, stanza = event.origin, event.stanza;- log("debug", "pre create: %s %s", tostring(origin), tostring(stanza));+ local origin, stanza = event.origin, event.stanza;+ module:log("debug", "pre create: %s %s", tostring(origin), tostring(stanza));if not verify_user(origin, stanza) thenreturn true; -- Returning any value other than nil will halt processing of the eventendend, 99);module:hook("muc-occupant-pre-join", function(event)- local origin, room, stanza = event.origin, event.room, event.stanza;- log("debug", "pre join: %s %s", tostring(room), tostring(stanza));+ local origin, room, stanza = event.origin, event.room, event.stanza;+ module:log("debug", "pre join: %s %s", tostring(room), tostring(stanza));if not verify_user(origin, stanza) thenreturn true; -- Returning any value other than nil will halt processing of the eventenddiff --git a/resources/prosody-plugins/mod_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.luaindex 9b2be1bcdf..6f187fdd63 100644--- a/resources/prosody-plugins/mod_visitors_component.lua+++ b/resources/prosody-plugins/mod_visitors_component.lua@@ -126,7 +126,7 @@ local function stanza_handler(event)local room = get_room_from_jid(room_jid_match_rewrite(room_jid));if not room then- log('warn', 'No room found %s', room_jid);+ module:log('warn', 'No room found %s', room_jid);return;end