ircpp::session Class Reference

The session represents one client connected to an IRC server. More...

#include <session.h>

List of all members.

Public Member Functions

 session (listmode mode=automatic)
 Creates a session.
bool connect (const std::string &hostname, unsigned int port=6667, const std::string &password="", bool login=true)
 Connects to an IRC server.
void run ()
 Starts the IRC session running.
bool service_socket (fd_set *readfds, fd_set *writefds, fd_set *exceptfds, int *maxfd)
 Services the socket connecting the session to the IRC server.
bool connected ()
 Returns whether the session is connected.
bool disconnect ()
 Disconnects from the IRC server.
bool set_nick (const std::string &newnick)
 Sets the nickname.
bool set_username (const std::string &username)
 Sets the username.
bool set_realname (const std::string &realname)
 Sets the realname (gecos).
const userme () const
 Returns the "me" user object.
const userserver () const
 Returns the "server" user object.
void auto_pong (bool on)
 Enables or disables auto-pong.
bool auto_pong ()
 Returns whether or not auto-pong is enabled.
bool has_capab (const std::string &name)
 Determine whether the irc server has a certain capability.
const std::string & capab (const std::string &name)
 Return the value associated with a named server capability.
void ptr (void *p)
 Sets the user-defined pointer.
void * ptr () const
 Returns the user-defined pointer.
bool cmd_raw (const std::string &rawline)
 Sends a raw line of data to the IRC server.
bool cmd_pass (const std::string &password)
 Sends the PASS message to the IRC server.
bool cmd_nick (const std::string &newnick)
 Sends the NICK message to the IRC server.
bool cmd_user (const std::string &username, const std::string &hostname, const std::string &servername, const std::string &realname)
 Sends the USER message to the IRC server.
bool cmd_quit (const std::string &quitmsg)
 Sends the QUIT message to the IRC server.
bool cmd_join (const std::string &channel, const std::string &key="")
 Sends the JOIN message to the IRC server.
bool cmd_part (const std::string &channel, const std::string &partmsg="")
 Sends the PART message to the IRC server.
bool cmd_mode (const std::string &target, const std::string &modestring)
 Sends the MODE message to the IRC server.
bool cmd_topic (const std::string &channel, const std::string &topic)
 Sends the TOPIC message to the IRC server.
bool cmd_names (const std::string &channel)
 Sends the NAMES message to the IRC server.
bool cmd_list (const std::string &params="")
 Sends the LIST message to the IRC server.
bool cmd_invite (const std::string &nick, const std::string &channel)
 Sends the INVITE message to the IRC server.
bool cmd_kick (const std::string &nick, const std::string &channel, const std::string &reason="")
 Sends the KICK message to the IRC server.
bool cmd_privmsg (const std::string &to, const std::string &message)
 Sends the PRIVMSG message to the IRC server.
bool cmd_notice (const std::string &to, const std::string &message)
 Sends the NOTICE message to the IRC server.
bool cmd_ctcp (const std::string &to, const std::string &command, const std::string &params)
 Sends the CTCP message to the IRC server.
bool cmd_ping (const std::string &params)
 Sends the PING message to the IRC server.
bool cmd_pong (const std::string &params)
 Sends the PONG message to the IRC server.
bool cmd_away (const std::string &message="")
 Sends the AWAY message to the IRC server.
bool cmd_oper (const std::string &opernick, const std::string &operpass)
 Sends the OPER message to the IRC server.
bool cmd_who (const std::string &params)
 Sends the WHO message to the IRC server.
bool cmd_whois (const std::string &target)
 Sends the WHOIS message to the IRC server.
listmode list_mode () const
 Returns this session's list mode.
const channelfind_channel (const std::string &name) const
 Finds a channel in the internal channel list.
const irclist
< channel >
::iterator 
channellist_begin () const
 Returns an iterator the beginning of the channel list.
const irclist
< channel >
::iterator 
channellist_end () const
 Returns an iterator the end of the channel list.
const userfind_user (const std::string &nick) const
 Finds a user in the internal user list.
const irclist< user >
::iterator 
userlist_begin () const
 Returns an iterator the beginning of the user list.
const irclist< user >
::iterator 
userlist_end () const
 Returns an iterator the beginning of the user list.

Public Attributes

boost::signal0< void > sig_connected
 Emitted when the session successfully connects to the IRC server.
boost::signal1< void,
const std::string & > 
sig_disconnected
 Emitted when the session is disconnected from the IRC server.
boost::signal2< void,
const std::string &,
const int > 
sig_socket_error
 Emitted when a network socket error occurs.
boost::signal1< void,
user * > 
sig_user_deletable
 Emitted when a user may be safely deleted.
boost::signal1< void,
channel * > 
sig_channel_deletable
 Emitted when a channel may be safely deleted.
boost::signal1< void,
const std::string & > 
sig_parseerror
 Emitted when a parse error occurs If the parser cannot understand a line sent to it by the IRC server it will give up and emit this signal.
boost::signal1< void,
const message & > 
sig_all_msgs
 Emitted when any message is received.
boost::signal1< void,
const message & > 
sig_unknown_msg
 Emitted when an unknown message is received.
boost::signal1< void,
const message & > 
sig_numeric_msg
 Emitted when a numeric message is received.
boost::signal1< void,
const message & > 
sig_nick_msg
 Emitted when a NICK message is received.
boost::signal1< void,
const message & > 
sig_quit_msg
 Emitted when a QUIT message is received.
boost::signal1< void,
const message & > 
sig_join_msg
 Emitted when a JOIN message is received.
boost::signal1< void,
const message & > 
sig_part_msg
 Emitted when a PART message is received.
boost::signal1< void,
const message & > 
sig_mode_msg
 Emitted when a MODE message is received.
boost::signal1< void,
const message & > 
sig_singlemode_msg
 Emitted for each individual mode change.
boost::signal1< void,
const message & > 
sig_topic_msg
 Emitted when a TOPIC message is received.
boost::signal1< void,
const message & > 
sig_invite_msg
 Emitted when an INVITE message is received.
boost::signal1< void,
const message & > 
sig_kick_msg
 Emitted when a KICK message is received.
boost::signal1< void,
const message & > 
sig_privmsg_msg
 Emitted when a PRIVMSG message is received.
boost::signal1< void,
const message & > 
sig_ctcp_msg
 Emitted when a CTCP message is received.
boost::signal1< void,
const message & > 
sig_notice_msg
 Emitted when a NOTICE message is received.
boost::signal1< void,
const message & > 
sig_ping_msg
 Emitted when a PING message is received.
boost::signal1< void,
const message & > 
sig_pong_msg
 Emitted when a PONG message is received.
boost::signal1< void,
const message & > 
sig_error_msg
 Emitted when an ERROR message is received.


Detailed Description

The session represents one client connected to an IRC server.

The session is the starting point for using this library. The session is responsible for creating and handling all other objects, sending commands to the IRC server, and providing messages back to you from the IRC server.

The session object has some general management functions, for example connect(), disconnect(), service_socket(), run().

IRC commands like JOIN, PRIVMSG, are sent to the server using the session's cmd_ functions (e.g. cmd_join(), cmd_privmsg())

Messages from the IRC server are provided by signals such as sig_join_msg, sig_privmsg_msg, which can be connected to your own handler functions like this:

mysession->sig_join_msg.connect(myhandler);

The function myhandler will then be called whenever a JOIN message is received.

For more information, see the tutorials in the manual. (http://libircpp.sf.net/manual/)


Constructor & Destructor Documentation

ircpp::session::session ( listmode  mode = automatic  )  [explicit]

Creates a session.

Creates a new IRC session

Parameters:
mode (optional) The mode of the user & channel lists. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).


Member Function Documentation

bool ircpp::session::connect ( const std::string &  hostname,
unsigned int  port = 6667,
const std::string &  password = "",
bool  login = true 
)

Connects to an IRC server.

Before calling connect, you must specify a nick, username, and realname via the set_nick(), set_username(), and set_realname() functions.

Parameters:
hostname The hostname of the irc server to connect to.
port (optional) The port to connect to. Defaults to 6667 if omitted.
password (optional) The password to supply to the irc server. Defaults to blank if omitted.
login (optional) If set to false, the NICK and USER commands will not be sent on connect - you must send them manually. Defaults to true if omitted.
Returns:
true if the connection attempt succeeded, or false if it failed, or if one of nick, username, or realname were not set.

void ircpp::session::run (  ) 

Starts the IRC session running.

The run function goes into an endless loop, processing incoming messages and generating signals. It will only return when you are disconnected from the IRC server. The run function repeatedly calls service_socket() and select().

Note: You do not have to use run() - it is there only for convenience. If your program uses other sockets, or you wish to have more control over the main loop, you may use service_socket(), and call select() in your own loop.

bool ircpp::session::service_socket ( fd_set *  readfds,
fd_set *  writefds,
fd_set *  exceptfds,
int *  maxfd 
)

Services the socket connecting the session to the IRC server.

Note: For a simpler way to run a single irc session, consider using run() instead of service_socket()

This function should be used in conjunction with the system call select(). After calling select() with your three fd_set variables, supply the same fd_sets to service_socket, along with the address of an integer, maxfd, which will be updated with the maximum file descripter number used , as required by select(). service_socket() will read and write data as necessary, then add its socket's file descriptors to the fd_sets you have provided, ready for select() to be called again.

bool ircpp::session::connected (  ) 

Returns whether the session is connected.

Returns:
true if the session is connected to the irc server, false otherwise

bool ircpp::session::disconnect (  ) 

Disconnects from the IRC server.

This function disconnects from the IRC server immediately. You should probably use cmd_quit instead.

Returns:
true if the disconnection succeeded, false otherwise.

bool ircpp::session::set_nick ( const std::string &  newnick  ) 

Sets the nickname.

Sets or changes the nick to be used by the session.

This function is for use before the session is connected, to set the initial nickname supplied to the server on login. To change nick while connected, use cmd_nick()

Returns:
true on success, false otherwise.

bool ircpp::session::set_username ( const std::string &  username  ) 

Sets the username.

Sets the username (sometimes known as ident) to be used by the session.

Note that this function may only be used when the session is disconnected, because the username cannot be changed while connected to IRC.

Returns:
true on success, false if the session is connected.

bool ircpp::session::set_realname ( const std::string &  realname  ) 

Sets the realname (gecos).

Sets the realname (also known as gecos) to be used by the session.

Note that this function may only be used when the session is disconnected, because the realname cannot be changed while connected to IRC.

Returns:
true on success, false if the session is connected.

const user & ircpp::session::me (  )  const

Returns the "me" user object.

Returns:
a reference to the user object that corresponds to our nick on irc.

const user & ircpp::session::server (  )  const

Returns the "server" user object.

The server to which we are connected is represented by a user object because it has a name, and sends server messages to us. Server messages will come from this user.

Returns:
a reference to the user object that corresponds to the irc server to which we are connected.

void ircpp::session::auto_pong ( bool  on  ) 

Enables or disables auto-pong.

By default, libircpp will automatically reply to PING requests from the IRC server with a PONG reply. If you want to reply manually to PING requests, set auto-pong to false.

Parameters:
on Sets auto-pong on if true, off if false

bool ircpp::session::auto_pong (  ) 

Returns whether or not auto-pong is enabled.

Returns:
true if auto-pong is enabled, false otherwise

bool ircpp::session::has_capab ( const std::string &  name  ) 

Determine whether the irc server has a certain capability.

Server capabilities are reported in the 005 numeric when connecting to an IRC server and contain such information as the number of channels that may be joined, the network name, and the availability of many other features.

This function returns whether or not the irc server has mentioned a named capability in the 005 numeric. For more information and a list of capability names, see: http://www.irc.org/tech_docs/005.html

Parameters:
name the name of the capability to be queried
Returns:
true if the server has mentioned the named capability, false otherwise

const string & ircpp::session::capab ( const std::string &  name  ) 

Return the value associated with a named server capability.

Many of the server capabilities reported in the 005 numeric are name=value pairs.

This function returns the value associated with a certain capability, for example NETWORK returns the network name, MAXCHANNELS returns the maximum number of channels that may be joined.

Use has_capab() to determine whether the server has capabilities that are not name=value pairs. For more information and a list of capability names, see: http://www.irc.org/tech_docs/005.html

Parameters:
name the name of the capability to be queried
Returns:
the value associated with the name if the server provided it, an empty string otherwise

void ircpp::session::ptr ( void *  p  ) 

Sets the user-defined pointer.

To help keep track of sessions, you can save a user-defined pointer inside the session object.

The user-defined pointer is of type void *, and you can set it to anything you like

Parameters:
p The user-defined pointer to set

void * ircpp::session::ptr (  )  const

Returns the user-defined pointer.

If the user-defined pointer has not yet been set, it will be NULL

Returns:
The user-defined pointer previously set

bool ircpp::session::cmd_raw ( const std::string &  rawline  ) 

Sends a raw line of data to the IRC server.

The supplied line of data will be sent to the irc server unprocessed, except for the addition of a CRLF to the end.

Parameters:
rawline The raw line of data to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_pass ( const std::string &  password  ) 

Sends the PASS message to the IRC server.

This command is used at connection registration to send a server password.

Note that if the login parameter to connect() is true (the default), the password will be sent automatically, and you will not need to use this function.

Parameters:
password The server password to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_nick ( const std::string &  newnick  ) 

Sends the NICK message to the IRC server.

This command is used at connection registration to send the nickname, and while connected to change nick.

Note that if the login parameter to connect() is true (the default), the nick will be sent automatically, and you will not need to use this function at login time.

Parameters:
newnick The nickname to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_user ( const std::string &  username,
const std::string &  hostname,
const std::string &  servername,
const std::string &  realname 
)

Sends the USER message to the IRC server.

This command is used at connection registration to set the username, hostname, servername, and realname

Note that if the login parameter to connect() is true (the default), these details will be sent automatically, and you will not need to use this function.

Parameters:
username The username to be sent
hostname The hostname to be sent
servername The servername to be sent
realname The realname to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_quit ( const std::string &  quitmsg  ) 

Sends the QUIT message to the IRC server.

This command is used to disconnect from IRC, and display a quit message.

Parameters:
quitmsg The quit message to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_join ( const std::string &  channel,
const std::string &  key = "" 
)

Sends the JOIN message to the IRC server.

This command is used to join a channel.

Parameters:
channel The channel to join
key (optional) The channel key (password), if required.
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_part ( const std::string &  channel,
const std::string &  partmsg = "" 
)

Sends the PART message to the IRC server.

This command is used to leave a channel, and optionally display a part message.

Note that you can also use the channel object's cmd_part() function to leave a specific channel

Parameters:
channel The channel to leave
partmsg (optional) The part message to be sent
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_mode ( const std::string &  target,
const std::string &  modestring 
)

Sends the MODE message to the IRC server.

This command is used to change a mode on a user or channel

Note that you can also use the entity object's cmd_mode() function to change the mode of a user or channel

Parameters:
target The user or channel on which to change the mode.
modestring A string describing the mode change (e.g. "+o Joebloggs")
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_topic ( const std::string &  channel,
const std::string &  topic 
)

Sends the TOPIC message to the IRC server.

This command is used to change a channel's topic

Note that you can also use the channel object's cmd_topic() function to change a channel's topic

Parameters:
channel The channel whose topic is to be changed
topic The new topic
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_names ( const std::string &  channel  ) 

Sends the NAMES message to the IRC server.

This command is used to request the list of nicknames that are in a channel

Note that you can also use the channel object's cmd_names() function to request the nickname list of a channel

Parameters:
channel The channel to be queried
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_list ( const std::string &  params = ""  ) 

Sends the LIST message to the IRC server.

This command is used to request the list of channels present on the IRC server

Parameters:
params (optional) Any parameters to the list command
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_invite ( const std::string &  nick,
const std::string &  channel 
)

Sends the INVITE message to the IRC server.

This command is used to invite a user to a channel

Note that you can also use the channel object's cmd_names() function to request the nickname list of a channel

Parameters:
nick The nickname to invite
channel The channel to invite the user to
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_kick ( const std::string &  nick,
const std::string &  channel,
const std::string &  reason = "" 
)

Sends the KICK message to the IRC server.

This command is used to kick a user from a channel

Note that you can also use the channel object's cmd_kick() function to kick a user from a channel

Parameters:
nick The nickname to kick
channel The channel to kick the user from
reason (optional) The reason for kicking the user
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_privmsg ( const std::string &  to,
const std::string &  message 
)

Sends the PRIVMSG message to the IRC server.

This command is used to send a message to a user or channel. Contrary to its name, PRIVMSG is used for both private messages and normal messages to channels.

Note that you can also use the entity object's cmd_privmsg() function to send a message to a user or channel

Parameters:
to The name of the user or channel to send the message to
message The message to send
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_notice ( const std::string &  to,
const std::string &  message 
)

Sends the NOTICE message to the IRC server.

This command is used to send a notice to a user or channel

Note that you can also use the entity object's cmd_notice() function to send a notice to a user or channel

Parameters:
to The name of the user or channel to send the notice to
message The text of notice to send
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_ctcp ( const std::string &  to,
const std::string &  command,
const std::string &  params 
)

Sends the CTCP message to the IRC server.

This command is used to send a CTCP command to a user or channel

Note that you can also use the entity object's cmd_ctcp() function to send a CTCP command to a user or channel

Parameters:
to The name of the user or channel to send the CTCP message to
command The CTCP command to send (e.g. "ACTION")
params The parameters of the command
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_ping ( const std::string &  params  ) 

Sends the PING message to the IRC server.

This command is used to send a PING message to the IRC server. Note that this is different from the more commonly used CTCP PING command, used to "ping" a user. To send a CTCP PING, use cmd_ctcp()

Parameters:
params The parameters of the command
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_pong ( const std::string &  params  ) 

Sends the PONG message to the IRC server.

This command is used to send a PONG message to the IRC server.

Note that by default, libircpp automatically sends PONG messages in response to the server's PING messages. If you want to do this manually, turn auto_pong() off, then use this command.

Parameters:
params The parameters of the command
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_away ( const std::string &  message = ""  ) 

Sends the AWAY message to the IRC server.

This command is used to mark yourself as away, or back, and to leave an away message

Parameters:
message (optional) The away message. If left blank, the server will mark you as back.
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_oper ( const std::string &  opernick,
const std::string &  operpass 
)

Sends the OPER message to the IRC server.

This command is used to obtain IRC Operator status

Parameters:
opernick Your operator nick, as set in your O: line
operpass Your operator password, as set in your O: line
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_who ( const std::string &  params  ) 

Sends the WHO message to the IRC server.

This command is used to obtain information about a user or users

Parameters:
params The parameters of the WHO request
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

bool ircpp::session::cmd_whois ( const std::string &  target  ) 

Sends the WHOIS message to the IRC server.

This command is used to obtain information about a user

Parameters:
target The nickname of the user to obtain information about
Returns:
true if the command was sent successfully, false if not connected or if the output buffer is full

listmode ircpp::session::list_mode (  )  const

Returns this session's list mode.

See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

const channel & ircpp::session::find_channel ( const std::string &  name  )  const

Finds a channel in the internal channel list.

If the internal lists are enabled, libircpp will keep track of all the channels you are in. This function finds a channel object from the channel list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

If the channel cannot be found, a reference to the null channel will be returned. You can test for this with if(!ch), where ch is the returned reference.

Parameters:
name The name of the channel to find
Returns:
A reference to a channel object on success, or a reference to the null channel if not found.

const irclist< channel >::iterator ircpp::session::channellist_begin (  )  const

Returns an iterator the beginning of the channel list.

If the internal lists are enabled, libircpp will keep track of all the channels you are in. This function returns an iterator to the start of the channel list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

Returns:
An iterator the beginning of the channel list

const irclist< channel >::iterator ircpp::session::channellist_end (  )  const

Returns an iterator the end of the channel list.

If the internal lists are enabled, libircpp will keep track of all the channels you are in. This function returns an iterator to the end of the channel list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

Returns:
An iterator the end of the channel list

const user & ircpp::session::find_user ( const std::string &  nick  )  const

Finds a user in the internal user list.

If the internal lists are enabled, libircpp will keep track of all users who share a channel with you. This function finds a user object from the user list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

If the user cannot be found, a reference to the null user will be returned. You can test for this with if(!u), where u is the returned reference.

Parameters:
nick The nick of the user to find
Returns:
A reference to a user object on success, or a reference to the null user if not found.

const irclist< user >::iterator ircpp::session::userlist_begin (  )  const

Returns an iterator the beginning of the user list.

If the internal lists are enabled, libircpp will keep track of all users who share a channel with you. This function returns an iterator to the start of the user list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

Returns:
An iterator the beginning of the user list

const irclist< user >::iterator ircpp::session::userlist_end (  )  const

Returns an iterator the beginning of the user list.

If the internal lists are enabled, libircpp will keep track of all users who share a channel with you. This function returns an iterator to the end of the user list. See the manual section on lists for more information (http://libircpp.sf.net/manual/lists.html).

Returns:
An iterator the end of the user list


Member Data Documentation

boost::signal0<void> ircpp::session::sig_connected

Emitted when the session successfully connects to the IRC server.

Whenever the session successfully establishes a connection to the IRC server, whether for the first time or after a disconnection, this signal will be emitted.

boost::signal1<void, const std::string&> ircpp::session::sig_disconnected

Emitted when the session is disconnected from the IRC server.

Whenever the session is disconnected, for any reason, this message will be emitted. The first parameter contains a brief textual description of the reason for disconnection, such as "Quit", or "Ping Timeout"

Parameters:
reason The reason for disconnection

boost::signal2<void, const std::string&, const int> ircpp::session::sig_socket_error

Emitted when a network socket error occurs.

The parameters indicate a textual and integer representation of the error code, as detailed in the standard errno.h. Note that sig_disconnected will be emitted in addition to this signal

Parameters:
string Textual error reason
int Numerical error reason (see errno)

boost::signal1<void, user*> ircpp::session::sig_user_deletable

Emitted when a user may be safely deleted.

When the session has its lists set to manual mode, it is your responsibility to delete user and channel objects when finished with them. This signal indicates that libircpp has finshed with a user object, and you may safely delete it when you no longer need it. For more information, see the manual section on lists

Parameters:
user A reference to the user which may now be deleted.

boost::signal1<void, channel*> ircpp::session::sig_channel_deletable

Emitted when a channel may be safely deleted.

When the session has its lists set to manual mode, it is your responsibility to delete user and channel objects when finished with them. This signal indicates that libircpp has finshed with a channel object, and you may safely delete it when you no longer need it. For more information, see the manual section on lists

Parameters:
channel A reference to the channel which may now be deleted.

boost::signal1<void, const std::string&> ircpp::session::sig_parseerror

Emitted when a parse error occurs If the parser cannot understand a line sent to it by the IRC server it will give up and emit this signal.

Parameters:
string The line that failed to parse.

boost::signal1<void, const message &> ircpp::session::sig_all_msgs

Emitted when any message is received.

Any message received from the IRC server will cause this signal to be emitted, regardless of its command. If you want to be notified about all messages ever, you should connect to this signal.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_unknown_msg

Emitted when an unknown message is received.

If a valid message is received of a type which is not understood by libircpp, this signal will be emitted.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_numeric_msg

Emitted when a numeric message is received.

IRC messages which are numeric replies (e.g. 001, 352) as opposed to textual commands (PRIVMSG, NICK, etc.) will cause this signal to be emitted.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_nick_msg

Emitted when a NICK message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_quit_msg

Emitted when a QUIT message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_join_msg

Emitted when a JOIN message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_part_msg

Emitted when a PART message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_mode_msg

Emitted when a MODE message is received.

Note that MODE messages as received from the server may contain more than one mode change per message (e.g. +oo nick1 nick2). If you want to receive the mode changes singly, use sig_singlemode_msg instead.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_singlemode_msg

Emitted for each individual mode change.

Because each MODE message may contain more than one mode change, it is useful to split them up into individual mode changes.

Each time a MODE message arrives, libircpp first emits sig_mode_msg, then splits the MODE message up into individual mode changes, and for each one emits sig_singlemode_msg, which contains an artificial MODE message corresponding to that single mode.

Note that MODE messages emitted by this signal are not real messages which have arrived from the IRC server, but are generated artificially.

Parameters:
message The generated single MODE message.

boost::signal1<void, const message &> ircpp::session::sig_topic_msg

Emitted when a TOPIC message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_invite_msg

Emitted when an INVITE message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_kick_msg

Emitted when a KICK message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_privmsg_msg

Emitted when a PRIVMSG message is received.

Note that a PRIVMSG is a normal private *or* channel message.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_ctcp_msg

Emitted when a CTCP message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_notice_msg

Emitted when a NOTICE message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_ping_msg

Emitted when a PING message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_pong_msg

Emitted when a PONG message is received.

Parameters:
message The received message.

boost::signal1<void, const message &> ircpp::session::sig_error_msg

Emitted when an ERROR message is received.

Parameters:
message The received message.


The documentation for this class was generated from the following files:
Generated on Sat Oct 13 23:35:41 2007 for libircpp by  doxygen 1.5.3