diff options
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/model/user.go b/model/user.go index efe8f8db9..6fbdb09e8 100644 --- a/model/user.go +++ b/model/user.go @@ -96,6 +96,23 @@ type UserAuth struct { AuthService string `json:"auth_service,omitempty"` } +func (u *User) DeepCopy() *User { + copyUser := *u + if u.AuthData != nil { + copyUser.AuthData = NewString(*u.AuthData) + } + if u.Props != nil { + copyUser.Props = CopyStringMap(u.Props) + } + if u.NotifyProps != nil { + copyUser.NotifyProps = CopyStringMap(u.NotifyProps) + } + if u.Timezone != nil { + copyUser.Timezone = CopyStringMap(u.Timezone) + } + return ©User +} + // IsValid validates the user and returns an error if it isn't configured // correctly. func (u *User) IsValid() *AppError { |