Merge pull request #106 from mattermost/mm-1119
fixes mm-1119 adds @all and @channel mention capabilites
Этот коммит содержится в:
@@ -36,6 +36,7 @@ module.exports = {
|
||||
SERVER_ACTION: null,
|
||||
VIEW_ACTION: null
|
||||
}),
|
||||
SPECIAL_MENTIONS: ['all', 'channel'],
|
||||
CHARACTER_LIMIT: 4000,
|
||||
IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png'],
|
||||
AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac'],
|
||||
|
||||
@@ -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);
|
||||
|
||||
Ссылка в новой задаче
Block a user