dispatch/client/js/state/actions.js

89 lines
2.3 KiB
JavaScript
Raw Normal View History

2020-06-24 23:50:10 +00:00
export const INIT = 'INIT';
2017-06-06 23:03:35 +00:00
export const APP_SET = 'APP_SET';
2015-12-28 23:34:32 +00:00
export const INVITE = 'INVITE';
export const JOIN = 'JOIN';
export const KICK = 'KICK';
2020-06-15 08:58:51 +00:00
export const KICKED = 'KICKED';
2015-12-28 23:34:32 +00:00
export const PART = 'PART';
export const SET_TOPIC = 'SET_TOPIC';
2019-01-23 06:34:39 +00:00
export const CHANNEL_SEARCH = 'CHANNEL_SEARCH';
export const INPUT_HISTORY_ADD = 'INPUT_HISTORY_ADD';
export const INPUT_HISTORY_DECREMENT = 'INPUT_HISTORY_DECREMENT';
export const INPUT_HISTORY_INCREMENT = 'INPUT_HISTORY_INCREMENT';
export const INPUT_HISTORY_RESET = 'INPUT_HISTORY_RESET';
export const ADD_FETCHED_MESSAGES = 'ADD_FETCHED_MESSAGES';
export const ADD_MESSAGE = 'ADD_MESSAGE';
export const ADD_MESSAGES = 'ADD_MESSAGES';
export const COMMAND = 'COMMAND';
export const FETCH_MESSAGES = 'FETCH_MESSAGES';
2016-01-27 19:48:47 +00:00
export const RAW = 'RAW';
export const UPDATE_MESSAGE_HEIGHT = 'UPDATE_MESSAGE_HEIGHT';
export const OPEN_MODAL = 'OPEN_MODAL';
export const CLOSE_MODAL = 'CLOSE_MODAL';
export const CLOSE_PRIVATE_CHAT = 'CLOSE_PRIVATE_CHAT';
export const OPEN_PRIVATE_CHAT = 'OPEN_PRIVATE_CHAT';
2015-12-28 23:34:32 +00:00
export const SEARCH_MESSAGES = 'SEARCH_MESSAGES';
export const TOGGLE_SEARCH = 'TOGGLE_SEARCH';
export const AWAY = 'AWAY';
export const CONNECT = 'CONNECT';
export const DISCONNECT = 'DISCONNECT';
export const RECONNECT = 'RECONNECT';
export const SET_NICK = 'SET_NICK';
2020-06-15 08:58:51 +00:00
export const SET_NETWORK_NAME = 'SET_NETWORK_NAME';
export const WHOIS = 'WHOIS';
2016-01-11 20:04:57 +00:00
export const SET_CERT = 'SET_CERT';
export const SET_CERT_ERROR = 'SET_CERT_ERROR';
export const SET_KEY = 'SET_KEY';
export const UPLOAD_CERT = 'UPLOAD_CERT';
2018-10-15 06:56:17 +00:00
export const SETTINGS_SET = 'SETTINGS_SET';
export const SELECT_TAB = 'SELECT_TAB';
export const HIDE_MENU = 'HIDE_MENU';
2015-12-28 23:34:32 +00:00
export const TOGGLE_MENU = 'TOGGLE_MENU';
2016-01-11 22:31:06 +00:00
export const TOGGLE_USERLIST = 'TOGGLE_USERLIST';
export function socketAction(type) {
return `SOCKET_${type.toUpperCase()}`;
}
function createSocketActions(types) {
const actions = {};
types.forEach(type => {
actions[type.toUpperCase()] = socketAction(type);
});
return actions;
}
export const socket = createSocketActions([
'cert_fail',
'cert_success',
'channel_forward',
2019-01-23 06:34:39 +00:00
'channel_search',
'connected',
'connection_update',
'error',
2019-01-27 07:53:07 +00:00
'features',
'join',
'message',
'mode',
'nick_fail',
'nick',
'part',
'kick',
'pm',
'quit',
'search',
'topic',
'users'
]);