mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: send topic title into user-posted-topic-with-tag notification type, unbold tags in copy
This commit is contained in:
@@ -57,10 +57,10 @@
|
||||
"user-posted-topic": "<strong>%1</strong> has posted a new topic: <strong>%2</strong>",
|
||||
"user-edited-post" : "<strong>%1</strong> has edited a post in <strong>%2</strong>",
|
||||
|
||||
"user-posted-topic-with-tag": "<strong>%1</strong> has posted a new topic with tag <strong>%2</strong>",
|
||||
"user-posted-topic-with-tag-dual": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong> and <strong>%3</strong>",
|
||||
"user-posted-topic-with-tag-triple": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong>, <strong>%3</strong> and <strong>%4</strong>",
|
||||
"user-posted-topic-with-tag-multiple": "<strong>%1</strong> has posted a new topic with tags <strong>%2</strong>",
|
||||
"user-posted-topic-with-tag": "<strong>%1</strong> has posted <strong>%2</strong> (tagged %3)",
|
||||
"user-posted-topic-with-tag-dual": "<strong>%1</strong> has posted <strong>%2</strong> (tagged %3 and %4)",
|
||||
"user-posted-topic-with-tag-triple": "<strong>%1</strong> has posted <strong>%2</strong> (tagged %3, %4, and %5)",
|
||||
"user-posted-topic-with-tag-multiple": "<strong>%1</strong> has posted <strong>%2</strong> (tagged %3)",
|
||||
|
||||
"user-posted-topic-in-category": "<strong>%1</strong> has posted a new topic in <strong>%2</strong>",
|
||||
|
||||
|
||||
@@ -588,6 +588,7 @@ module.exports = function (Topics) {
|
||||
};
|
||||
|
||||
Topics.notifyTagFollowers = async function (postData, exceptUid) {
|
||||
console.log();
|
||||
let { tags } = postData.topic;
|
||||
if (!tags.length) {
|
||||
return;
|
||||
@@ -609,13 +610,13 @@ module.exports = function (Topics) {
|
||||
const { displayname } = postData.user;
|
||||
|
||||
const notifBase = 'notifications:user-posted-topic-with-tag';
|
||||
let bodyShort = translator.compile(notifBase, displayname, tags[0]);
|
||||
let bodyShort = translator.compile(notifBase, displayname, postData.topic.title, tags[0]);
|
||||
if (tags.length === 2) {
|
||||
bodyShort = translator.compile(`${notifBase}-dual`, displayname, tags[0], tags[1]);
|
||||
bodyShort = translator.compile(`${notifBase}-dual`, displayname, postData.topic.title, tags[0], tags[1]);
|
||||
} else if (tags.length === 3) {
|
||||
bodyShort = translator.compile(`${notifBase}-triple`, displayname, tags[0], tags[1], tags[2]);
|
||||
bodyShort = translator.compile(`${notifBase}-triple`, displayname, postData.topic.title, tags[0], tags[1], tags[2]);
|
||||
} else if (tags.length > 3) {
|
||||
bodyShort = translator.compile(`${notifBase}-multiple`, displayname, tags.join(', '));
|
||||
bodyShort = translator.compile(`${notifBase}-multiple`, displayname, postData.topic.title, tags.join(', '));
|
||||
}
|
||||
|
||||
const notification = await notifications.create({
|
||||
|
||||
Reference in New Issue
Block a user