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 удалений

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

@@ -80,6 +80,11 @@ type Post struct {
HasReactions bool `json:"has_reactions,omitempty"`
}
type PostEphemeral struct {
UserID string `json:"user_id"`
Post *Post `json:"post"`
}
type PostPatch struct {
IsPinned *bool `json:"is_pinned"`
Message *string `json:"message"`
@@ -432,6 +437,11 @@ func (o *Post) WithRewrittenImageURLs(f func(string) string) *Post {
return &copy
}
func (o *PostEphemeral) ToUnsanitizedJson() string {
b, _ := json.Marshal(o)
return string(b)
}
// RewriteImageURLs takes a message and returns a copy that has all of the image URLs replaced
// according to the function f. For each image URL, f will be invoked, and the resulting markdown
// will contain the URL returned by that invocation instead.