Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
accept: valid.async(function (invite, cb) {
// remove surrounding quotes, if found
if (invite.charAt(0) === '"' && invite.charAt(invite.length - 1) === '"')
invite = invite.slice(1, -1)
var opts
// connect to the address in the invite code
// using a keypair generated from the key-seed in the invite code
var modern = false
if(ref.isInvite(invite)) { //legacy ivite
if(ref.isLegacyInvite(invite)) {
var parts = invite.split('~')
opts = ref.parseAddress(parts[0])//.split(':')
//convert legacy code to multiserver invite code.
var protocol = 'net:'
if (opts.host.endsWith(".onion"))
protocol = 'onion:'
invite = protocol+opts.host+':'+opts.port+'~shs:'+opts.key.slice(1, -8)+':'+parts[1]
}
else
modern = true
}
opts = ref.parseAddress(ref.parseInvite(invite).remote)
function connect (cb) {
ssbClient(null, {