summaryrefslogtreecommitdiffstats
path: root/model/post_list.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-01-22 15:32:50 -0600
committerGitHub <noreply@github.com>2018-01-22 15:32:50 -0600
commit599991ea731953f772824ce3ed1e591246aa004f (patch)
treefca0f556f12e56bdcefa74ac6794dec64e04e3fc /model/post_list.go
parenta8445775351c32f8a12081f60bda2099571b2758 (diff)
downloadchat-599991ea731953f772824ce3ed1e591246aa004f.tar.gz
chat-599991ea731953f772824ce3ed1e591246aa004f.tar.bz2
chat-599991ea731953f772824ce3ed1e591246aa004f.zip
PLT-3383: image proxy support (#7991)
* image proxy support * go vet fix, remove mistakenly added coverage file * fix test compile error * add validation to config settings and documentation to model functions * add message_source field to post
Diffstat (limited to 'model/post_list.go')
-rw-r--r--model/post_list.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/post_list.go b/model/post_list.go
index 018f7d14f..09cddfdcf 100644
--- a/model/post_list.go
+++ b/model/post_list.go
@@ -21,6 +21,15 @@ func NewPostList() *PostList {
}
}
+func (o *PostList) WithRewrittenImageURLs(f func(string) string) *PostList {
+ copy := *o
+ copy.Posts = make(map[string]*Post)
+ for id, post := range o.Posts {
+ copy.Posts[id] = post.WithRewrittenImageURLs(f)
+ }
+ return &copy
+}
+
func (o *PostList) StripActionIntegrations() {
posts := o.Posts
o.Posts = make(map[string]*Post)