Fix 'new thread' message being shown in thread header when mentionRole is disabled

cshd
Dragory 2020-11-01 20:58:06 +02:00
parent 91d07dda8a
commit a8580e1ef8
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 3 additions and 2 deletions

View File

@ -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(),
});
}