"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/read_syncs.js" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

read_syncs.js  (Signal-Desktop-1.35.2):read_syncs.js  (Signal-Desktop-1.36.1)
/* global /* global
Backbone, Backbone,
Whisper, Whisper,
MessageController MessageController
*/ */
/* eslint-disable more/no-then */ /* eslint-disable more/no-then */
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
(function() { (function() {
'use strict';
window.Whisper = window.Whisper || {}; window.Whisper = window.Whisper || {};
Whisper.ReadSyncs = new (Backbone.Collection.extend({ Whisper.ReadSyncs = new (Backbone.Collection.extend({
forMessage(message) { forMessage(message) {
const senderId = window.ConversationController.ensureContactIds({ const senderId = window.ConversationController.ensureContactIds({
e164: message.get('source'), e164: message.get('source'),
uuid: message.get('sourceUuid'), uuid: message.get('sourceUuid'),
}); });
const receipt = this.findWhere({ const receipt = this.findWhere({
senderId, senderId,
timestamp: message.get('sent_at'), timestamp: message.get('sent_at'),
skipping to change at line 49 skipping to change at line 47
); );
const found = messages.find(item => { const found = messages.find(item => {
const senderId = window.ConversationController.ensureContactIds({ const senderId = window.ConversationController.ensureContactIds({
e164: item.get('source'), e164: item.get('source'),
uuid: item.get('sourceUuid'), uuid: item.get('sourceUuid'),
}); });
return item.isIncoming() && senderId === receipt.get('senderId'); return item.isIncoming() && senderId === receipt.get('senderId');
}); });
const notificationForMessage = found if (found) {
? Whisper.Notifications.findWhere({ messageId: found.id }) Whisper.Notifications.removeBy({ messageId: found.id });
: null; } else {
Whisper.Notifications.remove(notificationForMessage);
if (!found) {
window.log.info( window.log.info(
'No message for read sync', 'No message for read sync',
receipt.get('senderId'), receipt.get('senderId'),
receipt.get('sender'), receipt.get('sender'),
receipt.get('senderUuid'), receipt.get('senderUuid'),
receipt.get('timestamp') receipt.get('timestamp')
); );
return; return;
} }
 End of changes. 2 change blocks. 
8 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)