@@ -249,12 +249,6 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
249
249
await deleteExternalFilesOfConversation ( this . attributes ) ;
250
250
}
251
251
252
- public async onExpired ( _message : MessageModel ) {
253
- await this . updateLastMessage ( ) ;
254
-
255
- // removeMessage();
256
- }
257
-
258
252
public getGroupAdmins ( ) : Array < string > {
259
253
const groupAdmins = this . get ( 'groupAdmins' ) ;
260
254
@@ -478,26 +472,6 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
478
472
return true ;
479
473
}
480
474
481
- public async onReadMessage ( message : MessageModel , readAt : number ) {
482
- // We mark as read everything older than this message - to clean up old stuff
483
- // still marked unread in the database. If the user generally doesn't read in
484
- // the desktop app, so the desktop app only gets read syncs, we can very
485
- // easily end up with messages never marked as read (our previous early read
486
- // sync handling, read syncs never sent because app was offline)
487
-
488
- // We queue it because we often get a whole lot of read syncs at once, and
489
- // their markRead calls could very easily overlap given the async pull from DB.
490
-
491
- // Lastly, we don't send read syncs for any message marked read due to a read
492
- // sync. That's a notification explosion we don't need.
493
- return this . queueJob ( ( ) =>
494
- this . markReadBouncy ( message . get ( 'received_at' ) as any , {
495
- sendReadReceipts : false ,
496
- readAt,
497
- } )
498
- ) ;
499
- }
500
-
501
475
public async getUnreadCount ( ) {
502
476
const unreadCount = await Data . getUnreadCountByConversation ( this . id ) ;
503
477
@@ -1693,15 +1667,17 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
1693
1667
return this . get ( 'type' ) === ConversationTypeEnum . GROUP ;
1694
1668
}
1695
1669
1696
- public async removeMessage ( messageId : any ) {
1670
+ public async removeMessage ( messageId : string ) {
1697
1671
await Data . removeMessage ( messageId ) ;
1698
1672
this . updateLastMessage ( ) ;
1699
1673
1700
1674
window . inboxStore ?. dispatch (
1701
- conversationActions . messageDeleted ( {
1702
- conversationKey : this . id ,
1703
- messageId,
1704
- } )
1675
+ conversationActions . messagesDeleted ( [
1676
+ {
1677
+ conversationKey : this . id ,
1678
+ messageId,
1679
+ } ,
1680
+ ] )
1705
1681
) ;
1706
1682
}
1707
1683
0 commit comments