diff options
author | enahum <nahumhbl@gmail.com> | 2016-08-18 17:37:55 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-08-18 14:37:55 -0800 |
commit | ed6b69aab3136b2a5bcddbab77659640cd4d6534 (patch) | |
tree | a7c455fd49bb3c43847c1adb011c304c22878410 /webapp/stores/post_store.jsx | |
parent | 4a2fbcaf983e3180e00bb846f4ed65a2670b9251 (diff) | |
download | chat-ed6b69aab3136b2a5bcddbab77659640cd4d6534.tar.gz chat-ed6b69aab3136b2a5bcddbab77659640cd4d6534.tar.bz2 chat-ed6b69aab3136b2a5bcddbab77659640cd4d6534.zip |
PLT-3754 EE: Add a Display Option to disable Join/Leave messages (#3808)
* PLT-3754 EE: Add a Display Option to disable Join/Leave messages
* Differentiate between join/leave add/remove messages
* Update user removed from channel text message
Diffstat (limited to 'webapp/stores/post_store.jsx')
-rw-r--r-- | webapp/stores/post_store.jsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 135563866..0b2277255 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -548,6 +548,24 @@ class PostStoreClass extends EventEmitter { return commentCount; } + + filterPosts(channelId, joinLeave) { + const postsList = JSON.parse(JSON.stringify(this.getVisiblePosts(channelId))); + + if (!joinLeave && postsList) { + postsList.order = postsList.order.filter((id) => { + if (postsList.posts[id].type === Constants.POST_TYPE_JOIN_LEAVE) { + Reflect.deleteProperty(postsList.posts, id); + + return false; + } + + return true; + }); + } + + return postsList; + } } var PostStore = new PostStoreClass(); |