Rename a function

Avoid confusing this operation with actual receipts, which are something
else.

// FREEBIE
This commit is contained in:
lilia 2016-02-25 17:10:22 -08:00
parent b77d5df4f2
commit 2b7cbef8b1
3 changed files with 11 additions and 11 deletions

View file

@ -37686,16 +37686,16 @@ MessageSender.prototype = {
return this.sendIndividualProto(myNumber, contentMessage, Date.now()); return this.sendIndividualProto(myNumber, contentMessage, Date.now());
} }
}, },
sendReadReceipts: function(receipts) { syncReadMessages: function(reads) {
var myNumber = textsecure.storage.user.getNumber(); var myNumber = textsecure.storage.user.getNumber();
var myDevice = textsecure.storage.user.getDeviceId(); var myDevice = textsecure.storage.user.getDeviceId();
if (myDevice != 1) { if (myDevice != 1) {
var syncMessage = new textsecure.protobuf.SyncMessage(); var syncMessage = new textsecure.protobuf.SyncMessage();
syncMessage.read = []; syncMessage.read = [];
for (var i = 0; i < receipts.length; ++i) { for (var i = 0; i < reads.length; ++i) {
var read = new textsecure.protobuf.SyncMessage.Read(); var read = new textsecure.protobuf.SyncMessage.Read();
read.timestamp = receipts[i].timestamp; read.timestamp = reads[i].timestamp;
read.sender = receipts[i].sender; read.sender = reads[i].sender;
syncMessage.read.push(read); syncMessage.read.push(read);
} }
var contentMessage = new textsecure.protobuf.Content(); var contentMessage = new textsecure.protobuf.Content();
@ -37905,7 +37905,7 @@ textsecure.MessageSender = function(url, username, password, attachment_server_u
this.setGroupAvatar = sender.setGroupAvatar .bind(sender); this.setGroupAvatar = sender.setGroupAvatar .bind(sender);
this.leaveGroup = sender.leaveGroup .bind(sender); this.leaveGroup = sender.leaveGroup .bind(sender);
this.sendSyncMessage = sender.sendSyncMessage .bind(sender); this.sendSyncMessage = sender.sendSyncMessage .bind(sender);
this.sendReadReceipts = sender.sendReadReceipts .bind(sender); this.syncReadMessages = sender.syncReadMessages .bind(sender);
}; };
textsecure.MessageSender.prototype = { textsecure.MessageSender.prototype = {

View file

@ -219,7 +219,7 @@
}; };
}); });
if (read.length > 0) { if (read.length > 0) {
textsecure.messaging.sendReadReceipts(read); textsecure.messaging.syncReadMessages(read);
} }
}); });
} }

View file

@ -229,16 +229,16 @@ MessageSender.prototype = {
return this.sendIndividualProto(myNumber, contentMessage, Date.now()); return this.sendIndividualProto(myNumber, contentMessage, Date.now());
} }
}, },
sendReadReceipts: function(receipts) { syncReadMessages: function(reads) {
var myNumber = textsecure.storage.user.getNumber(); var myNumber = textsecure.storage.user.getNumber();
var myDevice = textsecure.storage.user.getDeviceId(); var myDevice = textsecure.storage.user.getDeviceId();
if (myDevice != 1) { if (myDevice != 1) {
var syncMessage = new textsecure.protobuf.SyncMessage(); var syncMessage = new textsecure.protobuf.SyncMessage();
syncMessage.read = []; syncMessage.read = [];
for (var i = 0; i < receipts.length; ++i) { for (var i = 0; i < reads.length; ++i) {
var read = new textsecure.protobuf.SyncMessage.Read(); var read = new textsecure.protobuf.SyncMessage.Read();
read.timestamp = receipts[i].timestamp; read.timestamp = reads[i].timestamp;
read.sender = receipts[i].sender; read.sender = reads[i].sender;
syncMessage.read.push(read); syncMessage.read.push(read);
} }
var contentMessage = new textsecure.protobuf.Content(); var contentMessage = new textsecure.protobuf.Content();
@ -448,7 +448,7 @@ textsecure.MessageSender = function(url, username, password, attachment_server_u
this.setGroupAvatar = sender.setGroupAvatar .bind(sender); this.setGroupAvatar = sender.setGroupAvatar .bind(sender);
this.leaveGroup = sender.leaveGroup .bind(sender); this.leaveGroup = sender.leaveGroup .bind(sender);
this.sendSyncMessage = sender.sendSyncMessage .bind(sender); this.sendSyncMessage = sender.sendSyncMessage .bind(sender);
this.sendReadReceipts = sender.sendReadReceipts .bind(sender); this.syncReadMessages = sender.syncReadMessages .bind(sender);
}; };
textsecure.MessageSender.prototype = { textsecure.MessageSender.prototype = {