ssb-invite
Advanced tools
Comparing version 3.0.2 to 3.0.3
22
index.js
@@ -14,2 +14,4 @@ 'use strict' | ||
const ALREADY_FOLLOWING = 'already following' | ||
// invite plugin | ||
@@ -31,2 +33,10 @@ // adds methods for producing invite-codes, | ||
function logErrorCb (err) { | ||
if (err) console.log(err) | ||
} | ||
function contNoop (cb) { | ||
cb() | ||
} | ||
module.exports = { | ||
@@ -249,3 +259,3 @@ name: 'invite', | ||
rpc.invite.use({ feed: server.id }, (err, msg) => { | ||
if (err && err.message !== 'already following') { | ||
if (err && err.message !== ALREADY_FOLLOWING) { | ||
return cb(explain(err, 'invite not accepted')) | ||
@@ -257,4 +267,4 @@ } | ||
( | ||
(err && err.message === 'already following') | ||
? (cb) => cb() | ||
(err && err.message === ALREADY_FOLLOWING) | ||
? contNoop | ||
: cont(server.publish)({ | ||
@@ -273,8 +283,8 @@ type: 'contact', | ||
}) | ||
: (cb) => cb() | ||
: contNoop | ||
) | ||
])((err, results) => { | ||
if (err) return cb(err) | ||
rpc.close() | ||
rpc.close() | ||
rpc.close(logErrorCb) | ||
rpc.close(logErrorCb) | ||
// ignore err if this is new style invite | ||
@@ -281,0 +291,0 @@ if (server.gossip && server.gossip.add) server.gossip.add(ref.parseInvite(invite).remote, 'seed') |
{ | ||
"name": "ssb-invite", | ||
"description": "", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"homepage": "https://github.com/ssbc/ssb-invite", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
32426
769