From 1ab7034574de2229d3cfc49391e6579db37a3064 Mon Sep 17 00:00:00 2001 From: Antti Ahti Date: Wed, 14 Oct 2015 18:27:03 +0300 Subject: Use team display name in team switcher menu - /teams/find_teams returns team objects instead of just team names - use display_name in UI instead of name in the team switch menu --- model/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'model') diff --git a/model/client.go b/model/client.go index 77b0aaad2..19c99df72 100644 --- a/model/client.go +++ b/model/client.go @@ -185,7 +185,7 @@ func (c *Client) FindTeams(email string) (*Result, *AppError) { } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ArrayFromJson(r.Body)}, nil + r.Header.Get(HEADER_ETAG_SERVER), TeamMapFromJson(r.Body)}, nil } } -- cgit v1.2.3-1-g7c22 From 8f96db4d0b52d0701398703364948e659f3ce34f Mon Sep 17 00:00:00 2001 From: Antti Ahti Date: Wed, 14 Oct 2015 19:27:19 +0300 Subject: Sanitize team data We don't want to expose sensitive data that might pose a security risk. --- model/team.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'model') diff --git a/model/team.go b/model/team.go index c0f6524cd..584c78f8d 100644 --- a/model/team.go +++ b/model/team.go @@ -219,3 +219,9 @@ func CleanTeamName(s string) string { func (o *Team) PreExport() { } + +func (o *Team) Sanitize() { + o.Email = "" + o.Type = "" + o.AllowedDomains = "" +} -- cgit v1.2.3-1-g7c22 From 327b0b5a2119ae888c812f682b3934061b8f59bf Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 15 Oct 2015 15:09:40 -0400 Subject: Added an initial call to get all user preferences on page load --- model/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model') diff --git a/model/client.go b/model/client.go index 77b0aaad2..ca1e37479 100644 --- a/model/client.go +++ b/model/client.go @@ -844,6 +844,15 @@ func (c *Client) ListIncomingWebhooks() (*Result, *AppError) { } } +func (c *Client) GetAllPreferences() (*Result, *AppError) { + if r, err := c.DoApiGet("/preferences/", "", ""); err != nil { + return nil, err + } else { + preferences, _ := PreferencesFromJson(r.Body) + return &Result{r.Header.Get(HEADER_REQUEST_ID), r.Header.Get(HEADER_ETAG_SERVER), preferences}, nil + } +} + func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError) { if r, err := c.DoApiPost("/preferences/save", preferences.ToJson()); err != nil { return nil, err -- cgit v1.2.3-1-g7c22 From 58c33f01d563d729e5fa5f8f037369210f8a1962 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 16 Oct 2015 08:16:34 -0400 Subject: Add default username and icon to incoming webhooks. --- model/webhook.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'model') diff --git a/model/webhook.go b/model/webhook.go index 3bf034908..9b9969b96 100644 --- a/model/webhook.go +++ b/model/webhook.go @@ -8,6 +8,11 @@ import ( "io" ) +const ( + DEFAULT_WEBHOOK_USERNAME = "webhook" + DEFAULT_WEBHOOK_ICON = "/static/images/webhook_icon.jpg" +) + type IncomingWebhook struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` -- cgit v1.2.3-1-g7c22