2017-08-16 23:29:12 +00:00
|
|
|
const REQUEST = 'REQUEST';
|
|
|
|
const SUCCESS = 'SUCCESS';
|
|
|
|
const FAILURE = 'FAILURE';
|
2017-08-17 01:06:31 +00:00
|
|
|
const defaultTypes = [REQUEST, SUCCESS, FAILURE];
|
|
|
|
function createRequestTypes(base, types = defaultTypes) {
|
2017-08-16 23:29:12 +00:00
|
|
|
const res = {};
|
2017-09-25 13:15:28 +00:00
|
|
|
types.forEach(type => (res[type] = `${ base }_${ type }`));
|
2017-08-16 23:29:12 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Login events
|
2017-11-07 16:28:02 +00:00
|
|
|
export const LOGIN = createRequestTypes('LOGIN', [
|
|
|
|
...defaultTypes,
|
2018-02-23 20:29:06 +00:00
|
|
|
'SET_SERVICES',
|
2020-06-09 20:19:54 +00:00
|
|
|
'SET_PREFERENCE',
|
|
|
|
'SET_LOCAL_AUTHENTICATED'
|
2017-11-07 16:28:02 +00:00
|
|
|
]);
|
2019-07-29 16:33:28 +00:00
|
|
|
export const SHARE = createRequestTypes('SHARE', [
|
|
|
|
'SELECT_SERVER',
|
|
|
|
'SET_USER',
|
2020-10-30 15:54:02 +00:00
|
|
|
'SET_SETTINGS',
|
2019-07-29 16:33:28 +00:00
|
|
|
'SET_SERVER_INFO'
|
|
|
|
]);
|
2017-12-05 19:57:44 +00:00
|
|
|
export const USER = createRequestTypes('USER', ['SET']);
|
2018-08-31 16:46:33 +00:00
|
|
|
export const ROOMS = createRequestTypes('ROOMS', [
|
|
|
|
...defaultTypes,
|
2020-02-11 20:13:44 +00:00
|
|
|
'REFRESH',
|
2018-08-31 16:46:33 +00:00
|
|
|
'SET_SEARCH',
|
|
|
|
'CLOSE_SERVER_DROPDOWN',
|
|
|
|
'TOGGLE_SERVER_DROPDOWN',
|
|
|
|
'CLOSE_SORT_DROPDOWN',
|
2018-10-23 21:39:48 +00:00
|
|
|
'TOGGLE_SORT_DROPDOWN',
|
|
|
|
'OPEN_SEARCH_HEADER',
|
|
|
|
'CLOSE_SEARCH_HEADER'
|
2018-08-31 16:46:33 +00:00
|
|
|
]);
|
2020-05-08 17:36:10 +00:00
|
|
|
export const ROOM = createRequestTypes('ROOM', ['SUBSCRIBE', 'UNSUBSCRIBE', 'LEAVE', 'DELETE', 'REMOVED', 'CLOSE', 'FORWARD', 'USER_TYPING']);
|
2020-07-31 18:22:30 +00:00
|
|
|
export const INQUIRY = createRequestTypes('INQUIRY', [...defaultTypes, 'SET_ENABLED', 'RESET', 'QUEUE_ADD', 'QUEUE_UPDATE', 'QUEUE_REMOVE']);
|
2020-06-15 14:00:46 +00:00
|
|
|
export const APP = createRequestTypes('APP', ['START', 'READY', 'INIT', 'INIT_LOCAL_SETTINGS', 'SET_MASTER_DETAIL']);
|
2019-09-16 20:26:32 +00:00
|
|
|
export const MESSAGES = createRequestTypes('MESSAGES', ['REPLY_BROADCAST']);
|
2018-04-24 19:34:03 +00:00
|
|
|
export const CREATE_CHANNEL = createRequestTypes('CREATE_CHANNEL', [...defaultTypes]);
|
2020-03-30 19:50:27 +00:00
|
|
|
export const CREATE_DISCUSSION = createRequestTypes('CREATE_DISCUSSION', [...defaultTypes]);
|
2018-04-24 19:34:03 +00:00
|
|
|
export const SELECTED_USERS = createRequestTypes('SELECTED_USERS', ['ADD_USER', 'REMOVE_USER', 'RESET', 'SET_LOADING']);
|
2017-11-13 13:53:45 +00:00
|
|
|
export const SERVER = createRequestTypes('SERVER', [
|
|
|
|
...defaultTypes,
|
2018-08-01 19:35:06 +00:00
|
|
|
'SELECT_SUCCESS',
|
2018-08-31 18:13:30 +00:00
|
|
|
'SELECT_REQUEST',
|
2019-06-17 13:57:07 +00:00
|
|
|
'SELECT_FAILURE',
|
2018-08-31 18:13:30 +00:00
|
|
|
'INIT_ADD',
|
|
|
|
'FINISH_ADD'
|
2017-11-13 13:53:45 +00:00
|
|
|
]);
|
2018-12-05 20:52:08 +00:00
|
|
|
export const METEOR = createRequestTypes('METEOR_CONNECT', [...defaultTypes, 'DISCONNECT']);
|
2017-08-16 23:29:12 +00:00
|
|
|
export const LOGOUT = 'LOGOUT'; // logout is always success
|
2018-04-24 19:34:03 +00:00
|
|
|
export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPEN', 'READY', 'CLOSE', 'MESSAGES_RECEIVED']);
|
2018-05-07 20:43:26 +00:00
|
|
|
export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']);
|
2018-09-04 14:29:20 +00:00
|
|
|
export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']);
|
2019-08-23 13:18:47 +00:00
|
|
|
export const TOGGLE_CRASH_REPORT = 'TOGGLE_CRASH_REPORT';
|
2020-09-11 17:34:11 +00:00
|
|
|
export const TOGGLE_ANALYTICS_EVENTS = 'TOGGLE_ANALYTICS_EVENTS';
|
2019-09-16 20:26:32 +00:00
|
|
|
export const SET_CUSTOM_EMOJIS = 'SET_CUSTOM_EMOJIS';
|
|
|
|
export const SET_ACTIVE_USERS = 'SET_ACTIVE_USERS';
|
|
|
|
export const USERS_TYPING = createRequestTypes('USERS_TYPING', ['ADD', 'REMOVE', 'CLEAR']);
|
2020-01-28 13:22:35 +00:00
|
|
|
export const INVITE_LINKS = createRequestTypes('INVITE_LINKS', [
|
|
|
|
'SET_TOKEN',
|
|
|
|
'SET_PARAMS',
|
|
|
|
'SET_INVITE',
|
|
|
|
'CREATE',
|
|
|
|
'CLEAR',
|
|
|
|
...defaultTypes
|
|
|
|
]);
|
2020-04-01 19:24:42 +00:00
|
|
|
export const SETTINGS = createRequestTypes('SETTINGS', ['CLEAR', 'ADD']);
|
2020-05-08 17:04:37 +00:00
|
|
|
export const APP_STATE = createRequestTypes('APP_STATE', ['FOREGROUND', 'BACKGROUND']);
|
2020-08-21 13:38:50 +00:00
|
|
|
export const ENTERPRISE_MODULES = createRequestTypes('ENTERPRISE_MODULES', ['CLEAR', 'SET']);
|
2021-01-20 17:34:01 +00:00
|
|
|
export const ENCRYPTION = createRequestTypes('ENCRYPTION', ['INIT', 'STOP', 'DECODE_KEY', 'SET', 'SET_BANNER']);
|