From e4a15076f458be1416de25b2c45578975b914de5 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 23 Sep 2015 10:12:40 -0400 Subject: Implement UI theme colors. --- model/user.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'model') 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 } -- cgit v1.2.3-1-g7c22