summaryrefslogtreecommitdiffstats
path: root/web/react/dispatcher/event_helpers.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2016-02-03 15:21:03 -0500
committerhmhealey <harrisonmhealey@gmail.com>2016-02-04 11:38:58 -0500
commitf935be121c0b6764e1e30f1b5d4eb6e78137fa36 (patch)
treed0d2907d9fd394d786a59b774261adae4afca44c /web/react/dispatcher/event_helpers.jsx
parent70c3715b963cd8f2a710f8909f23696f9de7fcc7 (diff)
downloadchat-f935be121c0b6764e1e30f1b5d4eb6e78137fa36.tar.gz
chat-f935be121c0b6764e1e30f1b5d4eb6e78137fa36.tar.bz2
chat-f935be121c0b6764e1e30f1b5d4eb6e78137fa36.zip
Added helper methods to send ephemeral messages to specific users
Diffstat (limited to 'web/react/dispatcher/event_helpers.jsx')
-rw-r--r--web/react/dispatcher/event_helpers.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/web/react/dispatcher/event_helpers.jsx b/web/react/dispatcher/event_helpers.jsx
index cb41bd1bb..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);
@@ -187,3 +188,20 @@ export function emitRemovePost(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);
+}