Skip to content

Commit 987728a

Browse files
regression: server not rejecting user's attempts to call themselves (RocketChat#40229)
1 parent 918e0b0 commit 987728a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

apps/meteor/server/services/media-call/service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ export class MediaCallService extends ServiceClassInternal implements IMediaCall
335335
}
336336

337337
private async getRoomIdForInternalCall(call: IMediaCall): Promise<IRoom> {
338-
const room = await Rooms.findOneDirectRoomContainingAllUserIDs(call.uids);
338+
const uniqueUids = [...new Set(call.uids)];
339+
340+
const room = await Rooms.findOneDirectRoomContainingAllUserIDs(uniqueUids);
339341
if (room) {
340342
return room;
341343
}

ee/packages/media-calls/src/internal/InternalCallProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export class InternalCallProvider extends BaseCallProvider {
1313
throw new CallRejectedError('unsupported');
1414
}
1515

16+
if (params.caller.id === params.callee.id) {
17+
throw new CallRejectedError('unsupported');
18+
}
19+
1620
if (await MediaCalls.hasUnfinishedCallsByUid(params.caller.id, params.parentCallId)) {
1721
throw new CallRejectedError('busy');
1822
}

0 commit comments

Comments
 (0)