diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-09 13:59:19 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-17 15:13:24 -0400 |
commit | c09f1b9e4e5638080622ff9aa70735db382a16df (patch) | |
tree | a05d7d71d87cf436c30424a2f34e0cb0db9aaff1 /model | |
parent | 1d7509493e65324d1e81bf39c51a9d7c07335c56 (diff) | |
download | chat-c09f1b9e4e5638080622ff9aa70735db382a16df.tar.gz chat-c09f1b9e4e5638080622ff9aa70735db382a16df.tar.bz2 chat-c09f1b9e4e5638080622ff9aa70735db382a16df.zip |
Renamed FullName column in database to Nickname. Renamed all serverside references from FullName to Nickname.
Diffstat (limited to 'model')
-rw-r--r-- | model/channel_extra.go | 4 | ||||
-rw-r--r-- | model/user.go | 10 | ||||
-rw-r--r-- | model/user_test.go | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/model/channel_extra.go b/model/channel_extra.go index a5c9acf71..d1579f905 100644 --- a/model/channel_extra.go +++ b/model/channel_extra.go @@ -10,7 +10,7 @@ import ( type ExtraMember struct { Id string `json:"id"` - FullName string `json:"full_name"` + Nickname string `json:"nickname"` Email string `json:"email"` Roles string `json:"roles"` Username string `json:"username"` @@ -21,7 +21,7 @@ func (o *ExtraMember) Sanitize(options map[string]bool) { o.Email = "" } if len(options) == 0 || !options["fullname"] { - o.FullName = "" + o.Nickname = "" } } diff --git a/model/user.go b/model/user.go index c5a4d846d..88f8f718a 100644 --- a/model/user.go +++ b/model/user.go @@ -37,7 +37,7 @@ type User struct { AuthData string `json:"auth_data"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` - FullName string `json:"full_name"` + Nickname string `json:"nickname"` Roles string `json:"roles"` LastActivityAt int64 `json:"last_activity_at"` LastPingAt int64 `json:"last_ping_at"` @@ -82,8 +82,8 @@ func (u *User) IsValid() *AppError { return NewAppError("User.IsValid", "Invalid email", "user_id="+u.Id) } - if len(u.FullName) > 64 { - return NewAppError("User.IsValid", "Invalid full name", "user_id="+u.Id) + if len(u.Nickname) > 64 { + return NewAppError("User.IsValid", "Invalid nickname", "user_id="+u.Id) } return nil @@ -152,7 +152,7 @@ func (u *User) SetDefaultNotifications() { u.NotifyProps["first_name"] = "false" u.NotifyProps["all"] = "true" u.NotifyProps["channel"] = "true" - splitName := strings.Split(u.FullName, " ") + splitName := strings.Split(u.Nickname, " ") if len(splitName) > 0 && splitName[0] != "" { u.NotifyProps["first_name"] = "true" u.NotifyProps["mention_keys"] += "," + splitName[0] @@ -191,7 +191,7 @@ func (u *User) Sanitize(options map[string]bool) { u.Email = "" } if len(options) != 0 && !options["fullname"] { - u.FullName = "" + u.Nickname = "" } if len(options) != 0 && !options["skypeid"] { // TODO - fill in when SkypeId is added to user model diff --git a/model/user_test.go b/model/user_test.go index df9ac19c2..013bacc1c 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -80,12 +80,12 @@ func TestUserIsValid(t *testing.T) { } user.Email = "test@nowhere.com" - user.FullName = strings.Repeat("01234567890", 20) + user.Nickname = strings.Repeat("01234567890", 20) if err := user.IsValid(); err == nil { t.Fatal() } - user.FullName = "" + user.Nickname = "" if err := user.IsValid(); err != nil { t.Fatal(err) } |