summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 6f8b43c39..4aa276026 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -1181,6 +1181,16 @@ func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Respo
}
}
+// CreateGroupChannel creates a group message channel based on userIds provided
+func (c *Client4) CreateGroupChannel(userIds []string) (*Channel, *Response) {
+ if r, err := c.DoApiPost(c.GetChannelsRoute()+"/group", ArrayToJson(userIds)); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return ChannelFromJson(r.Body), BuildResponse(r)
+ }
+}
+
// GetChannel returns a channel based on the provided channel id string.
func (c *Client4) GetChannel(channelId, etag string) (*Channel, *Response) {
if r, err := c.DoApiGet(c.GetChannelRoute(channelId), etag); err != nil {