diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-26 22:11:22 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-26 22:11:22 -0700 |
commit | e22b9f53034280cd3b730c03520469dca4046484 (patch) | |
tree | 7d41186a0e41ee40e1efc9fa23a23ab229242555 /model | |
parent | 101497ec091ddac3d311b5489d7e5097cafd7ed1 (diff) | |
download | chat-e22b9f53034280cd3b730c03520469dca4046484.tar.gz chat-e22b9f53034280cd3b730c03520469dca4046484.tar.bz2 chat-e22b9f53034280cd3b730c03520469dca4046484.zip |
Adding new fields to team model
Diffstat (limited to 'model')
-rw-r--r-- | model/team.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/model/team.go b/model/team.go index 9da2cd5b2..7f301b71c 100644 --- a/model/team.go +++ b/model/team.go @@ -17,16 +17,19 @@ const ( ) type Team struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - DisplayName string `json:"display_name"` - Name string `json:"name"` - Email string `json:"email"` - Type string `json:"type"` - CompanyName string `json:"company_name"` - AllowedDomains string `json:"allowed_domains"` + Id string `json:"id"` + CreateAt int64 `json:"create_at"` + UpdateAt int64 `json:"update_at"` + DeleteAt int64 `json:"delete_at"` + DisplayName string `json:"display_name"` + Name string `json:"name"` + Email string `json:"email"` + Type string `json:"type"` + CompanyName string `json:"company_name"` + AllowedDomains string `json:"allowed_domains"` + InviteId string `json:"invite_id"` + AllowOpenInvite bool `json:"allow_open_invite"` + AllowTeamListing bool `json:"allow_team_listing"` } type Invites struct { @@ -147,6 +150,10 @@ func (o *Team) IsValid(restrictTeamNames bool) *AppError { return NewAppError("Team.IsValid", "Invalid allowed domains", "id="+o.Id) } + if len(o.InviteId) > 0 && len(o.InviteId) != 26 { + return NewAppError("Team.IsValid", "Invalid inviate Id", "") + } + return nil } |