<commit_before>/*
 * Copyright (C) 2015 Actor LLC. <https://actor.im>
 */

import { dispatch } from '../dispatcher/ActorAppDispatcher';
import { ActionTypes } from '../constants/ActorAppConstants';
import DraftActionCreators from './DraftActionCreators';
import ActorClient from '../utils/ActorClient';

export default {
  cleanText() {
    DraftActionCreators.saveDraft('', true);
    dispatch(ActionTypes.COMPOSE_CLEAN);
  },

  insertMention(peer, text, caretPosition, mention) {
    dispatch(ActionTypes.COMPOSE_MENTION_INSERT, { peer, text, caretPosition, mention });
  },

  closeMention() {
    dispatch(ActionTypes.COMPOSE_MENTION_CLOSE);
  },

  pasteText(text) {
    if (text !== '') {
      dispatch(ActionTypes.COMPOSE_PASTE, { text });
    }
  },
<commit_msg>fix(web): clearing draft after send message<commit_after>/*
 * Copyright (C) 2015 Actor LLC. <https://actor.im>
 */

import { dispatch } from '../dispatcher/ActorAppDispatcher';
import { ActionTypes } from '../constants/ActorAppConstants';
import DraftActionCreators from './DraftActionCreators';
import ActorClient from '../utils/ActorClient';

export default {
  cleanText() {
    DraftActionCreators.changeDraft('');
    dispatch(ActionTypes.COMPOSE_CLEAN);
  },

  insertMention(peer, text, caretPosition, mention) {
    dispatch(ActionTypes.COMPOSE_MENTION_INSERT, { peer, text, caretPosition, mention });
  },

  closeMention() {
    dispatch(ActionTypes.COMPOSE_MENTION_CLOSE);
  },

  pasteText(text) {
    if (text !== '') {
      dispatch(ActionTypes.COMPOSE_PASTE, { text });
    }
  },

{'fraction_non_alphanumeric': 0.14394904458598726, 'fraction_numerical': 0.005095541401273885, 'mean_word_length': 4.28956228956229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2398895', 'n_tokens_mistral': 509, 'n_tokens_neox': 473, 'n_words': 94}