diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-06-30 11:58:22 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-06-30 11:58:22 -0400 |
commit | a00b4e00adeacfbe59b523d46e566186631eab52 (patch) | |
tree | 83949f6e97ecac3c09084b06c943b1fdf33f8873 /web/react/utils/utils.jsx | |
parent | ae21685e357416dab708e304fd8d9c005b11278d (diff) | |
parent | 8be4df00b4d30c220d6f0d13734501c8c94e6495 (diff) | |
download | chat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.gz chat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.bz2 chat-a00b4e00adeacfbe59b523d46e566186631eab52.zip |
Merge pull request #106 from mattermost/mm-1119
fixes mm-1119 adds @all and @channel mention capabilites
Diffstat (limited to 'web/react/utils/utils.jsx')
-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); |