Handle Safety Number changes while sending a story
This commit is contained in:
parent
d036803df9
commit
0fb45f045d
13 changed files with 392 additions and 44 deletions
|
@ -2822,19 +2822,22 @@ export class ConversationModel extends window.Backbone
|
|||
return window.textsecure.storage.protocol.setApproval(uuid, true);
|
||||
}
|
||||
|
||||
safeIsUntrusted(): boolean {
|
||||
safeIsUntrusted(timestampThreshold?: number): boolean {
|
||||
try {
|
||||
const uuid = this.getUuid();
|
||||
strictAssert(uuid, `No uuid for conversation: ${this.id}`);
|
||||
return window.textsecure.storage.protocol.isUntrusted(uuid);
|
||||
return window.textsecure.storage.protocol.isUntrusted(
|
||||
uuid,
|
||||
timestampThreshold
|
||||
);
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
isUntrusted(): boolean {
|
||||
isUntrusted(timestampThreshold?: number): boolean {
|
||||
if (isDirectConversation(this.attributes)) {
|
||||
return this.safeIsUntrusted();
|
||||
return this.safeIsUntrusted(timestampThreshold);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
if (!this.contactCollection!.length) {
|
||||
|
@ -2846,13 +2849,13 @@ export class ConversationModel extends window.Backbone
|
|||
if (isMe(contact.attributes)) {
|
||||
return false;
|
||||
}
|
||||
return contact.safeIsUntrusted();
|
||||
return contact.safeIsUntrusted(timestampThreshold);
|
||||
});
|
||||
}
|
||||
|
||||
getUntrusted(): Array<ConversationModel> {
|
||||
getUntrusted(timestampThreshold?: number): Array<ConversationModel> {
|
||||
if (isDirectConversation(this.attributes)) {
|
||||
if (this.isUntrusted()) {
|
||||
if (this.isUntrusted(timestampThreshold)) {
|
||||
return [this];
|
||||
}
|
||||
return [];
|
||||
|
@ -2863,7 +2866,7 @@ export class ConversationModel extends window.Backbone
|
|||
if (isMe(contact.attributes)) {
|
||||
return false;
|
||||
}
|
||||
return contact.isUntrusted();
|
||||
return contact.isUntrusted(timestampThreshold);
|
||||
}) || []
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue