Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function getSubscribedRoomsForUserWithDetails(
u: { _id: uid },
} of subscribersCursor) {
// If we already changed the owner or this subscription is for the user we are removing, then don't try to give it ownership
if (roomData.shouldChangeOwner || uid === userId) {
if (uid === userId) {
continue;
}
const newOwner = await Users.findOneActiveById(uid, { projection: { _id: 1 } });
Expand All @@ -61,6 +61,7 @@ export async function getSubscribedRoomsForUserWithDetails(

roomData.newOwner = uid;
roomData.shouldChangeOwner = true;
break;
}

// If there's no subscriber available to be the new owner and it's not a public room, we can remove it.
Expand Down
Loading