2020-05-14 02:46:00 +00:00
|
|
|
/*
|
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Dispatcher actions also extend into any arbitrary string, so support that.
|
|
|
|
export type DispatcherAction = Action | string;
|
|
|
|
|
|
|
|
export enum Action {
|
|
|
|
// TODO: Populate with actual actions
|
2020-05-14 03:03:12 +00:00
|
|
|
// This is lazily generated as it also includes fixing a bunch of references. Work
|
|
|
|
// that we don't really want to take on in a giant chunk. We should always define
|
|
|
|
// new actions here, and ideally when we touch existing ones we take some time to
|
|
|
|
// define them correctly.
|
|
|
|
|
|
|
|
// When defining a new action, please use lower_scored_case with an optional class
|
|
|
|
// name prefix. For example, `RoomListStore.view_room` or `view_user_settings`.
|
|
|
|
// New definitions should also receive an accompanying interface in the payloads
|
|
|
|
// directory.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* View a user's profile. Should be used with a ViewUserPayload.
|
|
|
|
*/
|
|
|
|
ViewUser = "view_user",
|
2020-05-14 03:07:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Open the user settings. No additional payload information required.
|
2020-06-08 14:20:15 +00:00
|
|
|
* Optionally can include an OpenToTabPayload.
|
2020-05-14 03:07:19 +00:00
|
|
|
*/
|
|
|
|
ViewUserSettings = "view_user_settings",
|
2020-05-25 12:40:05 +00:00
|
|
|
|
2022-10-11 09:10:55 +00:00
|
|
|
/**
|
|
|
|
* Open the user device settings. No additional payload information required.
|
|
|
|
*/
|
|
|
|
ViewUserDeviceSettings = "view_user_device_settings",
|
|
|
|
|
2020-06-09 02:33:21 +00:00
|
|
|
/**
|
|
|
|
* Opens the room directory. No additional payload information required.
|
|
|
|
*/
|
|
|
|
ViewRoomDirectory = "view_room_directory",
|
|
|
|
|
2022-02-22 10:04:27 +00:00
|
|
|
/**
|
|
|
|
* Fires when viewing room by room_alias fails to find room
|
|
|
|
*/
|
|
|
|
ViewRoomError = "view_room_error",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Navigates to app home
|
|
|
|
*/
|
|
|
|
ViewHomePage = "view_home_page",
|
|
|
|
|
2020-05-28 12:55:07 +00:00
|
|
|
/**
|
2020-05-29 17:24:45 +00:00
|
|
|
* Forces the theme to reload. No additional payload information required.
|
2020-05-28 12:55:07 +00:00
|
|
|
*/
|
|
|
|
RecheckTheme = "recheck_theme",
|
2020-05-29 17:24:45 +00:00
|
|
|
|
|
|
|
/**
|
2020-05-29 19:50:47 +00:00
|
|
|
* Provide status information for an ongoing update check. Should be used with a CheckUpdatesPayload.
|
2020-05-29 17:24:45 +00:00
|
|
|
*/
|
|
|
|
CheckUpdates = "check_updates",
|
2020-06-03 01:07:46 +00:00
|
|
|
|
|
|
|
/**
|
2021-11-19 17:15:15 +00:00
|
|
|
* Focuses the user's cursor to the send message composer. Should be used with a FocusComposerPayload.
|
2020-06-03 01:07:46 +00:00
|
|
|
*/
|
2021-07-08 15:37:39 +00:00
|
|
|
FocusSendMessageComposer = "focus_send_message_composer",
|
2020-06-08 04:06:41 +00:00
|
|
|
|
2022-10-19 10:45:51 +00:00
|
|
|
/**
|
|
|
|
* Clear the to the send message composer. Should be used with a FocusComposerPayload.
|
|
|
|
*/
|
|
|
|
ClearAndFocusSendMessageComposer = "clear_focus_send_message_composer",
|
|
|
|
|
2021-07-08 15:33:49 +00:00
|
|
|
/**
|
2021-11-19 17:15:15 +00:00
|
|
|
* Focuses the user's cursor to the edit message composer. Should be used with a FocusComposerPayload.
|
2021-07-08 15:33:49 +00:00
|
|
|
*/
|
|
|
|
FocusEditMessageComposer = "focus_edit_message_composer",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Focuses the user's cursor to the edit message composer or send message
|
2022-03-02 16:31:34 +00:00
|
|
|
* composer based on the current edit state. Should be used with a FocusComposerPayload.
|
2021-07-08 15:33:49 +00:00
|
|
|
*/
|
|
|
|
FocusAComposer = "focus_a_composer",
|
|
|
|
|
2020-06-08 04:06:41 +00:00
|
|
|
/**
|
|
|
|
* Opens the user menu (previously known as the top left menu). No additional payload information required.
|
|
|
|
*/
|
|
|
|
ToggleUserMenu = "toggle_user_menu",
|
2020-06-15 14:33:52 +00:00
|
|
|
|
2021-12-07 09:32:00 +00:00
|
|
|
/**
|
|
|
|
* Toggles the Space panel. No additional payload information required.
|
|
|
|
*/
|
|
|
|
ToggleSpacePanel = "toggle_space_panel",
|
|
|
|
|
2020-06-15 14:33:52 +00:00
|
|
|
/**
|
|
|
|
* Sets the apps root font size. Should be used with UpdateFontSizePayload
|
|
|
|
*/
|
2020-06-22 15:05:32 +00:00
|
|
|
UpdateFontSize = "update_font_size",
|
2020-06-15 14:33:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a system font. Should be used with UpdateSystemFontPayload
|
|
|
|
*/
|
2020-06-22 15:05:32 +00:00
|
|
|
UpdateSystemFont = "update_system_font",
|
2020-07-06 16:57:40 +00:00
|
|
|
|
2021-11-25 20:49:43 +00:00
|
|
|
/**
|
2022-02-10 14:29:55 +00:00
|
|
|
* Changes room based on payload parameters. Should be used with JoinRoomPayload.
|
2021-11-25 20:49:43 +00:00
|
|
|
*/
|
|
|
|
ViewRoom = "view_room",
|
|
|
|
|
2022-10-25 16:53:31 +00:00
|
|
|
/**
|
|
|
|
* Changes thread based on payload parameters. Should be used with ThreadPayload.
|
|
|
|
*/
|
|
|
|
ViewThread = "view_thread",
|
|
|
|
|
2020-07-06 16:57:40 +00:00
|
|
|
/**
|
|
|
|
* Changes room based on room list order and payload parameters. Should be used with ViewRoomDeltaPayload.
|
|
|
|
*/
|
|
|
|
ViewRoomDelta = "view_room_delta",
|
2020-07-18 11:04:48 +00:00
|
|
|
|
2020-12-23 19:02:01 +00:00
|
|
|
/**
|
|
|
|
* Opens the modal dial pad
|
|
|
|
*/
|
|
|
|
OpenDialPad = "open_dial_pad",
|
|
|
|
|
2021-06-02 16:39:13 +00:00
|
|
|
/**
|
|
|
|
* Dial the phone number in the payload
|
2021-06-03 13:38:13 +00:00
|
|
|
* payload: DialNumberPayload
|
2021-06-02 16:39:13 +00:00
|
|
|
*/
|
|
|
|
DialNumber = "dial_number",
|
|
|
|
|
2020-12-23 19:02:01 +00:00
|
|
|
/**
|
|
|
|
* Fired when CallHandler has checked for PSTN protocol support
|
2021-01-04 11:54:10 +00:00
|
|
|
* payload: none
|
2020-12-23 19:02:01 +00:00
|
|
|
* XXX: Is an action the right thing for this?
|
|
|
|
*/
|
|
|
|
PstnSupportUpdated = "pstn_support_updated",
|
2021-02-12 20:55:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Similar to PstnSupportUpdated, fired when CallHandler has checked for virtual room support
|
|
|
|
* payload: none
|
|
|
|
* XXX: Ditto
|
|
|
|
*/
|
|
|
|
VirtualRoomSupportUpdated = "virtual_room_support_updated",
|
2021-03-05 20:20:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when an upload has started. Should be used with UploadStartedPayload.
|
|
|
|
*/
|
|
|
|
UploadStarted = "upload_started",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when an upload makes progress. Should be used with UploadProgressPayload.
|
|
|
|
*/
|
|
|
|
UploadProgress = "upload_progress",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when an upload is completed. Should be used with UploadFinishedPayload.
|
|
|
|
*/
|
|
|
|
UploadFinished = "upload_finished",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when an upload fails. Should be used with UploadErrorPayload.
|
|
|
|
*/
|
|
|
|
UploadFailed = "upload_failed",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when an upload is cancelled by the user. Should be used with UploadCanceledPayload.
|
|
|
|
*/
|
|
|
|
UploadCanceled = "upload_canceled",
|
2021-05-24 17:23:04 +00:00
|
|
|
|
2021-05-24 13:34:06 +00:00
|
|
|
/**
|
2022-02-17 18:03:27 +00:00
|
|
|
* Fired when requesting to join a room. Should be used with JoinRoomPayload.
|
2021-05-24 13:34:06 +00:00
|
|
|
*/
|
|
|
|
JoinRoom = "join_room",
|
|
|
|
|
|
|
|
/**
|
2022-02-17 18:03:27 +00:00
|
|
|
* Fired when successfully joining a room. Should be used with a JoinRoomReadyPayload.
|
2021-05-24 13:34:06 +00:00
|
|
|
*/
|
|
|
|
JoinRoomReady = "join_room_ready",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when joining a room failed
|
|
|
|
*/
|
2021-05-27 07:57:48 +00:00
|
|
|
JoinRoomError = "join_room_error",
|
2021-06-15 12:58:13 +00:00
|
|
|
|
2022-03-18 20:08:32 +00:00
|
|
|
/**
|
|
|
|
* Fired when starting to bulk redact messages from a user in a room.
|
|
|
|
*/
|
|
|
|
BulkRedactStart = "bulk_redact_start",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when done bulk redacting messages from a user in a room.
|
|
|
|
*/
|
|
|
|
BulkRedactEnd = "bulk_redact_end",
|
|
|
|
|
2021-04-13 14:09:37 +00:00
|
|
|
/**
|
2022-02-17 18:03:27 +00:00
|
|
|
* Inserts content into the active composer. Should be used with ComposerInsertPayload.
|
2021-04-13 14:09:37 +00:00
|
|
|
*/
|
|
|
|
ComposerInsert = "composer_insert",
|
2021-06-22 13:11:37 +00:00
|
|
|
|
2021-05-24 17:23:04 +00:00
|
|
|
/**
|
|
|
|
* Switches space. Should be used with SwitchSpacePayload.
|
|
|
|
*/
|
|
|
|
SwitchSpace = "switch_space",
|
2021-07-27 16:19:45 +00:00
|
|
|
|
2021-07-28 18:08:59 +00:00
|
|
|
/**
|
2021-12-10 11:50:01 +00:00
|
|
|
* Signals to the visible space hierarchy that a change has occurred and that it should refresh.
|
2021-07-28 18:08:59 +00:00
|
|
|
*/
|
|
|
|
UpdateSpaceHierarchy = "update_space_hierarchy",
|
2021-07-29 15:09:18 +00:00
|
|
|
|
2021-07-27 16:19:45 +00:00
|
|
|
/**
|
|
|
|
* Fires when a monitored setting is updated,
|
|
|
|
* see SettingsStore::monitorSetting for more details.
|
|
|
|
* Should be used with SettingUpdatedPayload.
|
|
|
|
*/
|
|
|
|
SettingUpdated = "setting_updated",
|
2021-10-01 13:35:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fires when a user starts to edit event (e.g. up arrow in compositor)
|
|
|
|
*/
|
|
|
|
EditEvent = "edit_event",
|
2021-12-05 22:39:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The user accepted pseudonymous analytics (i.e. posthog) from the toast
|
|
|
|
* Payload: none
|
|
|
|
*/
|
|
|
|
PseudonymousAnalyticsAccept = "pseudonymous_analytics_accept",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The user rejected pseudonymous analytics (i.e. posthog) from the toast
|
|
|
|
* Payload: none
|
|
|
|
*/
|
|
|
|
PseudonymousAnalyticsReject = "pseudonymous_analytics_reject",
|
|
|
|
|
2022-02-11 13:00:37 +00:00
|
|
|
/**
|
|
|
|
* Fires after crypto is setup if key backup is not enabled
|
|
|
|
* Used to trigger auto rageshakes when configured
|
|
|
|
*/
|
|
|
|
ReportKeyBackupNotEnabled = "report_key_backup_not_enabled",
|
2022-02-22 10:04:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatched after leave room or space is finished
|
|
|
|
*/
|
|
|
|
AfterLeaveRoom = "after_leave_room",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to defer actions until after sync is complete
|
|
|
|
* LifecycleStore will emit deferredAction payload after 'MatrixActions.sync'
|
|
|
|
*/
|
|
|
|
DoAfterSyncPrepared = "do_after_sync_prepared",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when clicking user name from group view
|
|
|
|
*/
|
|
|
|
ViewStartChatOrReuse = "view_start_chat_or_reuse",
|
2022-03-24 21:50:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the user's active room changed, possibly from/to a non-room view.
|
|
|
|
* Payload: ActiveRoomChangedPayload
|
|
|
|
*/
|
|
|
|
ActiveRoomChanged = "active_room_changed",
|
2022-03-24 22:00:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the forward dialog needs to be opened.
|
|
|
|
* Payload: OpenForwardDialogPayload
|
|
|
|
*/
|
|
|
|
OpenForwardDialog = "open_forward_dialog",
|
2022-03-24 22:02:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the "report event" dialog needs to be opened.
|
|
|
|
* Payload: OpenReportEventDialogPayload.
|
|
|
|
*/
|
|
|
|
OpenReportEventDialog = "open_report_event_dialog",
|
2022-03-24 22:09:07 +00:00
|
|
|
|
2022-03-24 22:11:01 +00:00
|
|
|
/**
|
|
|
|
* Fired when something within the application has determined that a logout,
|
|
|
|
* or logout-like behaviour, needs to happen. Specifically meant to target
|
|
|
|
* storage deletion rather than calling the logout API.
|
|
|
|
*
|
|
|
|
* No payload.
|
|
|
|
*/
|
|
|
|
TriggerLogout = "trigger_logout",
|
2022-03-24 22:13:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the user's preferences for the given space. Used with a OpenSpacePreferencesPayload.
|
|
|
|
*/
|
|
|
|
OpenSpacePreferences = "open_space_preferences",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the settings for the given space. Used with a OpenSpaceSettingsPayload.
|
|
|
|
*/
|
|
|
|
OpenSpaceSettings = "open_space_settings",
|
2022-03-24 22:30:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the invite dialog. Used with a OpenInviteDialogPayload.
|
|
|
|
*/
|
|
|
|
OpenInviteDialog = "open_invite_dialog",
|
2022-03-25 00:01:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens a dialog to add an existing object to a space. Used with a OpenAddExistingToSpaceDialogPayload.
|
|
|
|
*/
|
|
|
|
OpenAddToExistingSpaceDialog = "open_add_to_existing_space_dialog",
|
2022-05-10 02:32:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Let components know that they should log any useful debugging information
|
|
|
|
* because we're probably about to send bug report which includes all of the
|
|
|
|
* logs. Fires with no payload.
|
|
|
|
*/
|
|
|
|
DumpDebugLogs = "dump_debug_logs",
|
2022-05-13 07:55:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show current room topic
|
|
|
|
*/
|
2022-05-26 08:56:53 +00:00
|
|
|
ShowRoomTopic = "show_room_topic",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the client was logged out. No additional payload information required.
|
|
|
|
*/
|
|
|
|
OnLoggedOut = "on_logged_out",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the client was logged in. No additional payload information required.
|
|
|
|
*/
|
|
|
|
OnLoggedIn = "on_logged_in",
|
2022-06-30 14:48:21 +00:00
|
|
|
|
2022-07-05 18:26:44 +00:00
|
|
|
/**
|
|
|
|
* Overwrites the existing login with fresh session credentials. Use with a OverwriteLoginPayload.
|
|
|
|
*/
|
|
|
|
OverwriteLogin = "overwrite_login",
|
|
|
|
|
2022-06-30 14:48:21 +00:00
|
|
|
/**
|
|
|
|
* Fired when the PlatformPeg gets a new platform set upon it, should only happen once per app load lifecycle.
|
|
|
|
* Fires with the PlatformSetPayload.
|
|
|
|
*/
|
|
|
|
PlatformSet = "platform_set",
|
2022-07-23 12:13:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when we want to view a thread, either a new one or an existing one
|
|
|
|
*/
|
|
|
|
ShowThread = "show_thread",
|
2020-05-14 02:46:00 +00:00
|
|
|
}
|