mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* feat(visitors): Shows notification when not-allowed error is detected.
* feat(visitors): Adds extensions to errors to distinguish them. * feat: Shows notification when not-allowed error is detected. * chore(deps) lib-jitsi-meet@latest https://github.com/jitsi/lib-jitsi-meet/compare/v1822.0.0+58a91446...v1823.0.0+ec98b020 * squash: Update texts.
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
import { sendAnalytics } from './react/features/analytics/functions';
|
||||
import {
|
||||
maybeRedirectToWelcomePage,
|
||||
redirectToStaticPage,
|
||||
reloadWithStoredParams
|
||||
} from './react/features/app/actions';
|
||||
import { showModeratedNotification } from './react/features/av-moderation/actions';
|
||||
@@ -275,12 +274,6 @@ class ConferenceConnector {
|
||||
|
||||
switch (err) {
|
||||
|
||||
case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
|
||||
// let's show some auth not allowed page
|
||||
APP.store.dispatch(redirectToStaticPage('static/authError.html'));
|
||||
break;
|
||||
}
|
||||
|
||||
case JitsiConferenceErrors.RESERVATION_ERROR: {
|
||||
const [ code, msg ] = params;
|
||||
|
||||
|
||||
@@ -319,6 +319,7 @@
|
||||
"embedMeeting": "Embed meeting",
|
||||
"enterDisplayName": "Enter your name",
|
||||
"error": "Error",
|
||||
"errorRoomCreationRestriction": "You tried to join too quickly, please come back in a bit.",
|
||||
"gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
|
||||
"grantModeratorDialog": "Are you sure you want to grant moderator rights to {{participantName}}?",
|
||||
"grantModeratorTitle": "Grant moderator rights",
|
||||
@@ -1485,6 +1486,10 @@
|
||||
"notification": {
|
||||
"demoteDescription": "Sent here by {{actor}}, raise your hand to participate",
|
||||
"description": "To participate raise your hand",
|
||||
"noMainParticipantsDescription": "A participant needs to start the meeting. Please try again in a bit.",
|
||||
"noMainParticipantsTitle": "This meeting hasn’t started yet.",
|
||||
"noVisitorLobby": "You cannot join while there is a lobby enabled for the meeting.",
|
||||
"notAllowedPromotion": "A participant needs to allow your request first.",
|
||||
"title": "You are a visitor in the meeting"
|
||||
}
|
||||
},
|
||||
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -61,7 +61,7 @@
|
||||
"js-md5": "0.6.1",
|
||||
"js-sha512": "0.8.0",
|
||||
"jwt-decode": "2.2.0",
|
||||
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
|
||||
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
|
||||
"lodash": "4.17.21",
|
||||
"moment": "2.29.4",
|
||||
"moment-duration-format": "2.2.2",
|
||||
@@ -12866,8 +12866,8 @@
|
||||
},
|
||||
"node_modules/lib-jitsi-meet": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
|
||||
"integrity": "sha512-ppMF34ZUYGIgD0pYxKr22B77geyBInyTmmKrK9qwfeLXUy1NJraj2uR11I2VIQQLTOphY8Sr0MOCsFKAk+0r2w==",
|
||||
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
|
||||
"integrity": "sha512-jbROcnR1IWzp8I7quwj9uA8LMDE99tS6Wkxxf4ESAsYpc5wjbfJdqGaXKiIreWvlqM5NJTd/jMjw+DrZzbif1Q==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -29374,8 +29374,8 @@
|
||||
}
|
||||
},
|
||||
"lib-jitsi-meet": {
|
||||
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
|
||||
"integrity": "sha512-ppMF34ZUYGIgD0pYxKr22B77geyBInyTmmKrK9qwfeLXUy1NJraj2uR11I2VIQQLTOphY8Sr0MOCsFKAk+0r2w==",
|
||||
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
|
||||
"integrity": "sha512-jbROcnR1IWzp8I7quwj9uA8LMDE99tS6Wkxxf4ESAsYpc5wjbfJdqGaXKiIreWvlqM5NJTd/jMjw+DrZzbif1Q==",
|
||||
"requires": {
|
||||
"@jitsi/js-utils": "2.2.1",
|
||||
"@jitsi/logger": "2.0.2",
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"js-md5": "0.6.1",
|
||||
"js-sha512": "0.8.0",
|
||||
"jwt-decode": "2.2.0",
|
||||
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
|
||||
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
|
||||
"lodash": "4.17.21",
|
||||
"moment": "2.29.4",
|
||||
"moment-duration-format": "2.2.2",
|
||||
|
||||
@@ -331,15 +331,17 @@ export function createNetworkInfoEvent({ isOnline, networkType, details }:
|
||||
/**
|
||||
* Creates a "not allowed error" event.
|
||||
*
|
||||
* @param {string} type - The type of the error.
|
||||
* @param {string} reason - The reason for the error.
|
||||
* @returns {Object} The event in a format suitable for sending via
|
||||
* sendAnalytics.
|
||||
*/
|
||||
export function createNotAllowedErrorEvent(reason: string) {
|
||||
export function createNotAllowedErrorEvent(type: string, reason: string) {
|
||||
return {
|
||||
action: 'not.allowed.error',
|
||||
attributes: {
|
||||
reason
|
||||
reason,
|
||||
type
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -224,9 +224,30 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
|
||||
break;
|
||||
}
|
||||
case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
|
||||
const [ msg ] = error.params;
|
||||
const [ type, msg ] = error.params;
|
||||
|
||||
let descriptionKey;
|
||||
let titleKey = 'dialog.tokenAuthFailed';
|
||||
|
||||
if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.NO_MAIN_PARTICIPANTS) {
|
||||
descriptionKey = 'visitors.notification.noMainParticipantsDescription';
|
||||
titleKey = 'visitors.notification.noMainParticipantsTitle';
|
||||
} else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.NO_VISITORS_LOBBY) {
|
||||
descriptionKey = 'visitors.notification.noVisitorLobby';
|
||||
} else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.PROMOTION_NOT_ALLOWED) {
|
||||
descriptionKey = 'visitors.notification.notAllowedPromotion';
|
||||
} else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.ROOM_CREATION_RESTRICTION) {
|
||||
descriptionKey = 'dialog.errorRoomCreationRestriction';
|
||||
}
|
||||
|
||||
APP.store.dispatch(showErrorNotification({
|
||||
descriptionKey,
|
||||
hideErrorSupportLink: true,
|
||||
titleKey
|
||||
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
||||
|
||||
sendAnalytics(createNotAllowedErrorEvent(type, msg));
|
||||
|
||||
sendAnalytics(createNotAllowedErrorEvent(msg));
|
||||
break;
|
||||
}
|
||||
case JitsiConferenceErrors.OFFER_ANSWER_FAILED:
|
||||
|
||||
@@ -63,7 +63,8 @@ module:hook('muc-occupant-pre-join', function (event)
|
||||
|
||||
if host == local_domain then
|
||||
if room._main_room_lobby_enabled then
|
||||
origin.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitors not allowed while lobby is on!'));
|
||||
origin.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitors not allowed while lobby is on!')
|
||||
:tag('no-visitors-lobby', { xmlns = 'jitsi:visitors' }));
|
||||
return true;
|
||||
else
|
||||
occupant.role = 'visitor';
|
||||
|
||||
@@ -341,16 +341,19 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul
|
||||
return;
|
||||
end
|
||||
module:log('error', 'Visitor needs to be allowed by a moderator %s', stanza.attr.from);
|
||||
session.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitor needs to be allowed by a moderator'));
|
||||
session.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitor needs to be allowed by a moderator')
|
||||
:tag('promotion-not-allowed', { xmlns = 'jitsi:visitors' }));
|
||||
return true;
|
||||
elseif is_vpaas(room) then
|
||||
-- special case for vpaas where if someone with a visitor token tries to join a room, where
|
||||
-- there are no visitors yet, we deny access
|
||||
if session.jitsi_meet_context_user and session.jitsi_meet_context_user.role == 'visitor' then
|
||||
else
|
||||
-- if is_vpaas(room) then
|
||||
-- -- special case for vpaas where if someone with a visitor token tries to join a room, where
|
||||
-- -- there are no visitors yet, we deny access
|
||||
-- if session.jitsi_meet_context_user and session.jitsi_meet_context_user.role == 'visitor' then
|
||||
session.log('warn', 'Deny user join as visitor in the main meeting, not approved');
|
||||
session.send(st.error_reply(
|
||||
stanza, 'cancel', 'not-allowed', 'Visitor tried to join the main room without approval'));
|
||||
end
|
||||
stanza, 'cancel', 'not-allowed', 'Visitor tried to join the main room without approval')
|
||||
:tag('no-main-participants', { xmlns = 'jitsi:visitors' }));
|
||||
-- end
|
||||
end
|
||||
|
||||
end, 7); -- after muc_meeting_id, the logic for not joining before jicofo
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<!--#include virtual="/base.html" -->
|
||||
<link rel="stylesheet" href="css/all.css"/>
|
||||
<!--#include virtual="/title.html" -->
|
||||
</head>
|
||||
<body>
|
||||
<div class="redirectPageMessage">
|
||||
Sorry! You are not allowed to be here :(
|
||||
<div class="forbidden-msg">
|
||||
<p>You might be missing the JWT or using an incompatible one.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user