summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-22 10:45:57 -0800
committerCorey Hulen <corey@hulen.com>2015-07-22 10:45:57 -0800
commitbeffcc0a3cafc700fdce98e794396cab371638c2 (patch)
tree85b2d11e3365c8619975048772c965fc33832790 /web/react/stores
parent62d7c926519247e17dfe980172ec3f9ef7671274 (diff)
parent0967a131a152e056c1cb971f895b2d1f8df4d0ed (diff)
downloadchat-beffcc0a3cafc700fdce98e794396cab371638c2.tar.gz
chat-beffcc0a3cafc700fdce98e794396cab371638c2.tar.bz2
chat-beffcc0a3cafc700fdce98e794396cab371638c2.zip
Merge pull request #201 from hmhealey/mm1539
MM-1539 Added the ability to reply to earlier message threads by starting a post with ^
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/post_store.jsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 5280bfe08..1b3e1a119 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -18,6 +18,7 @@ var SEARCH_TERM_CHANGE_EVENT = 'search_term_change';
var SELECTED_POST_CHANGE_EVENT = 'selected_post_change';
var MENTION_DATA_CHANGE_EVENT = 'mention_data_change';
var ADD_MENTION_EVENT = 'add_mention';
+var ACTIVE_THREAD_CHANGED_EVENT = 'active_thread_changed';
var PostStore = assign({}, EventEmitter.prototype, {
@@ -93,6 +94,18 @@ var PostStore = assign({}, EventEmitter.prototype, {
this.removeListener(ADD_MENTION_EVENT, callback);
},
+ emitActiveThreadChanged: function(rootId, parentId) {
+ this.emit(ACTIVE_THREAD_CHANGED_EVENT, rootId, parentId);
+ },
+
+ addActiveThreadChangedListener: function(callback) {
+ this.on(ACTIVE_THREAD_CHANGED_EVENT, callback);
+ },
+
+ removeActiveThreadChangedListener: function(callback) {
+ this.removeListener(ACTIVE_THREAD_CHANGED_EVENT, callback);
+ },
+
getCurrentPosts: function() {
var currentId = ChannelStore.getCurrentId();
@@ -186,6 +199,9 @@ PostStore.dispatchToken = AppDispatcher.register(function(payload) {
case ActionTypes.RECIEVED_ADD_MENTION:
PostStore.emitAddMention(action.id, action.username);
break;
+ case ActionTypes.RECEIVED_ACTIVE_THREAD_CHANGED:
+ PostStore.emitActiveThreadChanged(action.root_id, action.parent_id);
+ break;
default:
}