Comparing version 0.2.1 to 0.2.2
@@ -108,10 +108,12 @@ "use strict"; | ||
this.hops = {}; | ||
this.ssb.post((msg) => { | ||
if (msg.value.author != this.ssb.id) { | ||
this.lastMessageAt = Date.now(); | ||
} | ||
if (msg.value.content && msg.value.content.type === 'contact') { | ||
this.updateHops(); | ||
} | ||
}); | ||
if (this.ssb.post) { | ||
this.ssb.post((msg) => { | ||
if (msg.value.author != this.ssb.id) { | ||
this.lastMessageAt = Date.now(); | ||
} | ||
if (msg.value.content && msg.value.content.type === 'contact') { | ||
this.updateHops(); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -118,0 +120,0 @@ updateHops() { |
{ | ||
"name": "ssb-conn", | ||
"description": "SSB plugin for establishing and managing peer connections", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "https://github.com/staltz/ssb-conn", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -103,10 +103,13 @@ import ConnHub = require('ssb-conn-hub'); | ||
this.ssb.post((msg: Msg) => { | ||
if (msg.value.author != this.ssb.id) { | ||
this.lastMessageAt = Date.now(); | ||
} | ||
if (msg.value.content && msg.value.content.type === 'contact') { | ||
this.updateHops(); | ||
} | ||
}); | ||
// if ssb-db is installed | ||
if (this.ssb.post) { | ||
this.ssb.post((msg: Msg) => { | ||
if (msg.value.author != this.ssb.id) { | ||
this.lastMessageAt = Date.now(); | ||
} | ||
if (msg.value.content && msg.value.content.type === 'contact') { | ||
this.updateHops(); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -113,0 +116,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122923
2147