@@ -15,42 +15,6 @@ function ircUsage(argv0) {
|
||||
)
|
||||
}
|
||||
|
||||
function bareIrcDial(ctx, spec) {
|
||||
if (typeof ctx.bareOsIrcHostAllowed === 'function') {
|
||||
var gate = ctx.bareOsIrcHostAllowed(spec.host)
|
||||
if (gate && gate.ok === false) {
|
||||
throw new Error(
|
||||
'irc: host blocked (' + (gate.reason || 'policy') + '): ' + spec.host
|
||||
)
|
||||
}
|
||||
}
|
||||
if (spec.tls === false) {
|
||||
var plainOk =
|
||||
typeof ctx.bareOsIrcPlaintextAllowed === 'function'
|
||||
? ctx.bareOsIrcPlaintextAllowed(spec.host, {
|
||||
tls: false,
|
||||
insecurePlain: spec.insecurePlain
|
||||
})
|
||||
: { ok: !bareIrcHostLooksLibera(spec.host) || spec.insecurePlain }
|
||||
if (plainOk && plainOk.ok === false) {
|
||||
throw new Error('irc: ' + (plainOk.reason || 'plaintext blocked'))
|
||||
}
|
||||
if (typeof ctx.bareOsTelnetConnect !== 'function') {
|
||||
throw new Error('irc: no plaintext connector (ctx.bareOsTelnetConnect)')
|
||||
}
|
||||
return ctx.bareOsTelnetConnect(spec.host, spec.port, {})
|
||||
}
|
||||
if (typeof ctx.bareOsTlsConnect !== 'function') {
|
||||
throw new Error(
|
||||
'irc: ctx.bareOsTlsConnect missing (need booter ctx API 1.57+)'
|
||||
)
|
||||
}
|
||||
return ctx.bareOsTlsConnect(spec.host, spec.port, {
|
||||
servername: spec.host,
|
||||
rejectUnauthorized: true
|
||||
})
|
||||
}
|
||||
|
||||
async function bareIrcEnsureLiveClient(ctx, spec) {
|
||||
if (
|
||||
ctx._bareIrcClient &&
|
||||
|
||||
Reference in New Issue
Block a user