Replace MessageController with MessageCache
This commit is contained in:
parent
ba1a8aad09
commit
7d35216fda
73 changed files with 2237 additions and 1229 deletions
|
@ -10,18 +10,49 @@ import { sync } from 'fast-glob';
|
|||
import { assert } from 'chai';
|
||||
|
||||
import { getSignalProtocolStore } from '../../SignalProtocolStore';
|
||||
import { MessageController } from '../../util/MessageController';
|
||||
import { initMessageCleanup } from '../../services/messageStateCleanup';
|
||||
import { initializeMessageCounter } from '../../util/incrementMessageCounter';
|
||||
import { initializeRedux } from '../../state/initializeRedux';
|
||||
import * as Stickers from '../../types/Stickers';
|
||||
|
||||
window.assert = assert;
|
||||
|
||||
// This is a hack to let us run TypeScript tests in the renderer process. See the
|
||||
// code in `test/index.html`.
|
||||
// code in `test/test.js`.
|
||||
|
||||
window.testUtilities = {
|
||||
debug(info) {
|
||||
return ipc.invoke('ci:test-electron:debug', info);
|
||||
},
|
||||
|
||||
onComplete(info) {
|
||||
return ipc.invoke('ci:test-electron:done', info);
|
||||
},
|
||||
|
||||
async initialize() {
|
||||
initMessageCleanup();
|
||||
await initializeMessageCounter();
|
||||
await Stickers.load();
|
||||
|
||||
initializeRedux({
|
||||
callsHistory: [],
|
||||
initialBadgesState: { byId: {} },
|
||||
mainWindowStats: {
|
||||
isFullScreen: false,
|
||||
isMaximized: false,
|
||||
},
|
||||
menuOptions: {
|
||||
development: false,
|
||||
devTools: false,
|
||||
includeSetup: false,
|
||||
isProduction: false,
|
||||
platform: 'test',
|
||||
},
|
||||
stories: [],
|
||||
storyDistributionLists: [],
|
||||
});
|
||||
},
|
||||
|
||||
prepareTests() {
|
||||
console.log('Preparing tests...');
|
||||
sync('../../test-{both,electron}/**/*_test.js', {
|
||||
|
@ -29,12 +60,6 @@ window.testUtilities = {
|
|||
cwd: __dirname,
|
||||
}).forEach(require);
|
||||
},
|
||||
installMessageController() {
|
||||
MessageController.install();
|
||||
},
|
||||
initializeMessageCounter() {
|
||||
return initializeMessageCounter();
|
||||
},
|
||||
};
|
||||
|
||||
window.getSignalProtocolStore = getSignalProtocolStore;
|
||||
|
|
|
@ -13,11 +13,11 @@ import './phase3-post-signal';
|
|||
import './phase4-test';
|
||||
import '../../backbone/reliable_trigger';
|
||||
|
||||
import type { CdsLookupOptionsType } from '../../textsecure/WebAPI';
|
||||
import type { FeatureFlagType } from '../../window.d';
|
||||
import type { StorageAccessType } from '../../types/Storage.d';
|
||||
import type { CdsLookupOptionsType } from '../../textsecure/WebAPI';
|
||||
import { start as startConversationController } from '../../ConversationController';
|
||||
import { MessageController } from '../../util/MessageController';
|
||||
import { initMessageCleanup } from '../../services/messageStateCleanup';
|
||||
import { Environment, getEnvironment } from '../../environment';
|
||||
import { isProduction } from '../../util/version';
|
||||
import { ipcInvoke } from '../../sql/channels';
|
||||
|
@ -43,7 +43,7 @@ if (window.SignalContext.config.proxyUrl) {
|
|||
}
|
||||
|
||||
window.Whisper.events = clone(window.Backbone.Events);
|
||||
MessageController.install();
|
||||
initMessageCleanup();
|
||||
startConversationController();
|
||||
|
||||
if (!isProduction(window.SignalContext.getVersion())) {
|
||||
|
@ -51,7 +51,8 @@ if (!isProduction(window.SignalContext.getVersion())) {
|
|||
cdsLookup: (options: CdsLookupOptionsType) =>
|
||||
window.textsecure.server?.cdsLookup(options),
|
||||
getConversation: (id: string) => window.ConversationController.get(id),
|
||||
getMessageById: (id: string) => window.MessageController.getById(id),
|
||||
getMessageById: (id: string) =>
|
||||
window.MessageCache.__DEPRECATED$getById(id),
|
||||
getReduxState: () => window.reduxStore.getState(),
|
||||
getSfuUrl: () => window.Signal.Services.calling._sfuUrl,
|
||||
getStorageItem: (name: keyof StorageAccessType) => window.storage.get(name),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue