mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
v3 client: fix ability to send cards
This commit is contained in:
@@ -396,7 +396,10 @@ spells.special = {
|
||||
|
||||
if (!target.items.special.nyeReceived) target.items.special.nyeReceived = [];
|
||||
target.items.special.nyeReceived.push(user.profile.name);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
},
|
||||
},
|
||||
@@ -421,7 +424,10 @@ spells.special = {
|
||||
|
||||
if (!target.items.special.valentineReceived) target.items.special.valentineReceived = [];
|
||||
target.items.special.valentineReceived.push(user.profile.name);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
},
|
||||
},
|
||||
@@ -445,7 +451,10 @@ spells.special = {
|
||||
|
||||
if (!target.items.special.greetingReceived) target.items.special.greetingReceived = [];
|
||||
target.items.special.greetingReceived.push(user.profile.name);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
},
|
||||
},
|
||||
@@ -470,7 +479,10 @@ spells.special = {
|
||||
|
||||
if (!target.items.special.thankyouReceived) target.items.special.thankyouReceived = [];
|
||||
target.items.special.thankyouReceived.push(user.profile.name);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
},
|
||||
},
|
||||
@@ -492,9 +504,13 @@ spells.special = {
|
||||
u.achievements.birthday++;
|
||||
});
|
||||
}
|
||||
|
||||
if (!target.items.special.birthdayReceived) target.items.special.birthdayReceived = [];
|
||||
target.items.special.birthdayReceived.push(user.profile.name);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -70,6 +70,10 @@ angular.module('habitrpg')
|
||||
});
|
||||
}
|
||||
|
||||
function clearCards () {
|
||||
User.user._wrapped && User.set({'flags.cardReceived':false});
|
||||
}
|
||||
|
||||
return {
|
||||
getChat: getChat,
|
||||
postChat: postChat,
|
||||
@@ -80,8 +84,4 @@ angular.module('habitrpg')
|
||||
markChatSeen: markChatSeen,
|
||||
clearCards: clearCards,
|
||||
}
|
||||
|
||||
function clearCards() {
|
||||
User.user._wrapped && User.set({'flags.cardReceived':false});
|
||||
}
|
||||
}]);
|
||||
|
||||
@@ -327,8 +327,9 @@ api.seenChat = {
|
||||
let validationErrors = req.validationErrors();
|
||||
if (validationErrors) throw validationErrors;
|
||||
|
||||
let group = await Group.getGroup({user, groupId});
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
// Do not validate group existence, it doesn't really matter and make it works if the group gets deleted
|
||||
// let group = await Group.getGroup({user, groupId});
|
||||
// if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
let update = {$unset: {}};
|
||||
update.$unset[`newMessages.${groupId}`] = true;
|
||||
|
||||
Reference in New Issue
Block a user