@ -305,7 +305,6 @@
options = options || { } ;
options = options || { } ;
_ . defaults ( options , { sendReadReceipts : true } ) ;
_ . defaults ( options , { sendReadReceipts : true } ) ;
if ( this . get ( 'unreadCount' ) > 0 ) {
var conversationId = this . id ;
var conversationId = this . id ;
Whisper . Notifications . remove ( Whisper . Notifications . where ( {
Whisper . Notifications . remove ( Whisper . Notifications . where ( {
conversationId : conversationId
conversationId : conversationId
@ -330,17 +329,14 @@
} ;
} ;
} . bind ( this ) ) ;
} . bind ( this ) ) ;
if ( read . length > 0 ) {
var unreadCount = unreadMessages . length - read . length ;
var unreadCount = unreadMessages . length - read . length ;
this . save ( { unreadCount : unreadCount } ) ;
this . save ( { unreadCount : unreadCount } ) ;
if ( options . sendReadReceipts ) {
if ( read . length && options . sendReadReceipts ) {
console . log ( 'Sending' , read . length , 'read receipts' ) ;
console . log ( 'Sending' , read . length , 'read receipts' ) ;
textsecure . messaging . syncReadMessages ( read ) ;
textsecure . messaging . syncReadMessages ( read ) ;
}
}
}
} . bind ( this ) ) ;
} . bind ( this ) ) ;
}
} ,
} ,
fetchMessages : function ( ) {
fetchMessages : function ( ) {