Skip to content

Commit c1a136c

Browse files
committed
remove unused user check on addUsersToRoomMethod
1 parent 3c9f75e commit c1a136c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

apps/meteor/app/lib/server/methods/addUsersToRoom.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const addUsersToRoomMethod = async (userId: string, data: { rid: string;
8080
await Promise.all(
8181
data.users.map(async (username) => {
8282
const newUser = await Users.findOneByUsernameIgnoringCase(username);
83-
8483
if (!newUser) {
8584
throw new Meteor.Error('error-user-not-found', 'User not found', {
8685
method: 'addUsersToRoom',
@@ -93,12 +92,7 @@ export const addUsersToRoomMethod = async (userId: string, data: { rid: string;
9392
});
9493
}
9594

96-
if (!newUser && !isUserNativeFederated(newUser)) {
97-
throw new Meteor.Error('error-invalid-username', 'Invalid username', {
98-
method: 'addUsersToRoom',
99-
});
100-
}
101-
const subscription = newUser && (await Subscriptions.findOneByRoomIdAndUserId(data.rid, newUser._id));
95+
const subscription = await Subscriptions.findOneByRoomIdAndUserId(data.rid, newUser._id);
10296
if (!subscription) {
10397
await addUserToRoom(data.rid, newUser || username, user);
10498
} else {

0 commit comments

Comments
 (0)