summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-08-04 14:03:41 -0400
committerChristopher Speller <crspeller@gmail.com>2017-08-04 11:03:41 -0700
commit399865923658319d6d12a7719bc3b5554218bbad (patch)
tree4e1d3d8dcd196a33b8b9daf03c1dc659c1025384 /webapp/actions
parent2c8a5ffd971f00648e7bc5f48993fc187f3179f2 (diff)
downloadchat-399865923658319d6d12a7719bc3b5554218bbad.tar.gz
chat-399865923658319d6d12a7719bc3b5554218bbad.tar.bz2
chat-399865923658319d6d12a7719bc3b5554218bbad.zip
PLT-7267 Refactored tracking of recent emojis to hide deleted emojis (#7102)
* Fixed local ESLint error * PLT-7267 Refactored tracking of recent emojis to hide deleted emojis
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/post_actions.jsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx
index e96e8306b..60913b171 100644
--- a/webapp/actions/post_actions.jsx
+++ b/webapp/actions/post_actions.jsx
@@ -11,8 +11,8 @@ import TeamStore from 'stores/team_store.jsx';
import {loadNewDMIfNeeded, loadNewGMIfNeeded} from 'actions/user_actions.jsx';
import {sendDesktopNotification} from 'actions/notification_actions.jsx';
-import Constants from 'utils/constants.jsx';
-const ActionTypes = Constants.ActionTypes;
+import {ActionTypes, Constants} from 'utils/constants.jsx';
+import {EMOJI_PATTERN} from 'utils/emoticons.jsx';
import {browserHistory} from 'react-router/es6';
@@ -164,6 +164,15 @@ export function removeReaction(channelId, postId, emojiName) {
}
export function createPost(post, files, success) {
+ // parse message and emit emoji event
+ const emojis = post.message.match(EMOJI_PATTERN);
+ if (emojis) {
+ for (const emoji of emojis) {
+ const trimmed = emoji.substring(1, emoji.length - 1);
+ emitEmojiPosted(trimmed);
+ }
+ }
+
PostActions.createPost(post, files)(dispatch, getState).then(() => {
if (post.root_id) {
PostStore.storeCommentDraft(post.root_id, null);