summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorRobin Naundorf <r.naundorf@fh-muenster.de>2017-05-15 22:12:30 +0200
committerJoram Wilander <jwawilander@gmail.com>2017-05-15 16:12:30 -0400
commit0a20e8d3269515e2d44a0bcad0a2408f62245814 (patch)
tree533767c6a60939504f8f70c60bd4ff77ef0e8fe7 /model
parent34728f748bfd7976c085f1be77e53f70d6e55a06 (diff)
downloadchat-0a20e8d3269515e2d44a0bcad0a2408f62245814.tar.gz
chat-0a20e8d3269515e2d44a0bcad0a2408f62245814.tar.bz2
chat-0a20e8d3269515e2d44a0bcad0a2408f62245814.zip
PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263)
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 4a01a1f75..f4a247e12 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -1217,6 +1217,16 @@ func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel,
}
}
+// RestoreChannel restores a previously deleted channel. Any missing fields are not updated.
+func (c *Client4) RestoreChannel(channelId string) (*Channel, *Response) {
+ if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/restore", ""); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return ChannelFromJson(r.Body), BuildResponse(r)
+ }
+}
+
// CreateDirectChannel creates a direct message channel based on the two user
// ids provided.
func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Response) {