From 041d89b85a22b0a498a4176d0d26fd5dc84c33f9 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 26 Aug 2015 12:09:01 -0400 Subject: Refactored post handling/updating on both the client and server. --- model/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model') diff --git a/model/client.go b/model/client.go index 9fcb06cf8..c355b90f5 100644 --- a/model/client.go +++ b/model/client.go @@ -522,6 +522,15 @@ func (c *Client) GetPosts(channelId string, offset int, limit int, etag string) } } +func (c *Client) GetPostsSince(channelId string, time int64) (*Result, *AppError) { + if r, err := c.DoGet(fmt.Sprintf("/channels/%v/posts/%v", channelId, time), "", ""); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil + } +} + func (c *Client) GetPost(channelId string, postId string, etag string) (*Result, *AppError) { if r, err := c.DoGet(fmt.Sprintf("/channels/%v/post/%v", channelId, postId), "", etag); err != nil { return nil, err -- cgit v1.2.3-1-g7c22