diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-26 12:09:01 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-27 08:21:26 -0400 |
commit | 041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (patch) | |
tree | 37cc2ca9252b45f6f30ba4e88037a67a700ec0ad /model | |
parent | 8356e25f80bbba3040ceeda5732b8843b8e493c1 (diff) | |
download | chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.gz chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.bz2 chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.zip |
Refactored post handling/updating on both the client and server.
Diffstat (limited to 'model')
-rw-r--r-- | model/client.go | 9 |
1 files changed, 9 insertions, 0 deletions
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 |