Allow Users to be notified using @all, @channel, and their first name when other notifications are disabled

Этот коммит содержится в:
hmhealey
2015-07-13 15:43:05 -04:00
родитель 079538d9e7
Коммит e737ec3eb5
2 изменённых файлов: 11 добавлений и 13 удалений

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

@@ -298,11 +298,11 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
for _, k := range splitKeys { for _, k := range splitKeys {
keywordMap[k] = append(keywordMap[strings.ToLower(k)], profile.Id) keywordMap[k] = append(keywordMap[strings.ToLower(k)], profile.Id)
} }
}
// If turned on, add the user's case sensitive first name // If turned on, add the user's case sensitive first name
if profile.NotifyProps["first_name"] == "true" { if profile.NotifyProps["first_name"] == "true" {
keywordMap[profile.FirstName] = append(keywordMap[profile.FirstName], profile.Id) keywordMap[profile.FirstName] = append(keywordMap[profile.FirstName], profile.Id)
}
} }
// Add @all to keywords if user has them turned on // Add @all to keywords if user has them turned on

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

@@ -177,17 +177,15 @@ var UserStore = assign({}, EventEmitter.prototype, {
}, },
getCurrentMentionKeys: function() { getCurrentMentionKeys: function() {
var user = this.getCurrentUser(); var user = this.getCurrentUser();
if (user && user.notify_props && user.notify_props.mention_keys) {
var keys = user.notify_props.mention_keys.split(',');
if (user.first_name && user.notify_props.first_name === "true") keys.push(user.first_name); var keys = [];
if (user.notify_props.all === "true") keys.push('@all');
if (user.notify_props.channel === "true") keys.push('@channel');
return keys; if (user.notify_props && user.notify_props.mention_keys) keys = keys.concat(user.notify_props.mention_keys.split(','));
} else { if (user.first_name && user.notify_props.first_name === "true") keys.push(user.first_name);
return []; if (user.notify_props.all === "true") keys.push('@all');
} if (user.notify_props.channel === "true") keys.push('@channel');
return keys;
}, },
getLastVersion: function() { getLastVersion: function() {
return BrowserStore.getItem("last_version", ''); return BrowserStore.getItem("last_version", '');