summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-31 09:55:37 -0400
committerChristopher Speller <crspeller@gmail.com>2017-03-31 09:55:37 -0400
commit4e224c299697e570e98c388bf23a42ffa1e6af0d (patch)
tree5bc192c008347cce8d9b1f34888f2dbb694c8d51 /model
parentea17e8d004ca6a9501cb540c0009bb531eb9d0f2 (diff)
downloadchat-4e224c299697e570e98c388bf23a42ffa1e6af0d.tar.gz
chat-4e224c299697e570e98c388bf23a42ffa1e6af0d.tar.bz2
chat-4e224c299697e570e98c388bf23a42ffa1e6af0d.zip
Implement PUT /channels/{channel_id}/members/{user_id}/notify_props for APIv4 (#5901)
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 91b538ff8..a43950a68 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -1186,6 +1186,16 @@ func (c *Client4) UpdateChannelRoles(channelId, userId, roles string) (bool, *Re
}
}
+// UpdateChannelNotifyProps will update the notification properties on a channel for a user.
+func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response) {
+ if r, err := c.DoApiPut(c.GetChannelMemberRoute(channelId, userId)+"/notify_props", MapToJson(props)); err != nil {
+ return false, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// AddChannelMember adds user to channel and return a channel member.
func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *Response) {
requestBody := map[string]string{"user_id": userId}