summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-27 11:22:19 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-27 11:22:19 -0400
commite1c09605dce8441e1523abc4c830062fdd457337 (patch)
treefab3563d01c1194e8dd3d873aeb37d7dd55f3b81 /model/client.go
parentea4beb7c4545e3ad6c7214a6a15ec66cc784f5ea (diff)
parent041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (diff)
downloadchat-e1c09605dce8441e1523abc4c830062fdd457337.tar.gz
chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.bz2
chat-e1c09605dce8441e1523abc4c830062fdd457337.zip
Merge pull request #469 from mattermost/mm-1699
MM-1699 Refactored post handling/updating on both the client and server
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go9
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