From 941a3cfa53f6add5f3521471ea9ab3fff14dcfd0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 21 Aug 2018 18:33:25 +0100 Subject: [PATCH] Support M_INCOMPATIBLE_ROOM_VERSION For https://github.com/vector-im/riot-web/issues/7164 --- src/i18n/strings/en_EN.json | 20 ++++++-------------- src/stores/RoomViewStore.js | 8 +++++++- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index fcc9bcc8be..b560c7e71b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -203,8 +203,11 @@ "Your browser does not support the required cryptography extensions": "Your browser does not support the required cryptography extensions", "Not a valid Riot keyfile": "Not a valid Riot keyfile", "Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?", + "Sorry, your homeserver is too old to participate in this room.": "Sorry, your homeserver is too old to participate in this room.", + "Please contact your homeserver administrator.": "Please contact your homeserver administrator.", "Failed to join room": "Failed to join room", "Message Pinning": "Message Pinning", + "Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view", "Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing", "Use compact timeline layout": "Use compact timeline layout", "Hide removed messages": "Hide removed messages", @@ -543,10 +546,6 @@ "Internal room ID: ": "Internal room ID: ", "Room version number: ": "Room version number: ", "Add a topic": "Add a topic", - "There is a known vulnerability affecting this room.": "There is a known vulnerability affecting this room.", - "This room version is vulnerable to malicious modification of room state.": "This room version is vulnerable to malicious modification of room state.", - "Click here to upgrade to the latest room version and ensure room integrity is protected.": "Click here to upgrade to the latest room version and ensure room integrity is protected.", - "Only room administrators will see this warning": "Only room administrators will see this warning", "Search…": "Search…", "This Room": "This Room", "All Rooms": "All Rooms", @@ -865,12 +864,6 @@ "Ignore request": "Ignore request", "Loading device info...": "Loading device info...", "Encryption key request": "Encryption key request", - "Upgrade Room Version": "Upgrade Room Version", - "Upgrading this room requires closing down the current instance of the room and creating a new room it its place. To give room members the best possible experience, we will:": "Upgrading this room requires closing down the current instance of the room and creating a new room it its place. To give room members the best possible experience, we will:", - "Create a new room with the same name, description and avatar": "Create a new room with the same name, description and avatar", - "Update any local room aliases to point to the new room": "Update any local room aliases to point to the new room", - "Stop users from speaking in the old version of the room, and post a message advising users to move to the new room": "Stop users from speaking in the old version of the room, and post a message advising users to move to the new room", - "Put a link back to the old room at the start of the new room so people can see old messages": "Put a link back to the old room at the start of the new room so people can see old messages", "Sign out": "Sign out", "Log out and remove encryption keys?": "Log out and remove encryption keys?", "Clear Storage and Sign Out": "Clear Storage and Sign Out", @@ -1121,6 +1114,8 @@ "Labs": "Labs", "These are experimental features that may break in unexpected ways": "These are experimental features that may break in unexpected ways", "Use with caution": "Use with caution", + "Lazy loading members not supported": "Lazy loading members not supported", + "Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver.", "Deactivate my account": "Deactivate my account", "Clear Cache": "Clear Cache", "Clear Cache and Reload": "Clear Cache and Reload", @@ -1231,8 +1226,5 @@ "Import": "Import", "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", - "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", - "Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view", - "Lazy loading members not supported": "Lazy load members not supported", - "Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver." + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room" } diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js index fed0d7b4a1..f15925f480 100644 --- a/src/stores/RoomViewStore.js +++ b/src/stores/RoomViewStore.js @@ -223,7 +223,13 @@ class RoomViewStore extends Store { action: 'join_room_error', err: err, }); - const msg = err.message ? err.message : JSON.stringify(err); + let msg = err.message ? err.message : JSON.stringify(err); + if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') { + msg =
+ {_t("Sorry, your homeserver is too old to participate in this room.")}
+ {_t("Please contact your homeserver administrator.")} +
; + } const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Failed to join room', '', ErrorDialog, { title: _t("Failed to join room"),