added team-wide and channel-wide mentions
Этот коммит содержится в:
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user