[Glitch] Feature: Direct message from menu

Port d1f34151ae to glitch-soc
This commit is contained in:
Thibaut Girka
2018-03-29 21:13:47 +02:00
parent 939ea456d2
commit a5fac975f3
7 changed files with 93 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import {
COMPOSE_CYCLE_ELEFRIEND,
COMPOSE_REPLY,
COMPOSE_REPLY_CANCEL,
COMPOSE_DIRECT,
COMPOSE_MENTION,
COMPOSE_SUBMIT_REQUEST,
COMPOSE_SUBMIT_SUCCESS,
@@ -325,6 +326,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: