diff options
Diffstat (limited to 'model/post.go')
-rw-r--r-- | model/post.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/post.go b/model/post.go index e74496979..31837b8c8 100644 --- a/model/post.go +++ b/model/post.go @@ -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 © } +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. |