From 2383d5dd37d5ebf28c2576fd495a8a7f02f78901 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 23 Oct 2015 17:28:02 -0400 Subject: Changed post searching to allow searching by multiple users/channels --- model/post_list.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model/post_list.go') diff --git a/model/post_list.go b/model/post_list.go index 862673ef3..4c0f5408e 100644 --- a/model/post_list.go +++ b/model/post_list.go @@ -54,6 +54,15 @@ func (o *PostList) AddPost(post *Post) { o.Posts[post.Id] = post } +func (o *PostList) Extend(other *PostList) { + for _, postId := range other.Order { + if _, ok := o.Posts[postId]; !ok { + o.AddPost(other.Posts[postId]) + o.AddOrder(postId) + } + } +} + func (o *PostList) Etag() string { id := "0" -- cgit v1.2.3-1-g7c22