summaryrefslogtreecommitdiffstats
path: root/model/post_list.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-26 22:11:42 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-26 22:11:42 -0700
commitaec99ceb9d47d6354ac5a96bbc290126b55d30f5 (patch)
treeecb72b0d51f6edc7341ac5bef0a4f61583f81dde /model/post_list.go
parente750a8fd361ef6dfce557530a10aaf5ce5a7f37e (diff)
parent28847c6b4b864d747bbfdf5c53354dcb24e5f895 (diff)
downloadchat-aec99ceb9d47d6354ac5a96bbc290126b55d30f5.tar.gz
chat-aec99ceb9d47d6354ac5a96bbc290126b55d30f5.tar.bz2
chat-aec99ceb9d47d6354ac5a96bbc290126b55d30f5.zip
Merge branch 'master' into PLT-25
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"