about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/compose.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/reducers/compose.jsx')
-rw-r--r--app/assets/javascripts/components/reducers/compose.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/reducers/compose.jsx b/app/assets/javascripts/components/reducers/compose.jsx
index 688c494c0..3974e40c6 100644
--- a/app/assets/javascripts/components/reducers/compose.jsx
+++ b/app/assets/javascripts/components/reducers/compose.jsx
@@ -23,6 +23,10 @@ const initialState = Immutable.Map({
   media_attachments: Immutable.List([])
 });
 
+function statusToTextMentions(status) {
+  return Immutable.OrderedSet([`@${status.getIn(['account', 'acct'])} `]).union(status.get('mentions').map(mention => `@${mention.get('acct')} `)).join('');
+};
+
 export default function compose(state = initialState, action) {
   switch(action.type) {
     case COMPOSE_CHANGE:
@@ -30,7 +34,7 @@ export default function compose(state = initialState, action) {
     case COMPOSE_REPLY:
       return state.withMutations(map => {
         map.set('in_reply_to', action.status.get('id'));
-        map.set('text', `@${action.status.getIn(['account', 'acct'])} `);
+        map.set('text', statusToTextMentions(action.status));
       });
     case COMPOSE_REPLY_CANCEL:
       return state.withMutations(map => {