From 68af4886632ebf9bd9acd4641084bb708a1a91ef Mon Sep 17 00:00:00 2001 From: Dragory Date: Thu, 20 Sep 2018 22:03:28 +0300 Subject: [PATCH] Add mentionUserInThreadHeader option. Fixes #152 --- src/config.js | 1 + src/data/threads.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 54ad5c9..7c2e0bb 100644 --- a/src/config.js +++ b/src/config.js @@ -65,6 +65,7 @@ const defaultConfig = { "allowMove": false, "typingProxy": false, "typingProxyReverse": false, + "mentionUserInThreadHeader": false, "enableGreeting": false, "greetingMessage": null, diff --git a/src/data/threads.js b/src/data/threads.js index f4564f9..baa9abe 100644 --- a/src/data/threads.js +++ b/src/data/threads.js @@ -125,8 +125,12 @@ async function createNewThreadForUser(user, quiet = false) { const accountAge = humanizeDuration(Date.now() - user.createdAt, {largest: 2, round: true}); infoHeaderItems.push(`ACCOUNT AGE **${accountAge}**`); - // User id - infoHeaderItems.push(`ID **${user.id}**`); + // User id (and mention, if enabled) + if (config.mentionUserInThreadHeader) { + infoHeaderItems.push(`ID **${user.id}** (<@!${user.id}>)`); + } else { + infoHeaderItems.push(`ID **${user.id}**`); + } let infoHeader = infoHeaderItems.join(', ');