mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 09:46:09 +03:00
No-op action:join if the user is already invited for scalar (#7334)
* No-op action:join if the user is already invited for scalar * Improve words
This commit is contained in:
parent
c21895b5b4
commit
785eb5fa15
1 changed files with 3 additions and 3 deletions
|
@ -53,7 +53,7 @@ All actions can return an error response instead of the response outlined below.
|
||||||
|
|
||||||
invite
|
invite
|
||||||
------
|
------
|
||||||
Invites a user into a room.
|
Invites a user into a room. The request will no-op if the user is already joined OR invited to the room.
|
||||||
|
|
||||||
Request:
|
Request:
|
||||||
- room_id is the room to invite the user into.
|
- room_id is the room to invite the user into.
|
||||||
|
@ -295,9 +295,9 @@ function inviteUser(event: MessageEvent<any>, roomId: string, userId: string): v
|
||||||
}
|
}
|
||||||
const room = client.getRoom(roomId);
|
const room = client.getRoom(roomId);
|
||||||
if (room) {
|
if (room) {
|
||||||
// if they are already invited we can resolve immediately.
|
// if they are already invited or joined we can resolve immediately.
|
||||||
const member = room.getMember(userId);
|
const member = room.getMember(userId);
|
||||||
if (member && member.membership === "invite") {
|
if (member && ["join", "invite"].includes(member.membership)) {
|
||||||
sendResponse(event, {
|
sendResponse(event, {
|
||||||
success: true,
|
success: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue