kameloso.plugins.services.connect

The Connect service handles logging onto IRC servers after having connected, as well as managing authentication to services. It also manages responding to PING requests, and capability negotiations.

The actual connection logic is in the kameloso.net module.

Members

Aliases

ChannelRejoinBehaviour
alias ChannelRejoinBehaviour = Rejoin

More descriptive name for Rejoin.

Classes

ConnectService
class ConnectService

The Connect service is a collection of functions and state needed to connect and stay connected to an IRC server, as well as authenticate with services.

Enums

Progress
enum Progress

Progress of a process.

Rejoin
enum Rejoin

Manners in which ways channels should be rejoined upon reconnecting, or upon re-execution.

Functions

joinChannels
void joinChannels(ConnectService service)

Joins all channels that should be joined, as per the ConnectSettings.rejoinBehaviour setting.

negotiateNick
void negotiateNick(ConnectService service)

Negotiate nickname and user with the server, during registration.

onAuthEnd
void onAuthEnd(ConnectService service, IRCEvent event)

Flags authentication as finished and join channels.

onBadNick
void onBadNick(ConnectService service)

Aborts a registration attempt and quits if the requested nickname is too long or contains invalid characters.

onBanned
void onBanned(ConnectService service)

Quits the program if we're banned.

onBusMessage
void onBusMessage(ConnectService service, string header, Sendable content)

Receives a passed Boxed instance with the "connect" header, and calls functions based on the payload message.

onCapabilityNegotiation
void onCapabilityNegotiation(ConnectService service, IRCEvent event)

Handles server capability exchange.

onEndOfMotd
void onEndOfMotd(ConnectService service)

Joins channels and prints some Twitch warnings on end of MOTD.

onISUPPORT
void onISUPPORT(ConnectService service, IRCEvent event)

Requests a UTF-8 codepage if it seems that the server supports changing such.

onInvite
void onInvite(ConnectService service, IRCEvent event)

Upon being invited to a channel, joins it if the settings say we should.

onNickInUse
void onNickInUse(ConnectService service)

Modifies the nickname by appending characters to the end of it.

onPassMismatch
void onPassMismatch(ConnectService service)

Quits the program if we supplied a bad IRCBot.pass.

onPing
void onPing(ConnectService service, IRCEvent event)

Pongs the server upon PING.

onQuit
void onQuit(ConnectService service, IRCEvent event)

Regains nickname if the holder of the one we wanted during registration quit.

onReconnect
void onReconnect(ConnectService service)

Disconnects and reconnects to the server.

onSASLAuthenticate
void onSASLAuthenticate(ConnectService service)

Attempts to authenticate via SASL, with the EXTERNAL mechanism if a private key and/or certificate is set in the configuration file, and by PLAIN otherwise.

onSASLFailure
void onSASLFailure(ConnectService service)

On SASL authentication failure, calls a CAP END to finish the CAP negotiations and finish registration.

onSASLSuccess
void onSASLSuccess(ConnectService service)

On SASL authentication success, calls a CAP END to finish the CAP negotiations.

onSelfjoin
void onSelfjoin(ConnectService service, IRCEvent event)

Records us as having joined a channel, when we join one. This is to allow us to notice when we silently fail to join something, on Twitch. As it's limited to there, gate it behind version TwitchSupport.

onSelfnickSuccessOrFailure
void onSelfnickSuccessOrFailure(ConnectService service)

Resets PrinterPlugin squelching upon a successful or failed nick change. This so as to be squelching as little as possible.

onSelfpart
void onSelfpart(ConnectService service, IRCEvent event)

Removes a channel from the list of joined channels.

onToConnectType
void onToConnectType(ConnectService service, IRCEvent event)

Responds to ERR_NEEDPONG events by sending the text supplied as content in the IRCEvent to the server.

onTwitchAuthFailure
void onTwitchAuthFailure(ConnectService service, IRCEvent event)

On Twitch, if the OAuth pass is wrong or malformed, abort and exit the program. Only deal with it if we're currently registering.

onUnknownCommand
void onUnknownCommand(ConnectService service, IRCEvent event)

Warns the user if the server does not seem to support WHOIS queries, suggesting that they enable hostmasks mode instead.

onWHOISUser
void onWHOISUser(ConnectService service, IRCEvent event)

Catch information about ourselves (notably our IDENT) from WHOIS results.

onWelcome
void onWelcome(ConnectService service)

Marks registration as completed upon RPL_WELCOME (numeric 001).

register
void register(ConnectService service)

Registers with/logs onto an IRC server.

setup
void setup(ConnectService service)

Registers with the server.

startPingMonitor
void startPingMonitor(ConnectService service)

Starts a looping monitor that sends a PING if we haven't received one from the server for a while. This is to ensure that dead connections are properly detected.

tryAuth
void tryAuth(ConnectService service)

Tries to authenticate with services.

trySASLPlain
auto trySASLPlain(ConnectService service)

Constructs a SASL plain authentication token from the bot's IRCBot.account and IRCBot.password, then sends it to the server, during registration.

Structs

ConnectSettings
struct ConnectSettings

Settings for a ConnectService.

See Also

Meta