2022-05-31 17:38:23 +00:00
|
|
|
// Copyright 2018-2022 Signal Messenger, LLC
|
2020-10-30 15:34:04 -05:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2018-05-04 18:57:11 -07:00
|
|
|
// The idea with this file is to make it webpackable for the style guide
|
|
|
|
|
2018-05-23 11:09:37 -07:00
|
|
|
const Backbone = require('../../ts/backbone');
|
2020-03-31 13:03:38 -07:00
|
|
|
const Crypto = require('../../ts/Crypto');
|
2021-04-16 16:13:13 -07:00
|
|
|
const Curve = require('../../ts/Curve');
|
2020-07-10 11:28:49 -07:00
|
|
|
const {
|
|
|
|
start: conversationControllerStart,
|
|
|
|
} = require('../../ts/ConversationController');
|
2020-04-01 11:59:11 -07:00
|
|
|
const Data = require('../../ts/sql/Client').default;
|
2019-06-20 17:48:54 -07:00
|
|
|
const EmojiLib = require('../../ts/components/emoji/lib');
|
2020-09-08 19:25:05 -07:00
|
|
|
const Groups = require('../../ts/groups');
|
|
|
|
const GroupChange = require('../../ts/groupChange');
|
2018-05-23 11:09:37 -07:00
|
|
|
const OS = require('../../ts/OS');
|
2021-07-09 12:36:10 -07:00
|
|
|
const Stickers = require('../../ts/types/Stickers');
|
2020-05-27 17:37:06 -04:00
|
|
|
const RemoteConfig = require('../../ts/RemoteConfig');
|
2018-05-23 11:09:37 -07:00
|
|
|
const Util = require('../../ts/util');
|
2018-05-04 18:57:11 -07:00
|
|
|
|
|
|
|
// Components
|
2018-12-01 17:48:53 -08:00
|
|
|
const {
|
|
|
|
AttachmentList,
|
|
|
|
} = require('../../ts/components/conversation/AttachmentList');
|
2021-05-28 12:15:17 -04:00
|
|
|
const { ChatColorPicker } = require('../../ts/components/ChatColorPicker');
|
2021-04-27 12:29:59 -07:00
|
|
|
const {
|
|
|
|
ConfirmationDialog,
|
|
|
|
} = require('../../ts/components/ConfirmationDialog');
|
2020-11-11 09:36:05 -08:00
|
|
|
const {
|
|
|
|
ContactModal,
|
|
|
|
} = require('../../ts/components/conversation/ContactModal');
|
2018-05-23 11:09:37 -07:00
|
|
|
const { Emojify } = require('../../ts/components/conversation/Emojify');
|
2018-07-09 14:29:13 -07:00
|
|
|
const {
|
|
|
|
MessageDetail,
|
|
|
|
} = require('../../ts/components/conversation/MessageDetail');
|
2018-05-23 11:09:37 -07:00
|
|
|
const { Quote } = require('../../ts/components/conversation/Quote');
|
2019-01-15 19:03:56 -08:00
|
|
|
const {
|
|
|
|
StagedLinkPreview,
|
|
|
|
} = require('../../ts/components/conversation/StagedLinkPreview');
|
2021-06-01 13:45:43 -07:00
|
|
|
const {
|
|
|
|
DisappearingTimeDialog,
|
2021-06-25 16:52:56 -07:00
|
|
|
} = require('../../ts/components/DisappearingTimeDialog');
|
2021-06-29 12:18:03 -05:00
|
|
|
const {
|
|
|
|
SystemTraySettingsCheckboxes,
|
|
|
|
} = require('../../ts/components/conversation/SystemTraySettingsCheckboxes');
|
2018-05-04 18:57:11 -07:00
|
|
|
|
2019-01-14 13:49:58 -08:00
|
|
|
// State
|
2021-05-28 12:15:17 -04:00
|
|
|
const {
|
|
|
|
createChatColorPicker,
|
|
|
|
} = require('../../ts/state/roots/createChatColorPicker');
|
2021-01-29 16:19:24 -05:00
|
|
|
const {
|
|
|
|
createConversationDetails,
|
|
|
|
} = require('../../ts/state/roots/createConversationDetails');
|
2021-06-14 15:01:00 -04:00
|
|
|
const { createApp } = require('../../ts/state/roots/createApp');
|
2021-04-27 15:35:35 -07:00
|
|
|
const {
|
|
|
|
createForwardMessageModal,
|
|
|
|
} = require('../../ts/state/roots/createForwardMessageModal');
|
2021-01-29 16:19:24 -05:00
|
|
|
const {
|
|
|
|
createGroupLinkManagement,
|
|
|
|
} = require('../../ts/state/roots/createGroupLinkManagement');
|
2020-12-01 08:42:35 -08:00
|
|
|
const {
|
|
|
|
createGroupV1MigrationModal,
|
|
|
|
} = require('../../ts/state/roots/createGroupV1MigrationModal');
|
2021-01-29 14:16:48 -08:00
|
|
|
const {
|
|
|
|
createGroupV2JoinModal,
|
|
|
|
} = require('../../ts/state/roots/createGroupV2JoinModal');
|
2019-06-27 16:35:21 -04:00
|
|
|
const { createLeftPane } = require('../../ts/state/roots/createLeftPane');
|
2021-03-24 17:06:12 -05:00
|
|
|
const {
|
|
|
|
createMessageDetail,
|
|
|
|
} = require('../../ts/state/roots/createMessageDetail');
|
2021-08-05 07:35:33 -05:00
|
|
|
const {
|
|
|
|
createConversationNotificationsSettings,
|
|
|
|
} = require('../../ts/state/roots/createConversationNotificationsSettings');
|
2021-01-29 16:19:24 -05:00
|
|
|
const {
|
|
|
|
createGroupV2Permissions,
|
|
|
|
} = require('../../ts/state/roots/createGroupV2Permissions');
|
|
|
|
const {
|
|
|
|
createPendingInvites,
|
|
|
|
} = require('../../ts/state/roots/createPendingInvites');
|
2020-06-25 20:08:58 -04:00
|
|
|
const {
|
|
|
|
createSafetyNumberViewer,
|
|
|
|
} = require('../../ts/state/roots/createSafetyNumberViewer');
|
2019-05-16 15:32:11 -07:00
|
|
|
const {
|
|
|
|
createStickerManager,
|
|
|
|
} = require('../../ts/state/roots/createStickerManager');
|
|
|
|
const {
|
|
|
|
createStickerPreviewModal,
|
|
|
|
} = require('../../ts/state/roots/createStickerPreviewModal');
|
2019-11-07 13:36:16 -08:00
|
|
|
const {
|
|
|
|
createShortcutGuideModal,
|
|
|
|
} = require('../../ts/state/roots/createShortcutGuideModal');
|
2019-05-16 15:32:11 -07:00
|
|
|
|
2019-01-14 13:49:58 -08:00
|
|
|
const { createStore } = require('../../ts/state/createStore');
|
2021-06-14 15:01:00 -04:00
|
|
|
const appDuck = require('../../ts/state/ducks/app');
|
2020-06-04 11:16:19 -07:00
|
|
|
const callingDuck = require('../../ts/state/ducks/calling');
|
2019-01-14 13:49:58 -08:00
|
|
|
const conversationsDuck = require('../../ts/state/ducks/conversations');
|
2019-05-24 16:58:27 -07:00
|
|
|
const emojisDuck = require('../../ts/state/ducks/emojis');
|
2020-02-12 13:30:58 -08:00
|
|
|
const expirationDuck = require('../../ts/state/ducks/expiration');
|
2019-05-16 15:32:11 -07:00
|
|
|
const itemsDuck = require('../../ts/state/ducks/items');
|
2021-04-27 15:35:35 -07:00
|
|
|
const linkPreviewsDuck = require('../../ts/state/ducks/linkPreviews');
|
2020-02-12 13:30:58 -08:00
|
|
|
const networkDuck = require('../../ts/state/ducks/network');
|
2019-08-09 16:12:29 -07:00
|
|
|
const searchDuck = require('../../ts/state/ducks/search');
|
2019-05-16 15:32:11 -07:00
|
|
|
const stickersDuck = require('../../ts/state/ducks/stickers');
|
2020-02-12 13:30:58 -08:00
|
|
|
const updatesDuck = require('../../ts/state/ducks/updates');
|
2019-01-14 13:49:58 -08:00
|
|
|
const userDuck = require('../../ts/state/ducks/user');
|
|
|
|
|
2019-11-07 13:36:16 -08:00
|
|
|
const conversationsSelectors = require('../../ts/state/selectors/conversations');
|
2019-11-14 16:29:39 -08:00
|
|
|
const searchSelectors = require('../../ts/state/selectors/search');
|
2019-11-07 13:36:16 -08:00
|
|
|
|
2018-05-04 18:57:11 -07:00
|
|
|
// Types
|
2021-07-14 16:39:52 -07:00
|
|
|
const AttachmentType = require('../../ts/types/Attachment');
|
2021-09-23 17:49:05 -07:00
|
|
|
const VisualAttachment = require('../../ts/types/VisualAttachment');
|
2018-07-09 14:29:13 -07:00
|
|
|
const MessageType = require('./types/message');
|
2021-09-09 19:38:11 -07:00
|
|
|
const { UUID } = require('../../ts/types/UUID');
|
|
|
|
const { Address } = require('../../ts/types/Address');
|
|
|
|
const { QualifiedAddress } = require('../../ts/types/QualifiedAddress');
|
2018-05-04 18:57:11 -07:00
|
|
|
|
2020-02-12 13:30:58 -08:00
|
|
|
// Processes / Services
|
2020-09-08 19:25:05 -07:00
|
|
|
const {
|
|
|
|
initializeGroupCredentialFetcher,
|
|
|
|
} = require('../../ts/services/groupCredentialFetcher');
|
2020-02-12 13:30:58 -08:00
|
|
|
const {
|
|
|
|
initializeNetworkObserver,
|
|
|
|
} = require('../../ts/services/networkObserver');
|
|
|
|
const {
|
|
|
|
initializeUpdateListener,
|
|
|
|
} = require('../../ts/services/updateListener');
|
2020-06-04 11:16:19 -07:00
|
|
|
const { calling } = require('../../ts/services/calling');
|
2020-09-08 20:56:23 -04:00
|
|
|
const {
|
2020-09-29 19:29:11 -04:00
|
|
|
enableStorageService,
|
2020-09-08 20:56:23 -04:00
|
|
|
eraseAllStorageServiceState,
|
|
|
|
runStorageServiceSyncJob,
|
|
|
|
storageServiceUploadJob,
|
|
|
|
} = require('../../ts/services/storage');
|
2020-02-12 13:30:58 -08:00
|
|
|
|
2018-07-03 15:33:50 -07:00
|
|
|
function initializeMigrations({
|
|
|
|
userDataPath,
|
|
|
|
getRegionCode,
|
2018-07-09 14:29:13 -07:00
|
|
|
Attachments,
|
|
|
|
Type,
|
|
|
|
VisualType,
|
2018-07-21 12:00:08 -07:00
|
|
|
logger,
|
2018-07-03 15:33:50 -07:00
|
|
|
}) {
|
|
|
|
if (!Attachments) {
|
|
|
|
return null;
|
|
|
|
}
|
2018-07-09 14:29:13 -07:00
|
|
|
const {
|
2019-08-06 17:40:25 -07:00
|
|
|
createAbsolutePathGetter,
|
|
|
|
createReader,
|
|
|
|
createWriterForExisting,
|
|
|
|
createWriterForNew,
|
2019-12-03 12:02:50 -08:00
|
|
|
createDoesExist,
|
2021-08-05 20:17:05 -04:00
|
|
|
getAvatarsPath,
|
2019-08-06 17:40:25 -07:00
|
|
|
getDraftPath,
|
2018-07-09 14:29:13 -07:00
|
|
|
getPath,
|
2019-05-16 15:32:11 -07:00
|
|
|
getStickersPath,
|
2021-11-02 18:01:13 -05:00
|
|
|
getBadgesPath,
|
2019-05-23 18:27:42 -07:00
|
|
|
getTempPath,
|
2020-01-15 14:23:02 -08:00
|
|
|
openFileInFolder,
|
|
|
|
saveAttachmentToDisk,
|
2018-07-09 14:29:13 -07:00
|
|
|
} = Attachments;
|
|
|
|
const {
|
|
|
|
getImageDimensions,
|
|
|
|
makeImageThumbnail,
|
2019-08-06 17:40:25 -07:00
|
|
|
makeObjectUrl,
|
2018-07-09 14:29:13 -07:00
|
|
|
makeVideoScreenshot,
|
2019-08-06 17:40:25 -07:00
|
|
|
revokeObjectUrl,
|
2018-07-09 14:29:13 -07:00
|
|
|
} = VisualType;
|
|
|
|
|
|
|
|
const attachmentsPath = getPath(userDataPath);
|
|
|
|
const readAttachmentData = createReader(attachmentsPath);
|
2018-07-03 15:33:50 -07:00
|
|
|
const loadAttachmentData = Type.loadData(readAttachmentData);
|
2022-04-11 13:57:44 -07:00
|
|
|
const loadContactData = MessageType.loadContactData(loadAttachmentData);
|
2019-01-28 15:24:19 -08:00
|
|
|
const loadPreviewData = MessageType.loadPreviewData(loadAttachmentData);
|
|
|
|
const loadQuoteData = MessageType.loadQuoteData(loadAttachmentData);
|
2019-05-16 15:32:11 -07:00
|
|
|
const loadStickerData = MessageType.loadStickerData(loadAttachmentData);
|
2018-07-09 14:29:13 -07:00
|
|
|
const getAbsoluteAttachmentPath = createAbsolutePathGetter(attachmentsPath);
|
2018-07-24 11:55:24 -07:00
|
|
|
const deleteOnDisk = Attachments.createDeleter(attachmentsPath);
|
2019-01-30 12:15:07 -08:00
|
|
|
const writeNewAttachmentData = createWriterForNew(attachmentsPath);
|
2021-11-11 16:43:05 -06:00
|
|
|
const copyIntoAttachmentsDirectory =
|
|
|
|
Attachments.copyIntoAttachmentsDirectory(attachmentsPath);
|
2019-12-03 12:02:50 -08:00
|
|
|
const doesAttachmentExist = createDoesExist(attachmentsPath);
|
2019-05-16 15:32:11 -07:00
|
|
|
|
|
|
|
const stickersPath = getStickersPath(userDataPath);
|
|
|
|
const writeNewStickerData = createWriterForNew(stickersPath);
|
|
|
|
const getAbsoluteStickerPath = createAbsolutePathGetter(stickersPath);
|
|
|
|
const deleteSticker = Attachments.createDeleter(stickersPath);
|
|
|
|
const readStickerData = createReader(stickersPath);
|
2018-05-04 18:57:11 -07:00
|
|
|
|
2021-11-02 18:01:13 -05:00
|
|
|
const badgesPath = getBadgesPath(userDataPath);
|
|
|
|
const getAbsoluteBadgeImageFilePath = createAbsolutePathGetter(badgesPath);
|
|
|
|
const writeNewBadgeImageFileData = createWriterForNew(badgesPath, '.svg');
|
|
|
|
|
2019-05-23 18:27:42 -07:00
|
|
|
const tempPath = getTempPath(userDataPath);
|
|
|
|
const getAbsoluteTempPath = createAbsolutePathGetter(tempPath);
|
|
|
|
const writeNewTempData = createWriterForNew(tempPath);
|
|
|
|
const deleteTempFile = Attachments.createDeleter(tempPath);
|
|
|
|
const readTempData = createReader(tempPath);
|
2021-11-11 16:43:05 -06:00
|
|
|
const copyIntoTempDirectory =
|
|
|
|
Attachments.copyIntoAttachmentsDirectory(tempPath);
|
2019-05-23 18:27:42 -07:00
|
|
|
|
2019-08-06 17:40:25 -07:00
|
|
|
const draftPath = getDraftPath(userDataPath);
|
|
|
|
const getAbsoluteDraftPath = createAbsolutePathGetter(draftPath);
|
|
|
|
const writeNewDraftData = createWriterForNew(draftPath);
|
|
|
|
const deleteDraftFile = Attachments.createDeleter(draftPath);
|
|
|
|
const readDraftData = createReader(draftPath);
|
|
|
|
|
2021-08-05 20:17:05 -04:00
|
|
|
const avatarsPath = getAvatarsPath(userDataPath);
|
|
|
|
const getAbsoluteAvatarPath = createAbsolutePathGetter(avatarsPath);
|
|
|
|
const writeNewAvatarData = createWriterForNew(avatarsPath);
|
|
|
|
const deleteAvatar = Attachments.createDeleter(avatarsPath);
|
|
|
|
|
2018-07-03 15:33:50 -07:00
|
|
|
return {
|
2018-05-04 18:57:11 -07:00
|
|
|
attachmentsPath,
|
2019-05-16 15:32:11 -07:00
|
|
|
copyIntoAttachmentsDirectory,
|
2019-08-05 13:53:15 -07:00
|
|
|
copyIntoTempDirectory,
|
2018-10-24 11:31:01 -07:00
|
|
|
deleteAttachmentData: deleteOnDisk,
|
2021-08-05 20:17:05 -04:00
|
|
|
deleteAvatar,
|
2019-08-06 17:40:25 -07:00
|
|
|
deleteDraftFile,
|
2018-07-24 11:55:24 -07:00
|
|
|
deleteExternalMessageFiles: MessageType.deleteAllExternalFiles({
|
|
|
|
deleteAttachmentData: Type.deleteData(deleteOnDisk),
|
|
|
|
deleteOnDisk,
|
|
|
|
}),
|
2019-05-16 15:32:11 -07:00
|
|
|
deleteSticker,
|
2019-05-23 18:27:42 -07:00
|
|
|
deleteTempFile,
|
2019-12-03 12:02:50 -08:00
|
|
|
doesAttachmentExist,
|
2018-07-09 14:29:13 -07:00
|
|
|
getAbsoluteAttachmentPath,
|
2021-08-05 20:17:05 -04:00
|
|
|
getAbsoluteAvatarPath,
|
2021-11-02 18:01:13 -05:00
|
|
|
getAbsoluteBadgeImageFilePath,
|
2019-08-06 17:40:25 -07:00
|
|
|
getAbsoluteDraftPath,
|
2019-05-16 15:32:11 -07:00
|
|
|
getAbsoluteStickerPath,
|
2019-08-05 13:53:15 -07:00
|
|
|
getAbsoluteTempPath,
|
2018-05-04 18:57:11 -07:00
|
|
|
loadAttachmentData,
|
2022-04-11 13:57:44 -07:00
|
|
|
loadContactData,
|
2018-07-09 14:29:13 -07:00
|
|
|
loadMessage: MessageType.createAttachmentLoader(loadAttachmentData),
|
2019-01-15 19:03:56 -08:00
|
|
|
loadPreviewData,
|
|
|
|
loadQuoteData,
|
2019-05-16 15:32:11 -07:00
|
|
|
loadStickerData,
|
2020-01-15 14:23:02 -08:00
|
|
|
openFileInFolder,
|
2018-12-13 13:41:42 -08:00
|
|
|
readAttachmentData,
|
2019-08-06 17:40:25 -07:00
|
|
|
readDraftData,
|
2019-05-16 15:32:11 -07:00
|
|
|
readStickerData,
|
2019-05-23 18:27:42 -07:00
|
|
|
readTempData,
|
2020-01-15 14:23:02 -08:00
|
|
|
saveAttachmentToDisk,
|
2019-01-30 12:15:07 -08:00
|
|
|
processNewAttachment: attachment =>
|
|
|
|
MessageType.processNewAttachment(attachment, {
|
|
|
|
writeNewAttachmentData,
|
|
|
|
getAbsoluteAttachmentPath,
|
|
|
|
makeObjectUrl,
|
|
|
|
revokeObjectUrl,
|
|
|
|
getImageDimensions,
|
|
|
|
makeImageThumbnail,
|
|
|
|
makeVideoScreenshot,
|
|
|
|
logger,
|
|
|
|
}),
|
2019-05-16 15:32:11 -07:00
|
|
|
processNewSticker: stickerData =>
|
|
|
|
MessageType.processNewSticker(stickerData, {
|
|
|
|
writeNewStickerData,
|
|
|
|
getAbsoluteStickerPath,
|
|
|
|
getImageDimensions,
|
|
|
|
logger,
|
|
|
|
}),
|
2019-05-23 18:27:42 -07:00
|
|
|
processNewEphemeralSticker: stickerData =>
|
|
|
|
MessageType.processNewSticker(stickerData, {
|
|
|
|
writeNewStickerData: writeNewTempData,
|
|
|
|
getAbsoluteStickerPath: getAbsoluteTempPath,
|
|
|
|
getImageDimensions,
|
|
|
|
logger,
|
|
|
|
}),
|
2018-07-26 19:19:34 -07:00
|
|
|
upgradeMessageSchema: (message, options = {}) => {
|
|
|
|
const { maxVersion } = options;
|
|
|
|
|
|
|
|
return MessageType.upgradeSchema(message, {
|
2019-01-30 12:15:07 -08:00
|
|
|
writeNewAttachmentData,
|
2018-05-08 18:03:02 -07:00
|
|
|
getRegionCode,
|
2018-07-09 14:29:13 -07:00
|
|
|
getAbsoluteAttachmentPath,
|
|
|
|
makeObjectUrl,
|
|
|
|
revokeObjectUrl,
|
|
|
|
getImageDimensions,
|
|
|
|
makeImageThumbnail,
|
|
|
|
makeVideoScreenshot,
|
2018-07-21 12:00:08 -07:00
|
|
|
logger,
|
2018-07-26 19:19:34 -07:00
|
|
|
maxVersion,
|
|
|
|
});
|
|
|
|
},
|
2018-07-21 12:00:08 -07:00
|
|
|
writeMessageAttachments: MessageType.createAttachmentDataWriter({
|
|
|
|
writeExistingAttachmentData: createWriterForExisting(attachmentsPath),
|
|
|
|
logger,
|
|
|
|
}),
|
2018-10-24 11:31:01 -07:00
|
|
|
writeNewAttachmentData: createWriterForNew(attachmentsPath),
|
2021-08-05 20:17:05 -04:00
|
|
|
writeNewAvatarData,
|
2019-08-06 17:40:25 -07:00
|
|
|
writeNewDraftData,
|
2021-11-02 18:01:13 -05:00
|
|
|
writeNewBadgeImageFileData,
|
2018-05-04 18:57:11 -07:00
|
|
|
};
|
2018-07-03 15:33:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
exports.setup = (options = {}) => {
|
2018-07-21 12:00:08 -07:00
|
|
|
const { Attachments, userDataPath, getRegionCode, logger } = options;
|
2018-07-03 15:33:50 -07:00
|
|
|
|
|
|
|
const Migrations = initializeMigrations({
|
|
|
|
userDataPath,
|
|
|
|
getRegionCode,
|
2018-07-09 14:29:13 -07:00
|
|
|
Attachments,
|
|
|
|
Type: AttachmentType,
|
|
|
|
VisualType: VisualAttachment,
|
2018-07-21 12:00:08 -07:00
|
|
|
logger,
|
2018-07-03 15:33:50 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
const Components = {
|
2018-12-01 17:48:53 -08:00
|
|
|
AttachmentList,
|
2021-05-28 12:15:17 -04:00
|
|
|
ChatColorPicker,
|
2021-04-27 12:29:59 -07:00
|
|
|
ConfirmationDialog,
|
2020-11-11 09:36:05 -08:00
|
|
|
ContactModal,
|
2018-07-03 15:33:50 -07:00
|
|
|
Emojify,
|
2018-07-09 14:29:13 -07:00
|
|
|
MessageDetail,
|
|
|
|
Quote,
|
2019-01-15 19:03:56 -08:00
|
|
|
StagedLinkPreview,
|
2021-06-01 13:45:43 -07:00
|
|
|
DisappearingTimeDialog,
|
2021-06-29 12:18:03 -05:00
|
|
|
SystemTraySettingsCheckboxes,
|
2018-07-03 15:33:50 -07:00
|
|
|
};
|
2018-05-04 18:57:11 -07:00
|
|
|
|
2019-01-14 13:49:58 -08:00
|
|
|
const Roots = {
|
2021-06-14 15:01:00 -04:00
|
|
|
createApp,
|
2021-05-28 12:15:17 -04:00
|
|
|
createChatColorPicker,
|
2021-01-29 16:19:24 -05:00
|
|
|
createConversationDetails,
|
2021-04-27 15:35:35 -07:00
|
|
|
createForwardMessageModal,
|
2021-01-29 16:19:24 -05:00
|
|
|
createGroupLinkManagement,
|
2020-12-01 08:42:35 -08:00
|
|
|
createGroupV1MigrationModal,
|
2021-01-29 14:16:48 -08:00
|
|
|
createGroupV2JoinModal,
|
2021-01-29 16:19:24 -05:00
|
|
|
createGroupV2Permissions,
|
2019-01-14 13:49:58 -08:00
|
|
|
createLeftPane,
|
2021-03-24 17:06:12 -05:00
|
|
|
createMessageDetail,
|
2021-08-05 07:35:33 -05:00
|
|
|
createConversationNotificationsSettings,
|
2021-01-29 16:19:24 -05:00
|
|
|
createPendingInvites,
|
2020-06-25 20:08:58 -04:00
|
|
|
createSafetyNumberViewer,
|
2019-11-07 13:36:16 -08:00
|
|
|
createShortcutGuideModal,
|
2019-05-16 15:32:11 -07:00
|
|
|
createStickerManager,
|
|
|
|
createStickerPreviewModal,
|
2019-01-14 13:49:58 -08:00
|
|
|
};
|
2020-02-12 13:30:58 -08:00
|
|
|
|
2019-01-14 13:49:58 -08:00
|
|
|
const Ducks = {
|
2021-06-14 15:01:00 -04:00
|
|
|
app: appDuck,
|
2020-06-04 11:16:19 -07:00
|
|
|
calling: callingDuck,
|
2019-01-14 13:49:58 -08:00
|
|
|
conversations: conversationsDuck,
|
2019-05-24 16:58:27 -07:00
|
|
|
emojis: emojisDuck,
|
2020-02-12 13:30:58 -08:00
|
|
|
expiration: expirationDuck,
|
2019-05-16 15:32:11 -07:00
|
|
|
items: itemsDuck,
|
2021-04-27 15:35:35 -07:00
|
|
|
linkPreviews: linkPreviewsDuck,
|
2020-02-12 13:30:58 -08:00
|
|
|
network: networkDuck,
|
|
|
|
updates: updatesDuck,
|
2019-01-14 13:49:58 -08:00
|
|
|
user: userDuck,
|
2019-08-09 16:12:29 -07:00
|
|
|
search: searchDuck,
|
2019-05-16 15:32:11 -07:00
|
|
|
stickers: stickersDuck,
|
2019-01-14 13:49:58 -08:00
|
|
|
};
|
2020-02-12 13:30:58 -08:00
|
|
|
|
2019-11-07 13:36:16 -08:00
|
|
|
const Selectors = {
|
|
|
|
conversations: conversationsSelectors,
|
2019-11-14 16:29:39 -08:00
|
|
|
search: searchSelectors,
|
2019-11-07 13:36:16 -08:00
|
|
|
};
|
|
|
|
|
2020-02-12 13:30:58 -08:00
|
|
|
const Services = {
|
2020-09-08 20:56:23 -04:00
|
|
|
calling,
|
2020-09-29 19:29:11 -04:00
|
|
|
enableStorageService,
|
2020-09-08 20:56:23 -04:00
|
|
|
eraseAllStorageServiceState,
|
2020-09-08 19:25:05 -07:00
|
|
|
initializeGroupCredentialFetcher,
|
2020-02-12 13:30:58 -08:00
|
|
|
initializeNetworkObserver,
|
|
|
|
initializeUpdateListener,
|
2020-09-08 20:56:23 -04:00
|
|
|
runStorageServiceSyncJob,
|
|
|
|
storageServiceUploadJob,
|
2020-02-12 13:30:58 -08:00
|
|
|
};
|
|
|
|
|
2019-01-14 13:49:58 -08:00
|
|
|
const State = {
|
|
|
|
createStore,
|
|
|
|
Roots,
|
|
|
|
Ducks,
|
2019-11-07 13:36:16 -08:00
|
|
|
Selectors,
|
2019-01-14 13:49:58 -08:00
|
|
|
};
|
|
|
|
|
2018-05-04 18:57:11 -07:00
|
|
|
const Types = {
|
2018-07-09 14:29:13 -07:00
|
|
|
Message: MessageType,
|
2021-09-23 17:49:05 -07:00
|
|
|
|
|
|
|
// Mostly for debugging
|
2021-09-09 19:38:11 -07:00
|
|
|
UUID,
|
|
|
|
Address,
|
|
|
|
QualifiedAddress,
|
2018-05-04 18:57:11 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
Backbone,
|
|
|
|
Components,
|
|
|
|
Crypto,
|
2021-04-16 16:13:13 -07:00
|
|
|
Curve,
|
2020-07-10 11:28:49 -07:00
|
|
|
conversationControllerStart,
|
2018-07-25 15:02:27 -07:00
|
|
|
Data,
|
2019-06-20 17:48:54 -07:00
|
|
|
EmojiLib,
|
2020-09-08 19:25:05 -07:00
|
|
|
Groups,
|
|
|
|
GroupChange,
|
2018-05-04 18:57:11 -07:00
|
|
|
Migrations,
|
|
|
|
OS,
|
2020-05-27 17:37:06 -04:00
|
|
|
RemoteConfig,
|
2020-02-12 13:30:58 -08:00
|
|
|
Services,
|
2019-01-14 13:49:58 -08:00
|
|
|
State,
|
2019-05-16 15:32:11 -07:00
|
|
|
Stickers,
|
2018-05-04 18:57:11 -07:00
|
|
|
Types,
|
|
|
|
Util,
|
|
|
|
};
|
|
|
|
};
|