Clarify behavior of group deletion

This commit is contained in:
trevor-signal 2024-10-21 14:05:10 -04:00 committed by GitHub
parent 8c6a4247f2
commit 4d3c6beed9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 62 additions and 9 deletions

View file

@ -407,6 +407,8 @@ export class ConversationModel extends window.Backbone
this.unset('tokens');
this.on('change:members change:membersV2', this.fetchContacts);
this.on('change:active_at', this.onActiveAtChange);
this.typingRefreshTimer = null;
this.typingPauseTimer = null;
@ -4416,6 +4418,12 @@ export class ConversationModel extends window.Backbone
}
}
private onActiveAtChange(): void {
if (this.get('active_at') && this.get('hiddenFromConversationSearch')) {
this.set('hiddenFromConversationSearch', false);
}
}
async refreshGroupLink(): Promise<void> {
if (!isGroupV2(this.attributes)) {
return;
@ -4846,7 +4854,12 @@ export class ConversationModel extends window.Backbone
ourAci
);
const sharedGroups = ourGroups
.filter(c => c.hasMember(ourAci) && c.hasMember(theirAci))
.filter(
c =>
c.hasMember(ourAci) &&
c.hasMember(theirAci) &&
!c.attributes.hiddenFromConversationSearch
)
.sort(
(left, right) =>
(right.get('timestamp') || 0) - (left.get('timestamp') || 0)
@ -5209,6 +5222,9 @@ export class ConversationModel extends window.Backbone
active_at: null,
pendingUniversalTimer: undefined,
});
if (isGroup(this.attributes)) {
this.set('hiddenFromConversationSearch', true);
}
await DataWriter.updateConversation(this.attributes);
const ourConversation =