Merge branch 'develop' into client-monorepo

This commit is contained in:
Matteo Pagliazzi
2019-10-18 20:26:12 +02:00
17 changed files with 292 additions and 45 deletions

View File

@@ -21,6 +21,7 @@ import {
import { sendNotification as sendPushNotification } from '../../libs/pushNotifications';
import common from '../../../common';
import { sentMessage } from '../../libs/inbox';
import { highlightMentions } from '../../libs/highlightMentions';
const { achievements } = common;
@@ -676,7 +677,7 @@ api.sendPrivateMessage = {
if (validationErrors) throw validationErrors;
const sender = res.locals.user;
const { message } = req.body;
const message = (await highlightMentions(req.body.message))[0];
const receiver = await User.findById(req.body.toUserId).exec();
if (!receiver) throw new NotFound(res.t('userNotFound'));