Просмотр исходного кода

* 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.
factor2
Дамян Минков 1 год назад
Родитель
Сommit
f279e634e4
Аккаунт пользователя с таким Email не найден

+ 0
- 7
conference.js Просмотреть файл

@@ -17,7 +17,6 @@ import {
17 17
 import { sendAnalytics } from './react/features/analytics/functions';
18 18
 import {
19 19
     maybeRedirectToWelcomePage,
20
-    redirectToStaticPage,
21 20
     reloadWithStoredParams
22 21
 } from './react/features/app/actions';
23 22
 import { showModeratedNotification } from './react/features/av-moderation/actions';
@@ -275,12 +274,6 @@ class ConferenceConnector {
275 274
 
276 275
         switch (err) {
277 276
 
278
-        case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
279
-            // let's show some auth not allowed page
280
-            APP.store.dispatch(redirectToStaticPage('static/authError.html'));
281
-            break;
282
-        }
283
-
284 277
         case JitsiConferenceErrors.RESERVATION_ERROR: {
285 278
             const [ code, msg ] = params;
286 279
 

+ 5
- 0
lang/main.json Просмотреть файл

@@ -319,6 +319,7 @@
319 319
         "embedMeeting": "Embed meeting",
320 320
         "enterDisplayName": "Enter your name",
321 321
         "error": "Error",
322
+        "errorRoomCreationRestriction": "You tried to join too quickly, please come back in a bit.",
322 323
         "gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
323 324
         "grantModeratorDialog": "Are you sure you want to grant moderator rights to {{participantName}}?",
324 325
         "grantModeratorTitle": "Grant moderator rights",
@@ -1485,6 +1486,10 @@
1485 1486
         "notification": {
1486 1487
             "demoteDescription": "Sent here by {{actor}}, raise your hand to participate",
1487 1488
             "description": "To participate raise your hand",
1489
+            "noMainParticipantsDescription": "A participant needs to start the meeting. Please try again in a bit.",
1490
+            "noMainParticipantsTitle": "This meeting hasn’t started yet.",
1491
+            "noVisitorLobby": "You cannot join while there is a lobby enabled for the meeting.",
1492
+            "notAllowedPromotion": "A participant needs to allow your request first.",
1488 1493
             "title": "You are a visitor in the meeting"
1489 1494
         }
1490 1495
     },

+ 5
- 5
package-lock.json Просмотреть файл

@@ -61,7 +61,7 @@
61 61
         "js-md5": "0.6.1",
62 62
         "js-sha512": "0.8.0",
63 63
         "jwt-decode": "2.2.0",
64
-        "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
64
+        "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
65 65
         "lodash": "4.17.21",
66 66
         "moment": "2.29.4",
67 67
         "moment-duration-format": "2.2.2",
@@ -12866,8 +12866,8 @@
12866 12866
     },
12867 12867
     "node_modules/lib-jitsi-meet": {
12868 12868
       "version": "0.0.0",
12869
-      "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
12870
-      "integrity": "sha512-ppMF34ZUYGIgD0pYxKr22B77geyBInyTmmKrK9qwfeLXUy1NJraj2uR11I2VIQQLTOphY8Sr0MOCsFKAk+0r2w==",
12869
+      "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
12870
+      "integrity": "sha512-jbROcnR1IWzp8I7quwj9uA8LMDE99tS6Wkxxf4ESAsYpc5wjbfJdqGaXKiIreWvlqM5NJTd/jMjw+DrZzbif1Q==",
12871 12871
       "hasInstallScript": true,
12872 12872
       "license": "Apache-2.0",
12873 12873
       "dependencies": {
@@ -29374,8 +29374,8 @@
29374 29374
       }
29375 29375
     },
29376 29376
     "lib-jitsi-meet": {
29377
-      "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
29378
-      "integrity": "sha512-ppMF34ZUYGIgD0pYxKr22B77geyBInyTmmKrK9qwfeLXUy1NJraj2uR11I2VIQQLTOphY8Sr0MOCsFKAk+0r2w==",
29377
+      "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
29378
+      "integrity": "sha512-jbROcnR1IWzp8I7quwj9uA8LMDE99tS6Wkxxf4ESAsYpc5wjbfJdqGaXKiIreWvlqM5NJTd/jMjw+DrZzbif1Q==",
29379 29379
       "requires": {
29380 29380
         "@jitsi/js-utils": "2.2.1",
29381 29381
         "@jitsi/logger": "2.0.2",

+ 1
- 1
package.json Просмотреть файл

@@ -67,7 +67,7 @@
67 67
     "js-md5": "0.6.1",
68 68
     "js-sha512": "0.8.0",
69 69
     "jwt-decode": "2.2.0",
70
-    "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1822.0.0+58a91446/lib-jitsi-meet.tgz",
70
+    "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1823.0.0+ec98b020/lib-jitsi-meet.tgz",
71 71
     "lodash": "4.17.21",
72 72
     "moment": "2.29.4",
73 73
     "moment-duration-format": "2.2.2",

+ 4
- 2
react/features/analytics/AnalyticsEvents.ts Просмотреть файл

@@ -331,15 +331,17 @@ export function createNetworkInfoEvent({ isOnline, networkType, details }:
331 331
 /**
332 332
  * Creates a "not allowed error" event.
333 333
  *
334
+ * @param {string} type - The type of the error.
334 335
  * @param {string} reason - The reason for the error.
335 336
  * @returns {Object} The event in a format suitable for sending via
336 337
  * sendAnalytics.
337 338
  */
338
-export function createNotAllowedErrorEvent(reason: string) {
339
+export function createNotAllowedErrorEvent(type: string, reason: string) {
339 340
     return {
340 341
         action: 'not.allowed.error',
341 342
         attributes: {
342
-            reason
343
+            reason,
344
+            type
343 345
         }
344 346
     };
345 347
 }

+ 23
- 2
react/features/base/conference/middleware.any.ts Просмотреть файл

@@ -224,9 +224,30 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
224 224
         break;
225 225
     }
226 226
     case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
227
-        const [ msg ] = error.params;
227
+        const [ type, msg ] = error.params;
228
+
229
+        let descriptionKey;
230
+        let titleKey = 'dialog.tokenAuthFailed';
231
+
232
+        if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.NO_MAIN_PARTICIPANTS) {
233
+            descriptionKey = 'visitors.notification.noMainParticipantsDescription';
234
+            titleKey = 'visitors.notification.noMainParticipantsTitle';
235
+        } else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.NO_VISITORS_LOBBY) {
236
+            descriptionKey = 'visitors.notification.noVisitorLobby';
237
+        } else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.PROMOTION_NOT_ALLOWED) {
238
+            descriptionKey = 'visitors.notification.notAllowedPromotion';
239
+        } else if (type === JitsiConferenceErrors.AUTH_ERROR_TYPES.ROOM_CREATION_RESTRICTION) {
240
+            descriptionKey = 'dialog.errorRoomCreationRestriction';
241
+        }
242
+
243
+        APP.store.dispatch(showErrorNotification({
244
+            descriptionKey,
245
+            hideErrorSupportLink: true,
246
+            titleKey
247
+        }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
248
+
249
+        sendAnalytics(createNotAllowedErrorEvent(type, msg));
228 250
 
229
-        sendAnalytics(createNotAllowedErrorEvent(msg));
230 251
         break;
231 252
     }
232 253
     case JitsiConferenceErrors.OFFER_ANSWER_FAILED:

+ 2
- 1
resources/prosody-plugins/mod_fmuc.lua Просмотреть файл

@@ -63,7 +63,8 @@ module:hook('muc-occupant-pre-join', function (event)
63 63
 
64 64
     if host == local_domain then
65 65
         if room._main_room_lobby_enabled then
66
-            origin.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitors not allowed while lobby is on!'));
66
+            origin.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitors not allowed while lobby is on!')
67
+                :tag('no-visitors-lobby', { xmlns = 'jitsi:visitors' }));
67 68
             return true;
68 69
         else
69 70
             occupant.role = 'visitor';

+ 10
- 7
resources/prosody-plugins/mod_visitors_component.lua Просмотреть файл

@@ -341,16 +341,19 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul
341 341
                 return;
342 342
             end
343 343
             module:log('error', 'Visitor needs to be allowed by a moderator %s', stanza.attr.from);
344
-            session.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitor needs to be allowed by a moderator'));
344
+            session.send(st.error_reply(stanza, 'cancel', 'not-allowed', 'Visitor needs to be allowed by a moderator')
345
+                :tag('promotion-not-allowed', { xmlns = 'jitsi:visitors' }));
345 346
             return true;
346
-        elseif is_vpaas(room) then
347
-            -- special case for vpaas where if someone with a visitor token tries to join a room, where
348
-            -- there are no visitors yet, we deny access
349
-            if session.jitsi_meet_context_user and session.jitsi_meet_context_user.role == 'visitor' then
347
+        else
348
+--             if is_vpaas(room) then
349
+--             -- special case for vpaas where if someone with a visitor token tries to join a room, where
350
+--             -- there are no visitors yet, we deny access
351
+--             if session.jitsi_meet_context_user and session.jitsi_meet_context_user.role == 'visitor' then
350 352
                 session.log('warn', 'Deny user join as visitor in the main meeting, not approved');
351 353
                 session.send(st.error_reply(
352
-                    stanza, 'cancel', 'not-allowed', 'Visitor tried to join the main room without approval'));
353
-            end
354
+                    stanza, 'cancel', 'not-allowed', 'Visitor tried to join the main room without approval')
355
+                        :tag('no-main-participants', { xmlns = 'jitsi:visitors' }));
356
+--             end
354 357
         end
355 358
 
356 359
     end, 7); -- after muc_meeting_id, the logic for not joining before jicofo

+ 0
- 15
static/authError.html Просмотреть файл

@@ -1,15 +0,0 @@
1
-<html>
2
-<head>
3
-    <!--#include virtual="/base.html" -->
4
-    <link rel="stylesheet" href="css/all.css"/>
5
-    <!--#include virtual="/title.html" -->
6
-</head>
7
-<body>
8
-    <div class="redirectPageMessage">
9
-        Sorry! You are not allowed to be here :(
10
-        <div class="forbidden-msg">
11
-            <p>You might be missing the JWT or using an incompatible one.</p>
12
-        </div>
13
-    </div>
14
-</body>
15
-</html>

Загрузка…
Отмена
Сохранить