* Added @all

* Uncomment @all server side
Этот коммит содержится в:
David Lu
2016-06-04 11:21:50 -07:00
коммит произвёл Joram Wilander
родитель 6f0a7e4b13
Коммит f3825ba766
4 изменённых файлов: 17 добавлений и 13 удалений

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

@@ -537,9 +537,9 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
} }
//Add @all to keywords if user has them turned on //Add @all to keywords if user has them turned on
// if profile.NotifyProps["all"] == "true" { if profile.NotifyProps["all"] == "true" {
// keywordMap["@all"] = append(keywordMap["@all"], profile.Id) keywordMap["@all"] = append(keywordMap["@all"], profile.Id)
// } }
// Add @channel to keywords if user has them turned on // Add @channel to keywords if user has them turned on
if profile.NotifyProps["channel"] == "true" { if profile.NotifyProps["channel"] == "true" {

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

@@ -4,6 +4,7 @@
import React from 'react'; import React from 'react';
import SuggestionStore from 'stores/suggestion_store.jsx'; import SuggestionStore from 'stores/suggestion_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import UserStore from 'stores/user_store.jsx'; import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import Client from 'utils/web_client.jsx'; import Client from 'utils/web_client.jsx';
@@ -25,7 +26,10 @@ class AtMentionSuggestion extends Suggestion {
description = ( description = (
<FormattedMessage <FormattedMessage
id='suggestion.mention.all' id='suggestion.mention.all'
defaultMessage='Notifies everyone in the team' defaultMessage='Notifies everyone in the channel, use in {townsquare} to notify the whole team'
values={{
townsquare: ChannelStore.getByName('town-square').display_name
}}
/> />
); );
icon = <i className='mention__image fa fa-users fa-2x'/>; icon = <i className='mention__image fa fa-users fa-2x'/>;
@@ -97,10 +101,13 @@ export default class AtMentionProvider {
} }
if (!pretext.startsWith('/msg')) { if (!pretext.startsWith('/msg')) {
// add dummy users to represent the @channel special mention when not using the /msg command // add dummy users to represent the @channel and @all special mentions when not using the /msg command
if ('channel'.startsWith(usernamePrefix)) { if ('channel'.startsWith(usernamePrefix)) {
filtered.push({username: 'channel'}); filtered.push({username: 'channel'});
} }
if ('all'.startsWith(usernamePrefix)) {
filtered.push({username: 'all'});
}
} }
filtered = filtered.sort((a, b) => a.username.localeCompare(b.username)); filtered = filtered.sort((a, b) => a.username.localeCompare(b.username));

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

@@ -842,7 +842,7 @@ class NotificationsTab extends React.Component {
/> />
<FormattedMessage <FormattedMessage
id='user.settings.notifications.channelWide' id='user.settings.notifications.channelWide'
defaultMessage='Channel-wide mentions "@channel"' defaultMessage='Channel-wide mentions "@channel", "@all"'
/> />
</label> </label>
</div> </div>
@@ -896,12 +896,9 @@ class NotificationsTab extends React.Component {
keys.push('@' + user.username); keys.push('@' + user.username);
} }
// if (this.state.allKey) {
// keys.push('@all');
// }
if (this.state.channelKey) { if (this.state.channelKey) {
keys.push('@channel'); keys.push('@channel');
keys.push('@all');
} }
if (this.state.customKeys.length > 0) { if (this.state.customKeys.length > 0) {
keys = keys.concat(this.state.customKeys.split(',')); keys = keys.concat(this.state.customKeys.split(','));

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

@@ -1180,7 +1180,7 @@
"sso_signup.length_error": "Name must be 3 or more characters up to a maximum of 15", "sso_signup.length_error": "Name must be 3 or more characters up to a maximum of 15",
"sso_signup.teamName": "Enter name of new team", "sso_signup.teamName": "Enter name of new team",
"sso_signup.team_error": "Please enter a team name", "sso_signup.team_error": "Please enter a team name",
"suggestion.mention.all": "Notifies everyone in the team", "suggestion.mention.all": "Notifies everyone in the channel, use in {townsquare} to notify the whole team",
"suggestion.mention.channel": "Notifies everyone in the channel", "suggestion.mention.channel": "Notifies everyone in the channel",
"suggestion.search.private": "Private Groups", "suggestion.search.private": "Private Groups",
"suggestion.search.public": "Public Channels", "suggestion.search.public": "Public Channels",
@@ -1368,7 +1368,7 @@
"user.settings.notification.allActivity": "For all activity", "user.settings.notification.allActivity": "For all activity",
"user.settings.notification.push": "Mobile push notifications", "user.settings.notification.push": "Mobile push notifications",
"user.settings.notification.soundConfig": "Please configure notification sounds in your browser settings", "user.settings.notification.soundConfig": "Please configure notification sounds in your browser settings",
"user.settings.notifications.channelWide": "Channel-wide mentions \"@channel\"", "user.settings.notifications.channelWide": "Channel-wide mentions \"@channel\", \"@all\"",
"user.settings.notifications.close": "Close", "user.settings.notifications.close": "Close",
"user.settings.notifications.desktop": "Send desktop notifications", "user.settings.notifications.desktop": "Send desktop notifications",
"user.settings.notifications.desktopSounds": "Desktop notification sounds", "user.settings.notifications.desktopSounds": "Desktop notification sounds",