Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 023c4e2

Browse files
authored
Merge pull request #1928 from matrix-org/dbkr/leave_server_notices_room_message
Message for leaving server notices room
2 parents e4a67e8 + 168b956 commit 023c4e2

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/components/structures/MatrixChat.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,20 @@ export default React.createClass({
996996
}, (err) => {
997997
modal.close();
998998
console.error("Failed to leave room " + roomId + " " + err);
999+
let title = _t("Failed to leave room");
1000+
let message = _t("Server may be unavailable, overloaded, or you hit a bug.");
1001+
if (err.errcode == 'M_CANNOT_LEAVE_SERVER_NOTICE_ROOM') {
1002+
title = _t("Can't leave Server Notices room");
1003+
message = _t(
1004+
"This room is used for important messages from the Homeserver, " +
1005+
"so you cannot leave it.",
1006+
);
1007+
} else if (err && err.message) {
1008+
message = err.message;
1009+
}
9991010
Modal.createTrackedDialog('Failed to leave room', '', ErrorDialog, {
1000-
title: _t("Failed to leave room"),
1001-
description: (err && err.message ? err.message :
1002-
_t("Server may be unavailable, overloaded, or you hit a bug.")),
1011+
title: title,
1012+
description: message,
10031013
});
10041014
});
10051015
}

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@
949949
"This room is not public. You will not be able to rejoin without an invite.": "This room is not public. You will not be able to rejoin without an invite.",
950950
"Are you sure you want to leave the room '%(roomName)s'?": "Are you sure you want to leave the room '%(roomName)s'?",
951951
"Failed to leave room": "Failed to leave room",
952+
"Can't leave Server Notices room": "Can't leave Server Notices room",
953+
"This room is used for important messages from the Homeserver, so you cannot leave it.": "This room is used for important messages from the Homeserver, so you cannot leave it.",
952954
"Signed Out": "Signed Out",
953955
"For security, this session has been signed out. Please sign in again.": "For security, this session has been signed out. Please sign in again.",
954956
"Terms and Conditions": "Terms and Conditions",

0 commit comments

Comments
 (0)