From 8da1368a0b1be76dcf128e486f197f4a0654f941 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 25 Mar 2025 08:05:59 +0900 Subject: fix(backend): 既存のルームメンバーを改めて招待できないように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/ChatService.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/backend/src') diff --git a/packages/backend/src/core/ChatService.ts b/packages/backend/src/core/ChatService.ts index eece5d0da3..57e33af107 100644 --- a/packages/backend/src/core/ChatService.ts +++ b/packages/backend/src/core/ChatService.ts @@ -518,6 +518,10 @@ export class ChatService { const room = await this.chatRoomsRepository.findOneByOrFail({ id: roomId, ownerId: inviterId }); + if (await this.isRoomMember(room, inviteeId)) { + throw new Error('already member'); + } + const existingInvitation = await this.chatRoomInvitationsRepository.findOneBy({ roomId, userId: inviteeId }); if (existingInvitation) { throw new Error('already invited'); -- cgit v1.2.3-freya