diff --git a/js/background.js b/js/background.js index b2f80bd01..e2e90cdcf 100644 --- a/js/background.js +++ b/js/background.js @@ -258,7 +258,6 @@ getThemeSetting: () => storage.get('theme-setting', 'light'), setThemeSetting: value => { storage.put('theme-setting', value); - onChangeTheme(); }, getHideMenuBar: () => storage.get('hide-menu-bar'), setHideMenuBar: value => { @@ -1171,7 +1170,6 @@ ); messageReceiver.addEventListener('empty', onEmpty); messageReceiver.addEventListener('reconnect', onReconnect); - messageReceiver.addEventListener('progress', onProgress); messageReceiver.addEventListener('configuration', onConfiguration); // messageReceiver.addEventListener('typing', onTyping); @@ -1198,7 +1196,6 @@ const hasThemeSetting = Boolean(storage.get('theme-setting')); if (!hasThemeSetting && textsecure.storage.get('userAgent') === 'OWI') { storage.put('theme-setting', 'ios'); - onChangeTheme(); } const syncRequest = new textsecure.SyncRequest( textsecure.messaging, @@ -1244,12 +1241,6 @@ }); } - function onChangeTheme() { - // const view = window.owsDesktopApp.appView; - // if (view) { - // view.applyTheme(); - // } - } function onEmpty() { initialLoadComplete = true; @@ -1278,15 +1269,6 @@ Whisper.Notifications.enable(); }, window.CONSTANTS.NOTIFICATION_ENABLE_TIMEOUT_SECONDS * 1000); } - function onProgress(ev) { - const { count } = ev; - window.log.info(`onProgress: Message count is ${count}`); - - // const view = window.owsDesktopApp.appView; - // if (view) { - // view.onProgress(count); - // } - } function onConfiguration(ev) { const { configuration } = ev; const { diff --git a/js/views/app_view.js b/js/views/app_view.js index 3164cd193..3a11409f8 100644 --- a/js/views/app_view.js +++ b/js/views/app_view.js @@ -123,7 +123,6 @@ return Promise.resolve(); }, onEmpty() {}, - onProgress() {}, showEditProfileDialog(options) { // eslint-disable-next-line no-param-reassign options.theme = this.getThemeObject(); diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 66dfc6833..c5e69273c 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -119,15 +119,6 @@ MessageReceiver.prototype.extend({ // This promise will resolve when there are no more messages to be processed. return Promise.all(incoming); }, - updateProgress(count) { - // count by 10s - if (count % 10 !== 0) { - return; - } - const ev = new Event('progress'); - ev.count = count; - this.dispatchEvent(ev); - }, getStatus() { if (this.hasConnected) { return WebSocket.CLOSED; diff --git a/main.js b/main.js index fabcd9b09..cc9eb3e26 100644 --- a/main.js +++ b/main.js @@ -1138,7 +1138,7 @@ async function sessionGenerateKeyPair(event, seed) { ed25519KeyPair, }; - // null as first parameter to indivate no error + // null as first parameter to indicate no error event.reply('generate-keypair-seed-response', null, x25519KeyPair); } catch (err) { event.reply('generate-keypair-seed-response', err); diff --git a/preload.js b/preload.js index 88e348166..8db8ecff8 100644 --- a/preload.js +++ b/preload.js @@ -14,6 +14,7 @@ const { app } = electron.remote; const { clipboard } = electron; window.PROTO_ROOT = 'protos'; + const appConfig = require('./app/config'); const config = require('url').parse(window.location.toString(), true).query; diff --git a/ts/receiver/dataMessage.ts b/ts/receiver/dataMessage.ts index a09d84ee5..4384e8b0c 100644 --- a/ts/receiver/dataMessage.ts +++ b/ts/receiver/dataMessage.ts @@ -603,9 +603,6 @@ export async function handleMessageEvent(event: MessageEvent): Promise { ? ConversationType.GROUP : ConversationType.PRIVATE; - // MAXIM: So id is actually conversationId - const id = isIncoming ? source : destination; - const { PROFILE_KEY_UPDATE, SESSION_RESTORE, @@ -613,9 +610,14 @@ export async function handleMessageEvent(event: MessageEvent): Promise { // tslint:disable-next-line: no-bitwise const isProfileUpdate = Boolean(message.flags & PROFILE_KEY_UPDATE); - + let conversationId = isIncoming ? source : destination; if (isProfileUpdate) { - await handleProfileUpdate(message.profileKey, id, type, isIncoming); + await handleProfileUpdate( + message.profileKey, + conversationId, + type, + isIncoming + ); confirm(); return; } @@ -651,7 +653,6 @@ export async function handleMessageEvent(event: MessageEvent): Promise { // - primarySource if it is an incoming DM message, // - destination if it is an outgoing message, // - group.id if it is a group message - let conversationId = id; if (isGroupMessage) { // remove the prefix from the source object so this is correct for all other message.group.id = message.group.id.replace( diff --git a/ts/receiver/receiver.ts b/ts/receiver/receiver.ts index b2ced26a1..3e2a766b8 100644 --- a/ts/receiver/receiver.ts +++ b/ts/receiver/receiver.ts @@ -69,9 +69,6 @@ class EnvelopeQueue { } private cleanup(promise: Promise) { - // TODO: enable this? - // this.updateProgress(this.count); - // We want to clear out the promise chain whenever possible because it could // lead to large memory usage over time: // https://github.com/nodejs/node/issues/6673#issuecomment-244331609 diff --git a/ts/window.d.ts b/ts/window.d.ts index 8ef86a9d4..b14e86b3d 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -19,6 +19,7 @@ import { any } from 'underscore'; import { Store } from 'redux'; import { MessageController } from './session/messages/MessageController'; import { DefaultTheme } from 'styled-components'; + /* We declare window stuff here instead of global.d.ts because we are importing other declarations. If you import anything in global.d.ts, the type system won't work correctly.