Initial Commit of Ephemeral Message Support for System Admins (#8611)
Fixed Permission Test Fixed and extended ephemeral message tests; Removed Online/Activity Updates Set Create Time to current time gofmt
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
3a4c7603b3
Коммит
997df03ac1
@@ -162,6 +162,10 @@ func (c *Client4) GetPostsRoute() string {
|
||||
return fmt.Sprintf("/posts")
|
||||
}
|
||||
|
||||
func (c *Client4) GetPostsEphemeralRoute() string {
|
||||
return fmt.Sprintf("/posts/ephemeral")
|
||||
}
|
||||
|
||||
func (c *Client4) GetConfigRoute() string {
|
||||
return fmt.Sprintf("/config")
|
||||
}
|
||||
@@ -1771,6 +1775,16 @@ func (c *Client4) CreatePost(post *Post) (*Post, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// CreatePostEphemeral creates a ephemeral post based on the provided post struct which is send to the given user id
|
||||
func (c *Client4) CreatePostEphemeral(post *PostEphemeral) (*Post, *Response) {
|
||||
if r, err := c.DoApiPost(c.GetPostsEphemeralRoute(), post.ToUnsanitizedJson()); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return PostFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// UpdatePost updates a post based on the provided post struct.
|
||||
func (c *Client4) UpdatePost(postId string, post *Post) (*Post, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetPostRoute(postId), post.ToUnsanitizedJson()); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user