mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Fix sending private messages
This commit is contained in:
@@ -633,7 +633,7 @@ api.sendPrivateMessage = {
|
|||||||
if (validationErrors) throw validationErrors;
|
if (validationErrors) throw validationErrors;
|
||||||
|
|
||||||
const sender = res.locals.user;
|
const sender = res.locals.user;
|
||||||
const message = await highlightMentions(req.body.message);
|
const message = (await highlightMentions(req.body.message))[0];
|
||||||
const receiver = await User.findById(req.body.toUserId).exec();
|
const receiver = await User.findById(req.body.toUserId).exec();
|
||||||
if (!receiver) throw new NotFound(res.t('userNotFound'));
|
if (!receiver) throw new NotFound(res.t('userNotFound'));
|
||||||
if (!receiver.flags.verifiedUsername) delete receiver.auth.local.username;
|
if (!receiver.flags.verifiedUsername) delete receiver.auth.local.username;
|
||||||
|
|||||||
Reference in New Issue
Block a user