Expand Plugin and REST APIs to trigger user typing event (#14331)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8c1164d86b
Коммит
66597d0fcb
@@ -487,6 +487,10 @@ func (c *Client4) GetGroupsRoute() string {
|
||||
return "/groups"
|
||||
}
|
||||
|
||||
func (c *Client4) GetPublishUserTypingRoute(userId string) string {
|
||||
return c.GetUserRoute(userId) + "/typing"
|
||||
}
|
||||
|
||||
func (c *Client4) GetGroupRoute(groupID string) string {
|
||||
return fmt.Sprintf("%s/%s", c.GetGroupsRoute(), groupID)
|
||||
}
|
||||
@@ -5094,6 +5098,16 @@ func (c *Client4) GetKnownUsers() ([]string, *Response) {
|
||||
return userIds, BuildResponse(r)
|
||||
}
|
||||
|
||||
// PublishUserTyping publishes a user is typing websocket event based on the provided TypingRequest.
|
||||
func (c *Client4) PublishUserTyping(userID string, typingRequest TypingRequest) (bool, *Response) {
|
||||
r, err := c.DoApiPost(c.GetPublishUserTypingRoute(userID), typingRequest.ToJson())
|
||||
if err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
func (c *Client4) GetChannelMemberCountsByGroup(channelID string, includeTimezones bool, etag string) ([]*ChannelMemberCountByGroup, *Response) {
|
||||
r, err := c.DoApiGet(c.GetChannelRoute(channelID)+"/member_counts_by_group?include_timezones="+strconv.FormatBool(includeTimezones), etag)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user