diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-23 12:55:58 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-23 12:55:58 -0700 |
commit | 2b5b8f95ed9de37a15dc68c38c46a1da2bb1e160 (patch) | |
tree | d5bf8318dc82d96cd34b83481e1cc5c8289d170a /model/user.go | |
parent | 9e04909c0a3672d27c148c931d82b225cc86dfe5 (diff) | |
parent | 0170cfe604e6cfb430be0b6181243ca85a9ab27b (diff) | |
download | chat-2b5b8f95ed9de37a15dc68c38c46a1da2bb1e160.tar.gz chat-2b5b8f95ed9de37a15dc68c38c46a1da2bb1e160.tar.bz2 chat-2b5b8f95ed9de37a15dc68c38c46a1da2bb1e160.zip |
Merge branch 'master' into PLT-11-email
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 } |