Add getProfile to MessageSender

// FREEBIE
This commit is contained in:
lilia 2017-05-24 13:28:40 -07:00 committed by Scott Nonnenberg
parent 0c5a69cce4
commit 22e907a8d4
2 changed files with 22 additions and 0 deletions

View file

@ -39163,6 +39163,16 @@ MessageSender.prototype = {
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
},
getProfile: function(number) {
return this.server.getProfile(number).then(function(profile) {
var identityKey = dcodeIO.ByteBuffer.wrap(profile.identityKey).toArrayBuffer();
return textsecure.storage.protocol.isTrusted(number, identityKey).then(function(trusted) {
});
});
},
sendRequestGroupSyncMessage: function() {
var myNumber = textsecure.storage.user.getNumber();
var myDevice = textsecure.storage.user.getDeviceId();
@ -39453,6 +39463,7 @@ textsecure.MessageSender = function(url, ports, username, password) {
this.setGroupAvatar = sender.setGroupAvatar .bind(sender);
this.leaveGroup = sender.leaveGroup .bind(sender);
this.sendSyncMessage = sender.sendSyncMessage .bind(sender);
this.getProfile = sender.getProfile .bind(sender);
this.syncReadMessages = sender.syncReadMessages .bind(sender);
};

View file

@ -254,6 +254,16 @@ MessageSender.prototype = {
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
},
getProfile: function(number) {
return this.server.getProfile(number).then(function(profile) {
var identityKey = dcodeIO.ByteBuffer.wrap(profile.identityKey).toArrayBuffer();
return textsecure.storage.protocol.isTrusted(number, identityKey).then(function(trusted) {
});
});
},
sendRequestGroupSyncMessage: function() {
var myNumber = textsecure.storage.user.getNumber();
var myDevice = textsecure.storage.user.getDeviceId();
@ -544,6 +554,7 @@ textsecure.MessageSender = function(url, ports, username, password) {
this.setGroupAvatar = sender.setGroupAvatar .bind(sender);
this.leaveGroup = sender.leaveGroup .bind(sender);
this.sendSyncMessage = sender.sendSyncMessage .bind(sender);
this.getProfile = sender.getProfile .bind(sender);
this.syncReadMessages = sender.syncReadMessages .bind(sender);
};