diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-06-29 14:37:59 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-06-29 14:37:59 -0400 |
commit | 7b7e73fb9290a8084989a4219681c636670e7555 (patch) | |
tree | 5de4540861b954e2d3d43b8e19e2597114dacaa6 /model | |
parent | 0792eb18d535410b456f3cc569e243efb85a47b6 (diff) | |
download | chat-7b7e73fb9290a8084989a4219681c636670e7555.tar.gz chat-7b7e73fb9290a8084989a4219681c636670e7555.tar.bz2 chat-7b7e73fb9290a8084989a4219681c636670e7555.zip |
added team-wide and channel-wide mentions
Diffstat (limited to 'model')
-rw-r--r-- | model/user.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/model/user.go b/model/user.go index 794adcad4..ca62f3d72 100644 --- a/model/user.go +++ b/model/user.go @@ -148,9 +148,12 @@ func (u *User) SetDefaultNotifications() { u.NotifyProps["desktop"] = USER_NOTIFY_ALL u.NotifyProps["desktop_sound"] = "true" u.NotifyProps["mention_keys"] = u.Username - u.NotifyProps["first_name"] = "true" + u.NotifyProps["first_name"] = "false" + u.NotifyProps["all"] = "true" + u.NotifyProps["channel"] = "true" splitName := strings.Split(u.FullName, " ") if len(splitName) > 0 && splitName[0] != "" { + u.NotifyProps["first_name"] = "true" u.NotifyProps["mention_keys"] += "," + splitName[0] } } @@ -277,17 +280,17 @@ func ComparePassword(hash string, password string) bool { func IsUsernameValid(username string) bool { - var restrictedUsernames = []string { + var restrictedUsernames = []string{ BOT_USERNAME, "all", "channel", } - for _,restrictedUsername := range restrictedUsernames { + for _, restrictedUsername := range restrictedUsernames { if username == restrictedUsername { return false } - } + } return true } |