mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Merge branch 'release' into develop
This commit is contained in:
@@ -127,10 +127,6 @@ api.createGroup = {
|
||||
user.achievements.joinedGuild = true;
|
||||
user.addNotification('GUILD_JOINED_ACHIEVEMENT');
|
||||
}
|
||||
if (user._ABtests && user._ABtests.guildReminder && user._ABtests.counter !== -1) {
|
||||
user._ABtests.counter = -1;
|
||||
user.markModified('_ABtests');
|
||||
}
|
||||
} else {
|
||||
if (group.privacy !== 'private') throw new NotAuthorized(res.t('partyMustbePrivate'));
|
||||
if (user.party._id) throw new NotAuthorized(res.t('messageGroupAlreadyInParty'));
|
||||
@@ -570,10 +566,6 @@ api.joinGroup = {
|
||||
user.achievements.joinedGuild = true;
|
||||
user.addNotification('GUILD_JOINED_ACHIEVEMENT');
|
||||
}
|
||||
if (user._ABtests && user._ABtests.guildReminder && user._ABtests.counter !== -1) {
|
||||
user._ABtests.counter = -1;
|
||||
user.markModified('_ABtests');
|
||||
}
|
||||
}
|
||||
if (!isUserInvited) throw new NotAuthorized(res.t('messageGroupRequiresInvite'));
|
||||
|
||||
|
||||
@@ -630,18 +630,6 @@ api.scoreTask = {
|
||||
|
||||
setNextDue(task, user);
|
||||
|
||||
if (user._ABtests && user._ABtests.guildReminder && user._ABtests.counter !== -1) {
|
||||
user._ABtests.counter++;
|
||||
if (user._ABtests.counter > 1) {
|
||||
if (user._ABtests.guildReminder.indexOf('timing1') !== -1 || user._ABtests.counter > 4) {
|
||||
user._ABtests.counter = -1;
|
||||
let textVariant = user._ABtests.guildReminder.indexOf('text2');
|
||||
user.addNotification('GUILD_PROMPT', {textVariant});
|
||||
}
|
||||
}
|
||||
user.markModified('_ABtests');
|
||||
}
|
||||
|
||||
let promises = [
|
||||
user.save(),
|
||||
task.save(),
|
||||
|
||||
Reference in New Issue
Block a user