Merge branch 'release' into schedule-rc

This commit is contained in:
Sabe Jones
2024-06-14 10:18:16 -05:00
139 changed files with 3986 additions and 1770 deletions

View File

@@ -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 });

View File

@@ -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 = {};

View File

@@ -756,7 +756,7 @@ api.transferGems = {
]);
}
if (receiver.preferences.pushNotifications.giftedGems !== false) {
sendPushNotification(
await sendPushNotification(
receiver,
{
title: res.t('giftedGems', receiverLang),

View File

@@ -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',