This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,24 +217,33 @@ export default class MultiInviter { | |
const isFederated = room?.currentState.getStateEvents(EventType.RoomCreate, '') | ||
?.getContent()['m.federate']; | ||
|
||
const type = isSpace ? 'space' : 'room'; | ||
let errorText: string; | ||
let fatal = false; | ||
switch (err.errcode) { | ||
case "M_FORBIDDEN": | ||
if (isFederated === false) { | ||
errorText = _t("This %(type)s is unfederated. " + | ||
"You cannot invite people from external servers.", { type }); | ||
if (isSpace) { | ||
errorText = _t('You do not have permission to invite people to this space.'); | ||
} else if (isFederated === false) { | ||
errorText = _t("This room is unfederated. " + | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
owi92
Author
Contributor
|
||
"You cannot invite people from external servers."); | ||
} else { | ||
errorText = _t("You do not have permission to invite people to this %(type)s.", { type }); | ||
errorText = _t('You do not have permission to invite people to this room.'); | ||
} | ||
fatal = true; | ||
break; | ||
case USER_ALREADY_INVITED: | ||
errorText = _t("User is already invited to the %(type)s", { type }); | ||
if (isSpace) { | ||
errorText = _t("User is already invited to the space"); | ||
} else { | ||
errorText = _t("User is already invited to the room"); | ||
} | ||
break; | ||
case USER_ALREADY_JOINED: | ||
errorText = _t("User is already in the %(type)s", { type }); | ||
if (isSpace) { | ||
errorText = _t("User is already in the space"); | ||
} else { | ||
errorText = _t("User is already in the room"); | ||
} | ||
break; | ||
case "M_LIMIT_EXCEEDED": | ||
// we're being throttled so wait a bit & try again | ||
|
@@ -261,7 +270,11 @@ export default class MultiInviter { | |
errorText = _t("The user must be unbanned before they can be invited."); | ||
break; | ||
case "M_UNSUPPORTED_ROOM_VERSION": | ||
errorText = _t("The user's homeserver does not support the version of the %(type)s.", { type }); | ||
if (isSpace) { | ||
errorText = _t("The user's homeserver does not support the version of the space."); | ||
} else { | ||
errorText = _t("The user's homeserver does not support the version of the room."); | ||
} | ||
break; | ||
} | ||
|
||
|
Spaces can be unfederated too