summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-09-23 10:12:40 -0400
committerJoramWilander <jwawilander@gmail.com>2015-09-23 10:12:40 -0400
commite4a15076f458be1416de25b2c45578975b914de5 (patch)
tree0c8a91d17ee2546ee9de969ede2e979c5a4f5a52 /model/user.go
parent0391e5fe96d922f1e4a6ca2418a871ba1e88c9d2 (diff)
downloadchat-e4a15076f458be1416de25b2c45578975b914de5.tar.gz
chat-e4a15076f458be1416de25b2c45578975b914de5.tar.bz2
chat-e4a15076f458be1416de25b2c45578975b914de5.zip
Implement UI theme colors.
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/model/user.go b/model/user.go
index fdc519b99..3a2c9d56c 100644
--- a/model/user.go
+++ b/model/user.go
@@ -47,6 +47,7 @@ type User struct {
AllowMarketing bool `json:"allow_marketing"`
Props StringMap `json:"props"`
NotifyProps StringMap `json:"notify_props"`
+ ThemeProps StringMap `json:"theme_props"`
LastPasswordUpdate int64 `json:"last_password_update"`
LastPictureUpdate int64 `json:"last_picture_update"`
FailedAttempts int `json:"failed_attempts"`
@@ -108,6 +109,10 @@ func (u *User) IsValid() *AppError {
return NewAppError("User.IsValid", "Invalid user, password and auth data cannot both be set", "user_id="+u.Id)
}
+ if len(u.ThemeProps) > 2000 {
+ return NewAppError("User.IsValid", "Invalid theme", "user_id="+u.Id)
+ }
+
return nil
}