libircbot
library providing a framework for implementing an IRC bot
Loading...
Searching...
No Matches
IrcServer Class Reference

An IRC server. More...

#include <ircbot/ircserver.h>

Public Member Functions

IrcServerIrcServer_create (const char *id, const char *remotehost, int port, const char *nick, const char *user, const char *realname)
 Create a new IRC server to connect to. More...
 
void IrcServer_enableTls (IrcServer *self, const char *certfile, const char *keyfile)
 Enable TLS with optional client certificate. More...
 
const char * IrcServer_id (const IrcServer *self)
 The identifier of the server. More...
 
const char * IrcServer_name (const IrcServer *self)
 The name of the server. More...
 
const char * IrcServer_nick (const IrcServer *self)
 The nick currently used on the server. More...
 
const IBHashTableIrcServer_channels (const IrcServer *self)
 A hash table of all currently requested or joined channels. More...
 
void IrcServer_join (IrcServer *self, const char *channel)
 Request to join a channel. More...
 
void IrcServer_part (IrcServer *self, const char *channel)
 Request to leave a channel. More...
 
void IrcServer_destroy (IrcServer *self)
 IrcServer destructor. More...
 

Detailed Description

An IRC server.

Member Function Documentation

◆ IrcServer_channels()

const IBHashTable * IrcServer_channels ( const IrcServer self)

A hash table of all currently requested or joined channels.

The keys are the channel names, the objects are IrcChannel objects.

Parameters
selfthe IrcServer
Returns
a hash table of channels

◆ IrcServer_create()

IrcServer * IrcServer_create ( const char *  id,
const char *  remotehost,
int  port,
const char *  nick,
const char *  user,
const char *  realname 
)

Create a new IRC server to connect to.

Parameters
idan identifier for the server, e.g. the name of the IRC network
remotehosthost name or IP address to connect to
portport number to connect to (typically 6667)
nicknickname to use on that server
userusername to use, NULL to derive from local account
realnamereal name to use, NULL to derive from local account

◆ IrcServer_destroy()

void IrcServer_destroy ( IrcServer self)

IrcServer destructor.

Parameters
selfthe IrcServer

◆ IrcServer_enableTls()

void IrcServer_enableTls ( IrcServer self,
const char *  certfile,
const char *  keyfile 
)

Enable TLS with optional client certificate.

This function must be called before the IrcServer object is passed to the IrcBot. It's only available when libircbot was built with TLS support.

Parameters
selfthe IrcServer
certfileclient certificate file, NULL for none
keyfileclient certificate key file, NULL for none

◆ IrcServer_id()

const char * IrcServer_id ( const IrcServer self)

The identifier of the server.

Parameters
selfthe IrcServer
Returns
the identifier

◆ IrcServer_join()

void IrcServer_join ( IrcServer self,
const char *  channel 
)

Request to join a channel.

Do NOT use this function from bot event handlers!

Parameters
selfthe IrcServer
channelthe name of the channel to join

◆ IrcServer_name()

const char * IrcServer_name ( const IrcServer self)

The name of the server.

This is either the name advertised by the server itself, or as long as this isn't known yet, the remote host name given in IrcServer_create().

Parameters
selfthe IrcServer
Returns
the name of the server

◆ IrcServer_nick()

const char * IrcServer_nick ( const IrcServer self)

The nick currently used on the server.

Parameters
selfthe IrcServer
Returns
the current own nick

◆ IrcServer_part()

void IrcServer_part ( IrcServer self,
const char *  channel 
)

Request to leave a channel.

Do NOT use this function from bot event handlers!

Parameters
selfthe IrcServer
channelthe name of the channel to leave

The documentation for this class was generated from the following file: