fix: #12415, fix notification escaping for queued posts

This commit is contained in:
Barış Soner Uşaklı
2024-03-16 18:56:54 -04:00
parent 076403897d
commit 4787d013cf

View File

@@ -11,6 +11,7 @@ const topics = require('../topics');
const notifications = require('../notifications');
const utils = require('../utils');
const events = require('../events');
const translator = require('../translator');
const api = require('../api');
const sockets = require('.');
@@ -159,10 +160,13 @@ async function canEditQueue(socket, data, action) {
}
async function sendQueueNotification(type, targetUid, path, notificationText) {
const bodyShort = notificationText ?
translator.compile(`notifications:${type}`, notificationText) :
translator.compile(`notifications:${type}`);
const notifData = {
type: type,
nid: `${type}-${targetUid}-${path}`,
bodyShort: notificationText ? `[[notifications:${type}, ${notificationText}]]` : `[[notifications:${type}]]`,
bodyShort: bodyShort,
path: path,
};
if (parseInt(meta.config.postQueueNotificationUid, 10) > 0) {