2021-07-28 15:15:52 +02:00
|
|
|
import appDispatcher from '../dispatcher';
|
|
|
|
import cons from '../state/cons';
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function selectTab(tabId) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
2021-09-05 15:26:34 +02:00
|
|
|
type: cons.actions.navigation.SELECT_TAB,
|
2021-07-28 15:15:52 +02:00
|
|
|
tabId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function selectSpace(roomId) {
|
2021-09-03 14:28:01 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.SELECT_SPACE,
|
|
|
|
roomId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function selectRoom(roomId, eventId) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.SELECT_ROOM,
|
|
|
|
roomId,
|
2021-12-03 14:02:10 +01:00
|
|
|
eventId,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-16 15:55:36 +01:00
|
|
|
export function openSpaceSettings(roomId, tabText) {
|
2022-01-29 09:18:06 +01:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SPACE_SETTINGS,
|
2022-02-16 15:55:36 +01:00
|
|
|
roomId,
|
2022-01-29 09:18:06 +01:00
|
|
|
tabText,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-16 15:55:36 +01:00
|
|
|
export function openSpaceManage(roomId) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SPACE_MANAGE,
|
|
|
|
roomId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-20 15:47:13 +01:00
|
|
|
export function openSpaceAddExisting(roomId) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SPACE_ADDEXISTING,
|
|
|
|
roomId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-16 13:48:33 +01:00
|
|
|
export function toggleRoomSettings(tabText) {
|
2021-12-22 15:48:32 +01:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.TOGGLE_ROOM_SETTINGS,
|
2022-01-16 13:48:33 +01:00
|
|
|
tabText,
|
2021-12-22 15:48:32 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-03-06 13:22:04 +01:00
|
|
|
export function openShortcutSpaces() {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SHORTCUT_SPACES,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openInviteList() {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_INVITE_LIST,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openPublicRooms(searchTerm) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
2021-08-31 15:13:31 +02:00
|
|
|
type: cons.actions.navigation.OPEN_PUBLIC_ROOMS,
|
2021-08-08 11:15:21 +02:00
|
|
|
searchTerm,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-26 16:30:52 +01:00
|
|
|
export function openCreateRoom(isSpace = false, parentId = null) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
2021-08-31 15:13:31 +02:00
|
|
|
type: cons.actions.navigation.OPEN_CREATE_ROOM,
|
2022-02-26 16:30:52 +01:00
|
|
|
isSpace,
|
|
|
|
parentId,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openInviteUser(roomId, searchTerm) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_INVITE_USER,
|
|
|
|
roomId,
|
2021-08-08 06:53:26 +02:00
|
|
|
searchTerm,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openProfileViewer(userId, roomId) {
|
2021-10-18 17:25:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_PROFILE_VIEWER,
|
|
|
|
userId,
|
|
|
|
roomId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-03-21 05:16:11 +01:00
|
|
|
export function openSettings(tabText) {
|
2021-07-28 15:15:52 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SETTINGS,
|
2022-03-21 05:16:11 +01:00
|
|
|
tabText,
|
2021-07-28 15:15:52 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openEmojiBoard(cords, requestEmojiCallback) {
|
2021-08-14 06:49:29 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_EMOJIBOARD,
|
|
|
|
cords,
|
|
|
|
requestEmojiCallback,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openReadReceipts(roomId, userIds) {
|
2021-08-16 14:07:29 +02:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_READRECEIPTS,
|
|
|
|
roomId,
|
2021-12-03 14:02:10 +01:00
|
|
|
userIds,
|
2021-08-16 14:07:29 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-22 14:31:04 +01:00
|
|
|
export function openViewSource(event) {
|
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_VIEWSOURCE,
|
|
|
|
event,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function replyTo(userId, eventId, body) {
|
2021-11-20 08:59:32 +01:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.CLICK_REPLY_TO,
|
|
|
|
userId,
|
|
|
|
eventId,
|
|
|
|
body,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-11 06:20:34 +01:00
|
|
|
export function openSearch(term) {
|
2021-12-10 12:52:53 +01:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_SEARCH,
|
|
|
|
term,
|
|
|
|
});
|
|
|
|
}
|
2022-01-11 16:16:41 +01:00
|
|
|
|
2022-01-13 14:13:22 +01:00
|
|
|
export function openReusableContextMenu(placement, cords, render, afterClose) {
|
2022-01-11 16:16:41 +01:00
|
|
|
appDispatcher.dispatch({
|
|
|
|
type: cons.actions.navigation.OPEN_REUSABLE_CONTEXT_MENU,
|
|
|
|
placement,
|
|
|
|
cords,
|
|
|
|
render,
|
2022-01-13 14:13:22 +01:00
|
|
|
afterClose,
|
2022-01-11 16:16:41 +01:00
|
|
|
});
|
|
|
|
}
|