adress reviews

pull/1194/head
Audric Ackermann 5 years ago
parent cd79b5051c
commit 3067dd58aa
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -699,7 +699,7 @@
await this.sendVerifySyncMessage(this.id, verified); await this.sendVerifySyncMessage(this.id, verified);
} }
}, },
sendVerifySyncMessage(number, state) { async sendVerifySyncMessage(number, state) {
// Because syncVerification sends a (null) message to the target of the verify and // Because syncVerification sends a (null) message to the target of the verify and
// a sync message to our own devices, we need to send the accessKeys down for both // a sync message to our own devices, we need to send the accessKeys down for both
// contacts. So we merge their sendOptions. // contacts. So we merge their sendOptions.
@ -709,12 +709,8 @@
); );
const options = Object.assign({}, sendOptions, {}); const options = Object.assign({}, sendOptions, {});
const promise = textsecure.storage.protocol.loadIdentityKey(number); const key = await textsecure.storage.protocol.loadIdentityKey(number);
return promise.then(key => return textsecure.messaging.syncVerification(number, state, key, options);
this.wrapSend(
textsecure.messaging.syncVerification(number, state, key, options)
)
);
}, },
isVerified() { isVerified() {
if (this.isPrivate()) { if (this.isPrivate()) {

@ -1447,9 +1447,9 @@
} }
}, },
sendSyncMessage() { async sendSyncMessage() {
this.syncPromise = this.syncPromise || Promise.resolve(); this.syncPromise = this.syncPromise || Promise.resolve();
const next = () => { const next = async () => {
const encodedDataMessage = this.get('dataMessage'); const encodedDataMessage = this.get('dataMessage');
if (this.get('synced') || !encodedDataMessage) { if (this.get('synced') || !encodedDataMessage) {
return Promise.resolve(); return Promise.resolve();
@ -1470,18 +1470,17 @@
sentSyncMessageParams sentSyncMessageParams
); );
return libsession const result = await libsession
.getMessageQueue() .getMessageQueue()
.sendSyncMessage(sentSyncMessage) .sendSyncMessage(sentSyncMessage);
.then(result => { this.set({
this.set({ synced: true,
synced: true, dataMessage: null,
dataMessage: null, });
}); await window.Signal.Data.saveMessage(this.attributes, {
return window.Signal.Data.saveMessage(this.attributes, { Message: Whisper.Message,
Message: Whisper.Message, });
}).then(() => result); return result;
});
}; };
this.syncPromise = this.syncPromise.then(next, next); this.syncPromise = this.syncPromise.then(next, next);

Loading…
Cancel
Save