summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-06-30 11:58:22 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-06-30 11:58:22 -0400
commita00b4e00adeacfbe59b523d46e566186631eab52 (patch)
tree83949f6e97ecac3c09084b06c943b1fdf33f8873 /model
parentae21685e357416dab708e304fd8d9c005b11278d (diff)
parent8be4df00b4d30c220d6f0d13734501c8c94e6495 (diff)
downloadchat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.gz
chat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.bz2
chat-a00b4e00adeacfbe59b523d46e566186631eab52.zip
Merge pull request #106 from mattermost/mm-1119
fixes mm-1119 adds @all and @channel mention capabilites
Diffstat (limited to 'model')
-rw-r--r--model/user.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/model/user.go b/model/user.go
index 794adcad4..18fbb0d2a 100644
--- a/model/user.go
+++ b/model/user.go
@@ -147,10 +147,13 @@ func (u *User) SetDefaultNotifications() {
u.NotifyProps["email"] = "true"
u.NotifyProps["desktop"] = USER_NOTIFY_ALL
u.NotifyProps["desktop_sound"] = "true"
- u.NotifyProps["mention_keys"] = u.Username
- u.NotifyProps["first_name"] = "true"
+ u.NotifyProps["mention_keys"] = u.Username + ",@" + u.Username
+ 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
}