Removed forceP2p as argument for the pingContact event and enforced it on the other side

pull/175/head
Beaudan 6 years ago
parent 02d6920ade
commit cde7bbf3c3

@ -222,10 +222,10 @@
window.lokiP2pAPI = new window.LokiP2pAPI(
textsecure.storage.user.getNumber()
);
window.lokiP2pAPI.on(
'pingContact',
window.libloki.api.sendOnlineBroadcastMessage
);
window.lokiP2pAPI.on('pingContact', pubKey => {
const forceP2p = true;
window.libloki.api.sendOnlineBroadcastMessage(pubKey, forceP2p);
});
// These make key operations available to IPC handlers created in preload.js
window.Events = {

@ -80,7 +80,7 @@ class LokiP2pAPI extends EventEmitter {
if (!this.contactP2pDetails[pubKey]) {
return;
}
this.emit('pingContact', pubKey, true);
this.emit('pingContact', pubKey);
}
}

@ -44,8 +44,7 @@ describe('LocalLokiServer', () => {
const timer = setTimeout(() => {
promise = Promise.resolve();
}, 5000);
this.lokiP2pAPI.on('pingContact', (pubKey, forceP2p) => {
assert.isTrue(forceP2p);
this.lokiP2pAPI.on('pingContact', pubKey => {
clearTimeout(timer);
promise = Promise.resolve(pubKey);
});

Loading…
Cancel
Save