summaryrefslogtreecommitdiffstats
path: root/model/post_list.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-10-26 12:12:18 -0700
committerCorey Hulen <corey@hulen.com>2015-10-26 12:12:18 -0700
commit942c9317f4936e72da51b84313713b4ecd583b9a (patch)
tree94eea3c793e59910e78a5a842bb31c2b0d68b145 /model/post_list.go
parent86e3764cbd544c64136d5c34c2b80fb66a0cd4bd (diff)
parent663bec814767fa9c92e7ab2c706c0fe4c0432cf1 (diff)
downloadchat-942c9317f4936e72da51b84313713b4ecd583b9a.tar.gz
chat-942c9317f4936e72da51b84313713b4ecd583b9a.tar.bz2
chat-942c9317f4936e72da51b84313713b4ecd583b9a.zip
Merge pull request #1164 from hmhealey/plt778
PLT-778 Changed post searching to allow searching by multiple users/channels
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 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"