Browse Source

Handle 'forbidden' MUC errors with type 'cancel' and add fallthrough

JC Brand 3 years ago
parent
commit
c379fe80fb
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/headless/plugins/muc/muc.js

+ 7 - 2
src/headless/plugins/muc/muc.js

@@ -2582,8 +2582,13 @@ const ChatRoomMixin = {
                 this.setDisconnectionState(message, reason);
             } else if (error.querySelector('remote-server-not-found')) {
                 const message = __('Remote server not found');
-                const feedback = reason ? __('The explanation given is: "%1$s".', reason) : undefined;
-                this.setDisconnectionState(message, feedback);
+                this.setDisconnectionState(message, reason);
+            } else if (error.querySelector('forbidden')) {
+                const message = __("You're not allowed to enter this groupchat");
+                this.setDisconnectionState(message, reason);
+            } else {
+                const message = __("An error happened while trying to enter this groupchat");
+                this.setDisconnectionState(message, reason);
             }
         }
     },