summaryrefslogtreecommitdiffstats
path: root/model/post.go
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-04-17 14:20:47 +0200
committerJoram Wilander <jwawilander@gmail.com>2018-04-17 08:20:47 -0400
commit997df03ac1455785b7a39e40edcd67b3b3e86f9e (patch)
treee11a4f7712e0b5379c89cc415e0be1396b6057b9 /model/post.go
parent3a4c7603b3ce35ab247b4dddaf7a2506375ba2c9 (diff)
downloadchat-997df03ac1455785b7a39e40edcd67b3b3e86f9e.tar.gz
chat-997df03ac1455785b7a39e40edcd67b3b3e86f9e.tar.bz2
chat-997df03ac1455785b7a39e40edcd67b3b3e86f9e.zip
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
Diffstat (limited to 'model/post.go')
-rw-r--r--model/post.go10
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 &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.