Add Signal.Workflow namespace

This commit is contained in:
Daniel Gasienica 2018-03-23 10:16:37 -04:00
parent 4a7cc22de3
commit 7c2fde4433
3 changed files with 9 additions and 7 deletions

View file

@ -14,7 +14,7 @@
;(function() { ;(function() {
'use strict'; 'use strict';
const { IdleDetector, MessageMigration } = Signal; const { IdleDetector, MessageDataMigrator } = Signal.Workflow;
const { Errors, Message } = window.Signal.Types; const { Errors, Message } = window.Signal.Types;
const { upgradeMessageSchema } = window.Signal.Migrations; const { upgradeMessageSchema } = window.Signal.Migrations;
@ -77,11 +77,11 @@
storage.fetch(); storage.fetch();
/* eslint-enable */ /* eslint-enable */
/* jshint ignore:start */ /* jshint ignore:start */
const idleDetector = new IdleDetector(); const idleDetector = new IdleDetector();
idleDetector.on('idle', async () => { idleDetector.on('idle', async () => {
const results = await MessageMigration.processNext({ const results = await MessageDataMigrator.processNext({
BackboneMessage: Whisper.Message, BackboneMessage: Whisper.Message,
BackboneMessageCollection: Whisper.MessageCollection, BackboneMessageCollection: Whisper.MessageCollection,
count: 3, count: 3,

View file

@ -125,23 +125,25 @@
const { IdleDetector} = require('./js/modules/idle_detector'); const { IdleDetector} = require('./js/modules/idle_detector');
window.Signal = window.Signal || {}; window.Signal = window.Signal || {};
window.Signal.IdleDetector = IdleDetector;
window.Signal.Logs = require('./js/modules/logs');
window.Signal.MessageMigration = require('./js/modules/messages_migration');
window.Signal.OS = require('./js/modules/os');
window.Signal.Backup = require('./js/modules/backup'); window.Signal.Backup = require('./js/modules/backup');
window.Signal.Crypto = require('./js/modules/crypto'); window.Signal.Crypto = require('./js/modules/crypto');
window.Signal.Logs = require('./js/modules/logs');
window.Signal.Migrations = {}; window.Signal.Migrations = {};
window.Signal.Migrations.loadAttachmentData = Attachment.loadData(readAttachmentData); window.Signal.Migrations.loadAttachmentData = Attachment.loadData(readAttachmentData);
window.Signal.Migrations.deleteAttachmentData = Attachment.deleteData(deleteAttachmentData); window.Signal.Migrations.deleteAttachmentData = Attachment.deleteData(deleteAttachmentData);
window.Signal.Migrations.upgradeMessageSchema = upgradeMessageSchema; window.Signal.Migrations.upgradeMessageSchema = upgradeMessageSchema;
window.Signal.Migrations.V17 = require('./js/modules/migrations/17'); window.Signal.Migrations.V17 = require('./js/modules/migrations/17');
window.Signal.OS = require('./js/modules/os');
window.Signal.Types = window.Signal.Types || {}; window.Signal.Types = window.Signal.Types || {};
window.Signal.Types.Attachment = Attachment; window.Signal.Types.Attachment = Attachment;
window.Signal.Types.Errors = require('./js/modules/types/errors'); window.Signal.Types.Errors = require('./js/modules/types/errors');
window.Signal.Types.Message = Message; window.Signal.Types.Message = Message;
window.Signal.Types.MIME = require('./js/modules/types/mime'); window.Signal.Types.MIME = require('./js/modules/types/mime');
window.Signal.Types.Settings = require('./js/modules/types/settings'); window.Signal.Types.Settings = require('./js/modules/types/settings');
window.Signal.Workflow = {};
window.Signal.Workflow.IdleDetector = IdleDetector;
window.Signal.Workflow.MessageDataMigrator =
require('./js/modules/messages_data_migrator');
// We pull this in last, because the native module involved appears to be sensitive to // We pull this in last, because the native module involved appears to be sensitive to
// /tmp mounted as noexec on Linux. // /tmp mounted as noexec on Linux.