Update call-only conversation message request UI

This commit is contained in:
trevor-signal 2023-05-12 14:20:10 -04:00 committed by GitHub
parent ac8bec1ac0
commit bd0e08d6fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 53 deletions

View file

@ -2260,16 +2260,6 @@ export class ConversationModel extends window.Backbone
return undefined;
}
decrementMessageCount(numberOfMessages = 1): void {
this.set({
messageCount: Math.max(
(this.get('messageCount') || 0) - numberOfMessages,
0
),
});
window.Signal.Data.updateConversation(this.attributes);
}
incrementSentMessageCount({ dry = false }: { dry?: boolean } = {}):
| Partial<ConversationAttributesType>
| undefined {
@ -2287,20 +2277,6 @@ export class ConversationModel extends window.Backbone
return undefined;
}
decrementSentMessageCount(numberOfMessages = 1): void {
this.set({
messageCount: Math.max(
(this.get('messageCount') || 0) - numberOfMessages,
0
),
sentMessageCount: Math.max(
(this.get('sentMessageCount') || 0) - numberOfMessages,
0
),
});
window.Signal.Data.updateConversation(this.attributes);
}
/**
* This function is called when a message request is accepted in order to
* handle sending read receipts and download any pending attachments.
@ -3464,7 +3440,17 @@ export class ConversationModel extends window.Backbone
})
);
if (
detailsToSave.callMode === CallMode.Direct &&
!detailsToSave.wasIncoming
) {
this.incrementSentMessageCount();
} else {
this.incrementMessageCount();
}
this.trigger('newmessage', model);
void this.updateUnread();
this.set('active_at', timestamp);