about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/compose.js
diff options
context:
space:
mode:
authorEmelia Smith <ThisIsMissEm@users.noreply.github.com>2018-03-29 19:08:34 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-03-29 19:08:34 +0200
commitd1f34151aee564bb1e60ee48107797681c869a81 (patch)
tree101044875b49579d890d95463eee82c647ea3ebe /app/javascript/mastodon/reducers/compose.js
parentf1f846045f26518525d5484ed9e782b73086ebe4 (diff)
Feature: Direct message from menu (#6956)
* Implement ability to send direct messages from the user menu

* Implement message warning users that direct messages are visible to all mentioned users

* Update locales
Diffstat (limited to 'app/javascript/mastodon/reducers/compose.js')
-rw-r--r--app/javascript/mastodon/reducers/compose.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js
index 5eadebb81..a48c46941 100644
--- a/app/javascript/mastodon/reducers/compose.js
+++ b/app/javascript/mastodon/reducers/compose.js
@@ -4,6 +4,7 @@ import {
   COMPOSE_CHANGE,
   COMPOSE_REPLY,
   COMPOSE_REPLY_CANCEL,
+  COMPOSE_DIRECT,
   COMPOSE_MENTION,
   COMPOSE_SUBMIT_REQUEST,
   COMPOSE_SUBMIT_SUCCESS,
@@ -262,6 +263,12 @@ export default function compose(state = initialState, action) {
       .update('text', text => `${text}@${action.account.get('acct')} `)
       .set('focusDate', new Date())
       .set('idempotencyKey', uuid());
+  case COMPOSE_DIRECT:
+    return state
+      .update('text', text => `${text}@${action.account.get('acct')} `)
+      .set('privacy', 'direct')
+      .set('focusDate', new Date())
+      .set('idempotencyKey', uuid());
   case COMPOSE_SUGGESTIONS_CLEAR:
     return state.update('suggestions', ImmutableList(), list => list.clear()).set('suggestion_token', null);
   case COMPOSE_SUGGESTIONS_READY: