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 6 years ago
parent 3aa135fdb4
commit 9731c9e086

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

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

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

Loading…
Cancel
Save