diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-23 14:38:34 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-23 14:38:34 -0700 |
commit | 7f3bfdbe0c2442714bb5a14adfdeac1576123601 (patch) | |
tree | 44962a914b86cf66a1da49300f12986db49f010e /model/user.go | |
parent | 1626a6de6f16ba0878160b0a7eae9f49b8d34d4f (diff) | |
parent | c7c644874e98db0ae83c5a44ec50ff811d9b3f46 (diff) | |
download | chat-7f3bfdbe0c2442714bb5a14adfdeac1576123601.tar.gz chat-7f3bfdbe0c2442714bb5a14adfdeac1576123601.tar.bz2 chat-7f3bfdbe0c2442714bb5a14adfdeac1576123601.zip |
Fixing merge
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 5 |
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 } |