Merge branch 'develop' into sabrecat/unsociable

This commit is contained in:
SabreCat
2023-07-25 15:17:13 -05:00
110 changed files with 2137 additions and 922 deletions

View File

@@ -580,9 +580,10 @@ api.joinGroup = {
if (userPreviousParty) await userPreviousParty.leave(user);
}
}
// Clear all invitations of new user
// Clear all invitations of new user and reset looking for party state
user.invitations.parties = [];
user.invitations.party = {};
user.party.seeking = null;
// invite new user to pending quest
if (group.quest.key && !group.quest.active) {
@@ -1383,6 +1384,7 @@ api.getLookingForParty = {
const seekers = await User
.find({
'party.seeking': { $exists: true },
'invitations.party.id': { $exists: false },
'auth.timestamps.loggedin': {
$gt: moment().subtract(7, 'days').toDate(),
},
@@ -1398,7 +1400,6 @@ api.getLookingForParty = {
const filteredSeekers = seekers.filter(seeker => {
if (seeker.party._id) return false;
if (seeker.invitations.party.id) return false;
if (seeker.flags.chatRevoked) return false;
if (seeker.auth.blocked) return false;
if (seeker.inbox.blocks.indexOf(user._id) !== -1) return false;