From c379fe80fb226d20515370081902c01c03b57341 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 29 Mar 2022 10:36:32 +0200 Subject: [PATCH] Handle 'forbidden' MUC errors with type 'cancel' and add fallthrough --- src/headless/plugins/muc/muc.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/headless/plugins/muc/muc.js b/src/headless/plugins/muc/muc.js index a3e52c33b..dad01e568 100644 --- a/src/headless/plugins/muc/muc.js +++ b/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); } } },