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
Этот коммит содержится в:
Daniel Schalla
2018-04-17 14:20:47 +02:00
коммит произвёл Joram Wilander
родитель 3a4c7603b3
Коммит 997df03ac1
7 изменённых файлов: 106 добавлений и 0 удалений

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

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