Node.js based forum software built for the modern web
feat: send topic title into user-posted-topic-with-tag notification type, unbold tags in copy
Julian Lam1611b17bd7fb
diff --git a/public/language/en-GB/notifications.json b/public/language/en-GB/notifications.jsonindex 2782fdaff9..0820bfeceb 100644--- a/public/language/en-GB/notifications.json+++ b/public/language/en-GB/notifications.json@@ -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>",diff --git a/src/topics/tags.js b/src/topics/tags.jsindex daab4e5f77..540bd314bd 100644--- a/src/topics/tags.js+++ b/src/topics/tags.js@@ -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({