diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-06-30 09:06:10 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-06-30 09:06:10 -0400 |
commit | f030476ff5f438b96d7282c37ad7a42ffc61ae85 (patch) | |
tree | 9e78f0cc7aece10d5716f6130722896934a4bc65 /web/react/utils | |
parent | 495b0e45235b646e7bb6aedf53004ee359b6887f (diff) | |
download | chat-f030476ff5f438b96d7282c37ad7a42ffc61ae85.tar.gz chat-f030476ff5f438b96d7282c37ad7a42ffc61ae85.tar.bz2 chat-f030476ff5f438b96d7282c37ad7a42ffc61ae85.zip |
@all and @channel now highlight like other mentions
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 75c583c8f..d50a044bc 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -421,10 +421,13 @@ module.exports.textToJsx = function(text, options) { highlightSearchClass = " search-highlight"; } - if (explicitMention && UserStore.getProfileByUsername(explicitMention[1])) { + if (explicitMention && + (UserStore.getProfileByUsername(explicitMention[1]) || + Constants.SPECIAL_MENTIONS.indexOf(explicitMention[1]) !== -1)) + { var name = explicitMention[1]; // do both a non-case sensitive and case senstive check - var mClass = (name.toLowerCase() in implicitKeywords || name in implicitKeywords) ? mentionClass : ""; + var mClass = (('@'+name.toLowerCase()) in implicitKeywords || ('@'+name) in implicitKeywords) ? mentionClass : ""; var suffix = word.match(puncEndRegex); var prefix = word.match(puncStartRegex); |