PLT-2408 Adds here mention for online users (#3619)

* Added @here mention that notifies online users

* Fixed existing race condition that would sometime cause clients to miss mention count changes

* Added missing localization strings

* Prevent @here from mentioning the user who posted it
Этот коммит содержится в:
Joram Wilander
2016-07-21 10:00:09 -04:00
коммит произвёл GitHub
родитель f0e9ec2dd1
Коммит bfa04c0ab0
10 изменённых файлов: 96 добавлений и 13 удалений

Просмотреть файл

@@ -43,6 +43,15 @@ class AtMentionSuggestion extends Suggestion {
/>
);
icon = <i className='mention__image fa fa-users fa-2x'/>;
} else if (user.username === 'here') {
username = 'here';
description = (
<FormattedMessage
id='suggestion.mention.here'
defaultMessage='Notifies everyone in the channel and online'
/>
);
icon = <i className='mention__image fa fa-users fa-2x'/>;
} else {
username = user.username;
@@ -126,6 +135,9 @@ export default class AtMentionProvider {
if ('all'.startsWith(prefix)) {
filtered.push({username: 'all'});
}
if ('here'.startsWith(prefix)) {
filtered.push({username: 'here'});
}
}
filtered.sort((a, b) => {