diff options
author | Corey Hulen <corey@hulen.com> | 2016-05-04 06:31:42 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-04 09:31:42 -0400 |
commit | 6611229cd7bd3cdfc0082c0a581145aaac0ab322 (patch) | |
tree | db6670a8c2716179bfe6e07b82588d83d3afb6bd /model | |
parent | 6b06f49e8910ed44f619adad15ab268758312852 (diff) | |
download | chat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.tar.gz chat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.tar.bz2 chat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.zip |
PLT-2707 Adding option to show DM list from all of server (#2871)
* PLT-2707 Adding option to show DM list from all of server
* Fixing loc
Diffstat (limited to 'model')
-rw-r--r-- | model/client.go | 8 | ||||
-rw-r--r-- | model/config.go | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/model/client.go b/model/client.go index 9285368c4..804b0d218 100644 --- a/model/client.go +++ b/model/client.go @@ -321,8 +321,8 @@ func (c *Client) GetMe(etag string) (*Result, *AppError) { } } -func (c *Client) GetProfiles(teamId string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/profiles/"+teamId, "", etag); err != nil { +func (c *Client) GetProfilesForDirectMessageList(teamId string) (*Result, *AppError) { + if r, err := c.DoApiGet("/users/profiles_for_dm_list/"+teamId, "", ""); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), @@ -330,8 +330,8 @@ func (c *Client) GetProfiles(teamId string, etag string) (*Result, *AppError) { } } -func (c *Client) GetProfilesForTeam(teamId string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/profiles/"+teamId+"?skip_direct=true", "", etag); err != nil { +func (c *Client) GetProfiles(teamId string, etag string) (*Result, *AppError) { + if r, err := c.DoApiGet("/users/profiles/"+teamId, "", etag); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), diff --git a/model/config.go b/model/config.go index b7c939202..872a5a68f 100644 --- a/model/config.go +++ b/model/config.go @@ -29,6 +29,9 @@ const ( GENERIC_NOTIFICATION = "generic" FULL_NOTIFICATION = "full" + DIRECT_MESSAGE_ANY = "any" + DIRECT_MESSAGE_TEAM = "team" + FAKE_SETTING = "********************************" ) @@ -162,6 +165,7 @@ type TeamSettings struct { RestrictTeamNames *bool EnableCustomBrand *bool CustomBrandText *string + RestrictDirectMessage *string } type LdapSettings struct { @@ -315,6 +319,11 @@ func (o *Config) SetDefaults() { *o.TeamSettings.EnableOpenServer = false } + if o.TeamSettings.RestrictDirectMessage == nil { + o.TeamSettings.RestrictDirectMessage = new(string) + *o.TeamSettings.RestrictDirectMessage = DIRECT_MESSAGE_ANY + } + if o.EmailSettings.EnableSignInWithEmail == nil { o.EmailSettings.EnableSignInWithEmail = new(bool) @@ -520,6 +529,10 @@ func (o *Config) IsValid() *AppError { return NewLocAppError("Config.IsValid", "model.config.is_valid.max_users.app_error", nil, "") } + if !(*o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_ANY || *o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_TEAM) { + return NewLocAppError("Config.IsValid", "model.config.is_valid.restrict_direct_message.app_error", nil, "") + } + if len(o.SqlSettings.AtRestEncryptKey) < 32 { return NewLocAppError("Config.IsValid", "model.config.is_valid.encrypt_sql.app_error", nil, "") } |