Simplify OutgoingIdentityKeyError, use it in getKeysForIdentifier

This commit is contained in:
Scott Nonnenberg 2022-02-25 15:39:24 -08:00 committed by GitHub
parent e4b4a0cd1e
commit fcb96bf92a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 33 deletions

View file

@ -707,12 +707,7 @@ export default class OutgoingMessage {
await this.reloadDevicesAndSend(identifier, true)();
} catch (error) {
if (error?.message?.includes('untrusted identity for address')) {
const newError = new OutgoingIdentityKeyError(
identifier,
error.originalMessage,
error.timestamp,
error.identityKey && new Uint8Array(error.identityKey)
);
const newError = new OutgoingIdentityKeyError(identifier);
this.registerError(identifier, 'Untrusted identity', newError);
} else {
this.registerError(