summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-04 11:38:09 -0400
committerenahum <nahumhbl@gmail.com>2016-08-04 10:38:09 -0500
commit0184d6059bb1943fb74bf33d1d200a423c5bf5e6 (patch)
tree4b8480d65d5ec181b372a09f946bb7649809a467 /model/client.go
parent9b50b5028391ee29922ad5549b785ac2312be368 (diff)
downloadchat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.gz
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.bz2
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.zip
PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality * UI Improvements to flags (#3697) * Added flag functionality for mobile * Updating flagged text (#3699) * Add back button to RHS thread when coming from flagged posts * Updating position of flags (#3708) * Plt 3506 - Reverting flag position (#3724) * Revert "Updating position of flags (#3708)" This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58. * Fixing the icon in search * Help text and white space improvements (#3730) * Updatng help text and some white spacing. * Updating help text
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go
index cad551613..b9a5d8830 100644
--- a/model/client.go
+++ b/model/client.go
@@ -1228,6 +1228,18 @@ func (c *Client) SearchPosts(terms string, isOrSearch bool) (*Result, *AppError)
}
}
+// GetFlaggedPosts will return a post list of posts that have been flagged by the user.
+// The page is set by the integer parameters offset and limit.
+func (c *Client) GetFlaggedPosts(offset int, limit int) (*Result, *AppError) {
+ if r, err := c.DoApiGet(c.GetTeamRoute()+fmt.Sprintf("/posts/flagged/%v/%v", offset, limit), "", ""); err != nil {
+ return nil, err
+ } else {
+ defer closeBody(r)
+ return &Result{r.Header.Get(HEADER_REQUEST_ID),
+ r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil
+ }
+}
+
func (c *Client) UploadProfileFile(data []byte, contentType string) (*Result, *AppError) {
return c.uploadFile(c.ApiUrl+"/users/newimage", data, contentType)
}