Implement PUT /channels/{channel_id}/members/{user_id}/notify_props for APIv4 (#5901)

Этот коммит содержится в:
Joram Wilander
2017-03-31 09:55:37 -04:00
коммит произвёл Christopher Speller
родитель ea17e8d004
Коммит 4e224c2996
3 изменённых файлов: 87 добавлений и 0 удалений

Просмотреть файл

@@ -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}