Update call-only conversation message request UI
This commit is contained in:
parent
ac8bec1ac0
commit
bd0e08d6fd
5 changed files with 93 additions and 53 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue