mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Merge branch 'release' into schedule-rc
This commit is contained in:
@@ -432,6 +432,7 @@ api.updateEmail = {
|
||||
}
|
||||
|
||||
user.auth.local.email = req.body.newEmail.toLowerCase();
|
||||
user.auth.local.passwordResetCode = undefined;
|
||||
await user.save();
|
||||
|
||||
return res.respond(200, { email: user.auth.local.email });
|
||||
|
||||
@@ -214,7 +214,7 @@ api.postChat = {
|
||||
});
|
||||
}
|
||||
|
||||
const newChatMessage = group.sendChat({
|
||||
const newChatMessage = await group.sendChat({
|
||||
message,
|
||||
user,
|
||||
flagCount,
|
||||
@@ -295,7 +295,7 @@ api.likeChat = {
|
||||
const group = await Group.getGroup({ user, groupId });
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
const message = await Chat.findOne({ _id: req.params.chatId }).exec();
|
||||
const message = await Chat.findOne({ _id: req.params.chatId, groupId: group._id }).exec();
|
||||
if (!message) throw new NotFound(res.t('messageGroupChatNotFound'));
|
||||
if (!message.likes) message.likes = {};
|
||||
|
||||
|
||||
@@ -756,7 +756,7 @@ api.transferGems = {
|
||||
]);
|
||||
}
|
||||
if (receiver.preferences.pushNotifications.giftedGems !== false) {
|
||||
sendPushNotification(
|
||||
await sendPushNotification(
|
||||
receiver,
|
||||
{
|
||||
title: res.t('giftedGems', receiverLang),
|
||||
|
||||
@@ -120,10 +120,10 @@ api.inviteToQuest = {
|
||||
|
||||
// send out invites
|
||||
const inviterVars = getUserInfo(user, ['name', 'email']);
|
||||
const membersToEmail = members.filter(member => {
|
||||
const membersToEmail = members.filter(async member => {
|
||||
// send push notifications while filtering members before sending emails
|
||||
if (member.preferences.pushNotifications.invitedQuest !== false) {
|
||||
sendPushNotification(
|
||||
await sendPushNotification(
|
||||
member,
|
||||
{
|
||||
title: quest.text(member.preferences.language),
|
||||
@@ -394,7 +394,7 @@ api.cancelQuest = {
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('cantCancelActiveQuest'));
|
||||
|
||||
const questName = questScrolls[group.quest.key].text('en');
|
||||
const newChatMessage = group.sendChat({
|
||||
const newChatMessage = await group.sendChat({
|
||||
message: `\`${user.profile.name} cancelled the party quest ${questName}.\``,
|
||||
info: {
|
||||
type: 'quest_cancel',
|
||||
@@ -456,7 +456,7 @@ api.abortQuest = {
|
||||
if (user._id !== group.leader && user._id !== group.quest.leader) throw new NotAuthorized(res.t('onlyLeaderAbortQuest'));
|
||||
|
||||
const questName = questScrolls[group.quest.key].text('en');
|
||||
const newChatMessage = group.sendChat({
|
||||
const newChatMessage = await group.sendChat({
|
||||
message: `\`${common.i18n.t('chatQuestAborted', { username: user.profile.name, questName }, 'en')}\``,
|
||||
info: {
|
||||
type: 'quest_abort',
|
||||
|
||||
Reference in New Issue
Block a user