diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-23 17:28:02 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-23 17:28:02 -0400 |
commit | 2383d5dd37d5ebf28c2576fd495a8a7f02f78901 (patch) | |
tree | 17e3b5953fc0f1392ec477948609a0d1ecc134fb /model/post_list.go | |
parent | 2ccf80d91d9f9236e15a674c7d2d61261538c9b9 (diff) | |
download | chat-2383d5dd37d5ebf28c2576fd495a8a7f02f78901.tar.gz chat-2383d5dd37d5ebf28c2576fd495a8a7f02f78901.tar.bz2 chat-2383d5dd37d5ebf28c2576fd495a8a7f02f78901.zip |
Changed post searching to allow searching by multiple users/channels
Diffstat (limited to 'model/post_list.go')
-rw-r--r-- | model/post_list.go | 9 |
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" |