cleanup unused code

pull/1404/head
Audric Ackermann 4 years ago
parent cf2ddc64d8
commit cf25e89a14

@ -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 {

@ -123,7 +123,6 @@
return Promise.resolve();
},
onEmpty() {},
onProgress() {},
showEditProfileDialog(options) {
// eslint-disable-next-line no-param-reassign
options.theme = this.getThemeObject();

@ -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;

@ -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);

@ -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;

@ -603,9 +603,6 @@ export async function handleMessageEvent(event: MessageEvent): Promise<void> {
? 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<void> {
// 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<void> {
// - 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(

@ -69,9 +69,6 @@ class EnvelopeQueue {
}
private cleanup(promise: Promise<any>) {
// 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

1
ts/window.d.ts vendored

@ -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.

Loading…
Cancel
Save