Comment out some signal server based code causing errors. Return before trying to unpad message because they aren't being padded in the first place

pull/39/head
Beaudan 7 years ago
parent 3aa135fdb4
commit 9731c9e086

@ -23,7 +23,7 @@
const ARCHIVE_AGE = 7 * 24 * 60 * 60 * 1000; const ARCHIVE_AGE = 7 * 24 * 60 * 60 * 1000;
function AccountManager(username, password) { function AccountManager(username, password) {
this.server = window.WebAPI.connect({ username, password }); // this.server = window.WebAPI.connect({ username, password });
this.pending = Promise.resolve(); this.pending = Promise.resolve();
} }
@ -44,10 +44,10 @@
AccountManager.prototype.extend({ AccountManager.prototype.extend({
constructor: AccountManager, constructor: AccountManager,
requestVoiceVerification(number) { requestVoiceVerification(number) {
return this.server.requestVerificationVoice(number); // return this.server.requestVerificationVoice(number);
}, },
requestSMSVerification(number) { requestSMSVerification(number) {
return this.server.requestVerificationSMS(number); // return this.server.requestVerificationSMS(number);
}, },
registerSingleDevice(mnemonic, mnemonicLanguage) { registerSingleDevice(mnemonic, mnemonicLanguage) {
const createAccount = this.createAccount.bind(this); const createAccount = this.createAccount.bind(this);
@ -140,18 +140,18 @@
throw new Error('account_manager: registerSecondDevice has not been implemented!'); throw new Error('account_manager: registerSecondDevice has not been implemented!');
}, },
refreshPreKeys() { refreshPreKeys() {
const generateKeys = this.generateKeys.bind(this, 0); // const generateKeys = this.generateKeys.bind(this, 0);
const registerKeys = this.server.registerKeys.bind(this.server); // const registerKeys = this.server.registerKeys.bind(this.server);
return this.queueTask(() => // return this.queueTask(() =>
this.server.getMyKeys().then(preKeyCount => { // this.server.getMyKeys().then(preKeyCount => {
window.log.info(`prekey count ${preKeyCount}`); // window.log.info(`prekey count ${preKeyCount}`);
if (preKeyCount < 10) { // if (preKeyCount < 10) {
return generateKeys().then(registerKeys); // return generateKeys().then(registerKeys);
} // }
return null; // return null;
}) // })
); // );
}, },
rotateSignedPreKey() { rotateSignedPreKey() {
return this.queueTask(() => { return this.queueTask(() => {

@ -807,6 +807,7 @@ MessageReceiver.prototype.extend({
}, },
async decryptPreKeyWhisperMessage(ciphertext, sessionCipher, address) { async decryptPreKeyWhisperMessage(ciphertext, sessionCipher, address) {
const padded = await sessionCipher.decryptPreKeyWhisperMessage(ciphertext); const padded = await sessionCipher.decryptPreKeyWhisperMessage(ciphertext);
return padded;
try { try {
return this.unpad(padded); return this.unpad(padded);
@ -1032,8 +1033,9 @@ MessageReceiver.prototype.extend({
} else if (content.receiptMessage) { } else if (content.receiptMessage) {
return this.handleReceiptMessage(envelope, content.receiptMessage); return this.handleReceiptMessage(envelope, content.receiptMessage);
} }
this.removeFromCache(envelope); if (!content.preKeyBundleMessage) {
throw new Error('Unsupported content message'); throw new Error('Unsupported content message');
}
}, },
handleCallMessage(envelope) { handleCallMessage(envelope) {
window.log.info('call message from', this.getEnvelopeId(envelope)); window.log.info('call message from', this.getEnvelopeId(envelope));

@ -134,9 +134,9 @@ OutgoingMessage.prototype = {
}) })
); );
// TODO: check if still applicable // TODO: check if still applicable
if (updateDevices === undefined) { // if (updateDevices === undefined) {
return this.server.getKeysForNumber(number, '*').then(handleResult); // return this.server.getKeysForNumber(number, '*').then(handleResult);
} // }
let promise = Promise.resolve(true); let promise = Promise.resolve(true);
updateDevices.forEach(device => { updateDevices.forEach(device => {
promise = promise.then(() => promise = promise.then(() =>

Loading…
Cancel
Save