Fix roster.stop

This commit is contained in:
yflory
2019-09-20 16:38:04 +02:00
parent e4e2c3a19d
commit 5b006a8819

View File

@@ -407,8 +407,8 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) {
var webChannel; var webChannel;
roster.stop = function () { roster.stop = function () {
if (webChannel && typeof(webChannel.leave) === 'function') { if (ref.internal.cpNetflux && typeof(ref.internal.cpNetflux) === "function") {
webChannel.leave(); ref.internal.cpNetflux.stop();
clearPendingCheckpoints(); clearPendingCheckpoints();
} else { } else {
console.log("FAILED TO LEAVE"); console.log("FAILED TO LEAVE");
@@ -643,7 +643,7 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) {
console.log("Synchronizing from checkpoint"); console.log("Synchronizing from checkpoint");
} }
CPNetflux.start({ ref.internal.cpNetflux = CPNetflux.start({
// if you don't have a lastKnownHash you will need the full history // if you don't have a lastKnownHash you will need the full history
// passing -1 forces the server to send all messages, otherwise // passing -1 forces the server to send all messages, otherwise
// malicious users with the signing key could send cp| messages // malicious users with the signing key could send cp| messages