]> cat aescling's git repositories - mastodon.git/commitdiff
Convert emoji shortnames when sending status (#1666)
authorRachel H <rainyday@users.noreply.github.com>
Thu, 13 Apr 2017 14:03:45 +0000 (07:03 -0700)
committerEugen <eugen@zeonfederated.com>
Thu, 13 Apr 2017 14:03:45 +0000 (16:03 +0200)
app/assets/javascripts/components/actions/compose.jsx

index 1b3cc60dcc1fe57e30e9d1a55a54f25afd84100e..88e91c356f7794b1e158b28201d1483151395899 100644 (file)
@@ -2,6 +2,8 @@ import api from '../api';
 
 import { updateTimeline } from './timelines';
 
+import * as emojione from 'emojione';
+
 export const COMPOSE_CHANGE          = 'COMPOSE_CHANGE';
 export const COMPOSE_SUBMIT_REQUEST  = 'COMPOSE_SUBMIT_REQUEST';
 export const COMPOSE_SUBMIT_SUCCESS  = 'COMPOSE_SUBMIT_SUCCESS';
@@ -72,9 +74,8 @@ export function mentionCompose(account, router) {
 export function submitCompose() {
   return function (dispatch, getState) {
     dispatch(submitComposeRequest());
-
     api(getState).post('/api/v1/statuses', {
-      status: getState().getIn(['compose', 'text'], ''),
+      status: emojione.shortnameToUnicode(getState().getIn(['compose', 'text'], '')),
       in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
       media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
       sensitive: getState().getIn(['compose', 'sensitive']),