mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-30 12:21:41 +00:00
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into t3chguy/room-list/13981
Conflicts: src/@types/global.d.ts src/stores/RoomViewStore.tsx
This commit is contained in:
@@ -279,12 +279,22 @@ class RoomViewStore extends Store<ActionPayload> {
|
||||
console.log("Failed to join room:", msg);
|
||||
if (err.name === "ConnectionError") {
|
||||
msg = _t("There was an error joining the room");
|
||||
}
|
||||
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
|
||||
} else if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
|
||||
msg = <div>
|
||||
{_t("Sorry, your homeserver is too old to participate in this room.")}<br />
|
||||
{_t("Please contact your homeserver administrator.")}
|
||||
</div>;
|
||||
} else if (err.httpStatus === 404) {
|
||||
const invitingUserId = this.getInvitingUserId(this._state.roomId);
|
||||
// only provide a better error message for invites
|
||||
if (invitingUserId) {
|
||||
// if the inviting user is on the same HS, there can only be one cause: they left.
|
||||
if (invitingUserId.endsWith(`:${MatrixClientPeg.get().getDomain()}`)) {
|
||||
msg = _t("The person who invited you already left the room.");
|
||||
} else {
|
||||
msg = _t("The person who invited you already left the room, or their server is offline.");
|
||||
}
|
||||
}
|
||||
}
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createTrackedDialog('Failed to join room', '', ErrorDialog, {
|
||||
@@ -294,6 +304,16 @@ class RoomViewStore extends Store<ActionPayload> {
|
||||
});
|
||||
}
|
||||
|
||||
private getInvitingUserId(roomId: string): string {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const room = cli.getRoom(roomId);
|
||||
if (room && room.getMyMembership() === "invite") {
|
||||
const myMember = room.getMember(cli.getUserId());
|
||||
const inviteEvent = myMember ? myMember.events.member : null;
|
||||
return inviteEvent && inviteEvent.getSender();
|
||||
}
|
||||
}
|
||||
|
||||
private joinRoomError(payload: ActionPayload) {
|
||||
this.setState({
|
||||
joining: false,
|
||||
|
||||
Reference in New Issue
Block a user