diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2018-04-23 20:18:58 +0800 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-23 08:18:58 -0400 |
commit | 3224d2f6a3bd95293fff25d6cc417b30b4f6e334 (patch) | |
tree | 43ee308651d3a8e969ff550d6ae74a587de7bf01 /model/client4.go | |
parent | 853445dc2ea68f765faa04ad14618b04f1081c43 (diff) | |
download | chat-3224d2f6a3bd95293fff25d6cc417b30b4f6e334.tar.gz chat-3224d2f6a3bd95293fff25d6cc417b30b4f6e334.tar.bz2 chat-3224d2f6a3bd95293fff25d6cc417b30b4f6e334.zip |
add api to convert a channel from public to private and restrict that to system_admin (#8655)
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 870e440e8..260d75df6 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1491,6 +1491,16 @@ func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel, } } +// ConvertChannelToPrivate converts public to private channel. +func (c *Client4) ConvertChannelToPrivate(channelId string) (*Channel, *Response) { + if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/convert", ""); err != nil { + return nil, BuildErrorResponse(r, err) + } else { + defer closeBody(r) + return ChannelFromJson(r.Body), BuildResponse(r) + } +} + // 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 { |