rename sendEmptyMessageWithPreKeys to sendFriendRequestAccepted.

pull/52/head
Mikunj 7 years ago
parent bd15f426f9
commit 4bb93e6e3c

@ -143,7 +143,7 @@
await Promise.all([signedKeyPromise, preKeyPromise]); await Promise.all([signedKeyPromise, preKeyPromise]);
} }
async function sendEmptyMessageWithPreKeys(pubKey) { async function sendFriendRequestAccepted(pubKey) {
// empty content message // empty content message
const content = new textsecure.protobuf.Content(); const content = new textsecure.protobuf.Content();
@ -155,6 +155,9 @@
log.info('empty message sent successfully'); log.info('empty message sent successfully');
} }
}; };
const options = {
preKeyBundleType: textsecure.protobuf.PreKeyBundleMessage.Type.FRIEND_REQUEST_ACCEPT,
};
// send an empty message. The logic in ougoing_message will attach the prekeys. // send an empty message. The logic in ougoing_message will attach the prekeys.
const outgoingMessage = new textsecure.OutgoingMessage( const outgoingMessage = new textsecure.OutgoingMessage(
null, // server null, // server
@ -162,7 +165,8 @@
[pubKey], // numbers [pubKey], // numbers
content, // message content, // message
true, // silent true, // silent
callback // callback callback, // callback
options
); );
await outgoingMessage.sendToNumber(pubKey); await outgoingMessage.sendToNumber(pubKey);
} }
@ -171,5 +175,5 @@
window.libloki.getPreKeyBundleForNumber = getPreKeyBundleForNumber; window.libloki.getPreKeyBundleForNumber = getPreKeyBundleForNumber;
window.libloki.FallBackDecryptionError = FallBackDecryptionError; window.libloki.FallBackDecryptionError = FallBackDecryptionError;
window.libloki.savePreKeyBundleForNumber = savePreKeyBundleForNumber; window.libloki.savePreKeyBundleForNumber = savePreKeyBundleForNumber;
window.libloki.sendEmptyMessageWithPreKeys = sendEmptyMessageWithPreKeys; window.libloki.sendFriendRequestAccepted = sendFriendRequestAccepted;
})(); })();

@ -1026,7 +1026,7 @@ MessageReceiver.prototype.extend({
} }
// Send a reply back // Send a reply back
libloki.sendEmptyMessageWithPreKeys(pubKey); libloki.sendFriendRequestAccepted(pubKey);
} }
window.log.info(`Friend request for ${pubKey} was ${message.friendStatus}`, message); window.log.info(`Friend request for ${pubKey} was ${message.friendStatus}`, message);
}, },

Loading…
Cancel
Save