Преглед на файлове

* 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 година
родител
ревизия
f279e634e4
No account linked to committer's email address

+ 0
- 7
conference.js Целия файл

17
 import { sendAnalytics } from './react/features/analytics/functions';
17
 import { sendAnalytics } from './react/features/analytics/functions';
18
 import {
18
 import {
19
     maybeRedirectToWelcomePage,
19
     maybeRedirectToWelcomePage,
20
-    redirectToStaticPage,
21
     reloadWithStoredParams
20
     reloadWithStoredParams
22
 } from './react/features/app/actions';
21
 } from './react/features/app/actions';
23
 import { showModeratedNotification } from './react/features/av-moderation/actions';
22
 import { showModeratedNotification } from './react/features/av-moderation/actions';
275
 
274
 
276
         switch (err) {
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
         case JitsiConferenceErrors.RESERVATION_ERROR: {
277
         case JitsiConferenceErrors.RESERVATION_ERROR: {
285
             const [ code, msg ] = params;
278
             const [ code, msg ] = params;
286
 
279
 

+ 5
- 0
lang/main.json Целия файл

319
         "embedMeeting": "Embed meeting",
319
         "embedMeeting": "Embed meeting",
320
         "enterDisplayName": "Enter your name",
320
         "enterDisplayName": "Enter your name",
321
         "error": "Error",
321
         "error": "Error",
322
+        "errorRoomCreationRestriction": "You tried to join too quickly, please come back in a bit.",
322
         "gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
323
         "gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
323
         "grantModeratorDialog": "Are you sure you want to grant moderator rights to {{participantName}}?",
324
         "grantModeratorDialog": "Are you sure you want to grant moderator rights to {{participantName}}?",
324
         "grantModeratorTitle": "Grant moderator rights",
325
         "grantModeratorTitle": "Grant moderator rights",
1485
         "notification": {
1486
         "notification": {
1486
             "demoteDescription": "Sent here by {{actor}}, raise your hand to participate",
1487
             "demoteDescription": "Sent here by {{actor}}, raise your hand to participate",
1487
             "description": "To participate raise your hand",
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
             "title": "You are a visitor in the meeting"
1493
             "title": "You are a visitor in the meeting"
1489
         }
1494
         }
1490
     },
1495
     },

+ 5
- 5
package-lock.json Целия файл

61
         "js-md5": "0.6.1",
61
         "js-md5": "0.6.1",
62
         "js-sha512": "0.8.0",
62
         "js-sha512": "0.8.0",
63
         "jwt-decode": "2.2.0",
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
         "lodash": "4.17.21",
65
         "lodash": "4.17.21",
66
         "moment": "2.29.4",
66
         "moment": "2.29.4",
67
         "moment-duration-format": "2.2.2",
67
         "moment-duration-format": "2.2.2",
12866
     },
12866
     },
12867
     "node_modules/lib-jitsi-meet": {
12867
     "node_modules/lib-jitsi-meet": {
12868
       "version": "0.0.0",
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
       "hasInstallScript": true,
12871
       "hasInstallScript": true,
12872
       "license": "Apache-2.0",
12872
       "license": "Apache-2.0",
12873
       "dependencies": {
12873
       "dependencies": {
29374
       }
29374
       }
29375
     },
29375
     },
29376
     "lib-jitsi-meet": {
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
       "requires": {
29379
       "requires": {
29380
         "@jitsi/js-utils": "2.2.1",
29380
         "@jitsi/js-utils": "2.2.1",
29381
         "@jitsi/logger": "2.0.2",
29381
         "@jitsi/logger": "2.0.2",

+ 1
- 1
package.json Целия файл

67
     "js-md5": "0.6.1",
67
     "js-md5": "0.6.1",
68
     "js-sha512": "0.8.0",
68
     "js-sha512": "0.8.0",
69
     "jwt-decode": "2.2.0",
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
     "lodash": "4.17.21",
71
     "lodash": "4.17.21",
72
     "moment": "2.29.4",
72
     "moment": "2.29.4",
73
     "moment-duration-format": "2.2.2",
73
     "moment-duration-format": "2.2.2",

+ 4
- 2
react/features/analytics/AnalyticsEvents.ts Целия файл

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

+ 23
- 2
react/features/base/conference/middleware.any.ts Целия файл

224
         break;
224
         break;
225
     }
225
     }
226
     case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
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
         break;
251
         break;
231
     }
252
     }
232
     case JitsiConferenceErrors.OFFER_ANSWER_FAILED:
253
     case JitsiConferenceErrors.OFFER_ANSWER_FAILED:

+ 2
- 1
resources/prosody-plugins/mod_fmuc.lua Целия файл

63
 
63
 
64
     if host == local_domain then
64
     if host == local_domain then
65
         if room._main_room_lobby_enabled then
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
             return true;
68
             return true;
68
         else
69
         else
69
             occupant.role = 'visitor';
70
             occupant.role = 'visitor';

+ 10
- 7
resources/prosody-plugins/mod_visitors_component.lua Целия файл

341
                 return;
341
                 return;
342
             end
342
             end
343
             module:log('error', 'Visitor needs to be allowed by a moderator %s', stanza.attr.from);
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
             return true;
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
                 session.log('warn', 'Deny user join as visitor in the main meeting, not approved');
352
                 session.log('warn', 'Deny user join as visitor in the main meeting, not approved');
351
                 session.send(st.error_reply(
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
         end
357
         end
355
 
358
 
356
     end, 7); -- after muc_meeting_id, the logic for not joining before jicofo
359
     end, 7); -- after muc_meeting_id, the logic for not joining before jicofo

+ 0
- 15
static/authError.html Целия файл

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>

Loading…
Отказ
Запис