From a8580e1ef8a556fdcf7e91ce8b119559967ce448 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 1 Nov 2020 20:58:06 +0200 Subject: [PATCH] Fix 'new thread' message being shown in thread header when mentionRole is disabled --- src/data/threads.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/threads.js b/src/data/threads.js index e30a76f..6ec50a0 100644 --- a/src/data/threads.js +++ b/src/data/threads.js @@ -192,9 +192,10 @@ async function createNewThreadForUser(user, opts = {}) { if (! quiet) { // Ping moderators of the new thread - if (config.mentionRole) { + const staffMention = utils.getInboxMention(); + if (staffMention.trim() !== "") { await newThread.postNonLogMessage({ - content: `${utils.getInboxMention()}New modmail thread (${newThread.user_name})`, + content: `${staffMention}New modmail thread (${newThread.user_name})`, allowedMentions: utils.getInboxMentionAllowedMentions(), }); }