Node.js based forum software built for the modern web
Merge branch 'master' into develop
Barış Soner Uşaklıbad238ef5310
diff --cc install/package.jsonindex e65b8700e3,c47c2db468..b55cefe407--- a/install/package.json+++ b/install/package.json@@@ -105,20 -104,20 +105,20 @@@"nodebb-plugin-2factor": "8.0.5","nodebb-plugin-composer-default": "11.0.8","nodebb-plugin-dbsearch": "7.0.0",- "nodebb-plugin-emoji": "6.0.14",+ "nodebb-plugin-emoji": "6.0.16","nodebb-plugin-emoji-android": "4.1.1",- "nodebb-plugin-link-preview": "2.2.8",- "nodebb-plugin-markdown": "13.2.6",+ "nodebb-plugin-link-preview": "2.2.9",+ "nodebb-plugin-markdown": "13.2.7","nodebb-plugin-mentions": "5.0.0",- "nodebb-plugin-spam-be-gone": "2.3.4",- "nodebb-plugin-web-push": "0.8.1",+ "nodebb-plugin-spam-be-gone": "2.3.5",+ "nodebb-plugin-web-push": "0.9.2","nodebb-rewards-essentials": "1.0.3","nodebb-theme-harmony": "3.1.14",- "nodebb-theme-lavender": "8.0.6",- "nodebb-theme-peace": "3.0.6",+ "nodebb-theme-lavender": "8.1.0",+ "nodebb-theme-peace": "3.1.2","nodebb-theme-persona": "15.1.8",- "nodebb-widget-essentials": "8.0.7",+ "nodebb-widget-essentials": "8.0.8",- "nodemailer": "9.0.3",+ "nodemailer": "9.0.4","nprogress": "0.2.0","passport": "0.7.0","passport-http-bearer": "1.0.1",diff --cc src/messaging/data.jsindex d767b1e7ea,f283a34b8d..40d0b2aca6--- a/src/messaging/data.js+++ b/src/messaging/data.js@@@ -136,11 -135,8 +136,11 @@@ module.exports = function (Messaging)const canView = await Messaging.canViewMessage(parentMids, roomId, uid);parentMids = parentMids.filter((mid, idx) => canView[idx]);- const parentMessages = await Messaging.getMessagesFields(parentMids, [- 'mid', 'fromuid', 'content', 'timestamp', 'deleted', 'system',+ const [parentMessages, { userLang }] = await Promise.all([+ Messaging.getMessagesFields(parentMids, [- 'mid', 'fromuid', 'content', 'timestamp', 'deleted',++ 'mid', 'fromuid', 'content', 'timestamp', 'deleted', 'system',+ ]),+ user.getSettings(uid),]);const parentUids = _.uniq(parentMessages.map(msg => msg && msg.fromuid));const usersMap = _.zipObject(@@@ -186,13 -181,11 +186,14 @@@msg.txContent = true;return;}- msg.content = await parseMessage(msg, uid, roomId, isNew);+ msg.content = await parseMessage(msg, uid, roomId, isNew, userLang);}));}- async function parseMessage(message, uid, roomId, isNew) {- if (message.system || !utils.isNumber(message.mid)) {+++ async function parseMessage(message, uid, roomId, isNew, userLang) {+ if (message.system) {- return await tx.translate(message.content, userLang);++ return await tx.translate(posts.sanitize(message.content), userLang);+ } else if (!utils.isNumber(message.mid)) {return posts.sanitize(message.content);}