summaryrefslogtreecommitdiffstats
path: root/web/react/stores/post_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/stores/post_store.jsx')
-rw-r--r--web/react/stores/post_store.jsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 3e4fde30a..2fffb17d0 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -172,6 +172,28 @@ var PostStore = assign({}, EventEmitter.prototype, {
getPendingPosts: function(channelId) {
return BrowserStore.getItem('pending_posts_' + channelId);
},
+ storeUnseenDeletedPost: function(post) {
+ var posts = this.getUnseenDeletedPosts(post.channel_id);
+
+ if (!posts) {
+ posts = {};
+ }
+
+ post.message = '(message deleted)';
+ post.state = Constants.POST_DELETED;
+
+ posts[post.id] = post;
+ this.storeUnseenDeletedPosts(post.channel_id, posts);
+ },
+ storeUnseenDeletedPosts: function(channelId, posts) {
+ BrowserStore.setItem('deleted_posts_' + channelId, posts);
+ },
+ getUnseenDeletedPosts: function(channelId) {
+ return BrowserStore.getItem('deleted_posts_' + channelId);
+ },
+ clearUnseenDeletedPosts: function(channelId) {
+ BrowserStore.setItem('deleted_posts_' + channelId, {});
+ },
removePendingPost: function(channelId, pendingPostId) {
this._removePendingPost(channelId, pendingPostId);
this.emitChange();