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);
}
},
sendVerifySyncMessage(number, state) {
async sendVerifySyncMessage(number, state) {
// 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
// contacts. So we merge their sendOptions.
@ -709,12 +709,8 @@
);
const options = Object.assign({}, sendOptions, {});
const promise = textsecure.storage.protocol.loadIdentityKey(number);
return promise.then(key =>
this.wrapSend(
textsecure.messaging.syncVerification(number, state, key, options)
)
);
const key = await textsecure.storage.protocol.loadIdentityKey(number);
return textsecure.messaging.syncVerification(number, state, key, options);
},
isVerified() {
if (this.isPrivate()) {

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

Loading…
Cancel
Save