summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-03-30 00:09:05 +0900
committerCorey Hulen <corey@hulen.com>2017-03-29 08:09:05 -0700
commit8a31718db11c803fa3b14f85c760ca9db6083670 (patch)
tree80a006c8994ef57ccd6d09fc7b0d00ebe6969f39 /model
parent64f80decaf4c20c643e43426e3c4285b2d501a90 (diff)
downloadchat-8a31718db11c803fa3b14f85c760ca9db6083670.tar.gz
chat-8a31718db11c803fa3b14f85c760ca9db6083670.tar.bz2
chat-8a31718db11c803fa3b14f85c760ca9db6083670.zip
APIv4 get /channels/{channel_id}/pinned (#5893)
Diffstat (limited to 'model')
-rw-r--r--model/client4.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 5259cb915..516a5d23c 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -1004,6 +1004,16 @@ func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats,
}
}
+// GetPinnedPosts gets a list of pinned posts.
+func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response) {
+ if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/pinned", etag); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return PostListFromJson(r.Body), BuildResponse(r)
+ }
+}
+
// GetPublicChannelsForTeam returns a list of public channels based on the provided team id string.
func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) (*ChannelList, *Response) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)