Merge branch 'master' into advanced-permissions-phase-1

Этот коммит содержится в:
Martin Kraft
2018-03-23 09:08:49 -04:00
родитель 37f0e5e0eb 87762ae62e
Коммит 5fa1b35819
53 изменённых файлов: 2849 добавлений и 164 удалений

Просмотреть файл

@@ -318,6 +318,10 @@ func (c *Client4) GetAnalyticsRoute() string {
return fmt.Sprintf("/analytics")
}
func (c *Client4) GetTimezonesRoute() string {
return fmt.Sprintf(c.GetSystemRoute() + "/timezones")
}
func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError) {
return c.DoApiRequest(http.MethodGet, c.ApiUrl+url, "", etag)
}
@@ -3173,6 +3177,18 @@ func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response) {
}
}
// Timezone Section
// GetSupportedTimezone returns a page of supported timezones on the system.
func (c *Client4) GetSupportedTimezone() (SupportedTimezones, *Response) {
if r, err := c.DoApiGet(c.GetTimezonesRoute(), ""); err != nil {
return nil, BuildErrorResponse(r, err)
} else {
defer closeBody(r)
return TimezonesFromJson(r.Body), BuildResponse(r)
}
}
// Open Graph Metadata Section
// OpenGraph return the open graph metadata for a particular url if the site have the metadata