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

This commit is contained in:
JC Brand 2022-03-29 10:36:32 +02:00
parent 5ef0f3ad5d
commit c379fe80fb

View File

@ -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);
}
}
},