Update header actions/add hiddenFromConversationSearch

This commit is contained in:
Jamie Kyle 2023-06-29 11:40:00 -07:00 committed by GitHub
parent 00250e535c
commit af4ad55c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 204 additions and 27 deletions

View file

@ -361,6 +361,7 @@ export class ConversationModel extends window.Backbone
this.unset('tokens');
this.on('change:members change:membersV2', this.fetchContacts);
this.on('change:isArchived', this.onArchiveChange);
this.typingRefreshTimer = null;
this.typingPauseTimer = null;
@ -4196,6 +4197,17 @@ export class ConversationModel extends window.Backbone
}
}
private onArchiveChange() {
const isArchived = this.get('isArchived');
if (isArchived) {
return;
}
if (!this.get('hiddenFromConversationSearch')) {
return;
}
this.set('hiddenFromConversationSearch', false);
}
setMarkedUnread(markedUnread: boolean): void {
const previousMarkedUnread = this.get('markedUnread');
@ -4892,6 +4904,9 @@ export class ConversationModel extends window.Backbone
active_at: null,
pendingUniversalTimer: undefined,
});
if (isGroup(this.attributes)) {
this.set('hiddenFromConversationSearch', true);
}
window.Signal.Data.updateConversation(this.attributes);
await window.Signal.Data.removeAllMessagesInConversation(this.id, {