Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ScalarMessaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ All actions can return an error response instead of the response outlined below.

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:
- room_id is the room to invite the user into.
Expand Down Expand Up @@ -295,9 +295,9 @@ function inviteUser(event: MessageEvent<any>, roomId: string, userId: string): v
}
const room = client.getRoom(roomId);
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);
if (member && member.membership === "invite") {
if (member && ["join", "invite"].includes(member.membership)) {
sendResponse(event, {
success: true,
});
Expand Down