summaryrefslogtreecommitdiffstats
path: root/web/react/dispatcher/event_helpers.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-02-04 14:50:30 -0500
committerChristopher Speller <crspeller@gmail.com>2016-02-04 14:50:30 -0500
commitec51c31c325b3dc648a261f0e8634b6d70d7ba73 (patch)
tree1369b8d2bc406d54770d7ccf52b1e6a8bfedfc05 /web/react/dispatcher/event_helpers.jsx
parent44c19ee443831e0e94b5738ecb21a64ce7643247 (diff)
parent21318b7505babaebbb5174c62b75595b2936ebe0 (diff)
downloadchat-ec51c31c325b3dc648a261f0e8634b6d70d7ba73.tar.gz
chat-ec51c31c325b3dc648a261f0e8634b6d70d7ba73.tar.bz2
chat-ec51c31c325b3dc648a261f0e8634b6d70d7ba73.zip
Merge pull request #2064 from hmhealey/plt882
PLT-882 Ephemeral Messages and Out-Of-Channel mentions
Diffstat (limited to 'web/react/dispatcher/event_helpers.jsx')
-rw-r--r--web/react/dispatcher/event_helpers.jsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/web/react/dispatcher/event_helpers.jsx b/web/react/dispatcher/event_helpers.jsx
index 5eb319320..c1041e438 100644
--- a/web/react/dispatcher/event_helpers.jsx
+++ b/web/react/dispatcher/event_helpers.jsx
@@ -9,6 +9,7 @@ import Constants from '../utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import * as AsyncClient from '../utils/async_client.jsx';
import * as Client from '../utils/client.jsx';
+import * as Utils from '../utils/utils.jsx';
export function emitChannelClickEvent(channel) {
AsyncClient.getChannels(true);
@@ -180,3 +181,27 @@ export function emitPreferenceChangedEvent(preference) {
preference
});
}
+
+export function emitRemovePost(post) {
+ AppDispatcher.handleViewAction({
+ type: Constants.ActionTypes.REMOVE_POST,
+ post
+ });
+}
+
+export function sendEphemeralPost(message, channelId) {
+ const timestamp = Utils.getTimestamp();
+ const post = {
+ id: Utils.generateId(),
+ user_id: '0',
+ channel_id: channelId || ChannelStore.getCurrentId(),
+ message,
+ type: Constants.POST_TYPE_EPHEMERAL,
+ create_at: timestamp,
+ update_at: timestamp,
+ filenames: [],
+ props: {}
+ };
+
+ emitPostRecievedEvent(post);
+}