irc_callbacks_t(3)

NAME
irc_callbacks_t - Event callbacks structure.

SYNOPSIS

#include <libirc_events.h>

  Data Fields
irc_event_callback_t event_connect
irc_event_callback_t event_nick
irc_event_callback_t event_quit
irc_event_callback_t event_join
irc_event_callback_t event_part
irc_event_callback_t event_mode
irc_event_callback_t event_umode
irc_event_callback_t event_topic
irc_event_callback_t event_kick
irc_event_callback_t event_channel
irc_event_callback_t event_privmsg
irc_event_callback_t event_notice
irc_event_callback_t event_channel_notice
irc_event_callback_t event_invite
irc_event_callback_t event_ctcp_req
irc_event_callback_t event_ctcp_rep
irc_event_callback_t event_ctcp_action
irc_event_callback_t event_unknown
irc_eventcode_callback_t event_numeric
irc_event_dcc_chat_t event_dcc_chat_req
irc_event_dcc_send_t event_dcc_send_req

Detailed Description

Event callbacks structure. All the communication with the IRC network is based on events. Generally speaking, event is anything generated by someone else in the network, or by the IRC server itself. 'Someone sends you a message', 'Someone has joined the channel', 'Someone has quits IRC' - all these messages are events.

Every event has its own event handler, which is called when the appropriate event is received. You don't have to define all the event handlers; define only the handlers for the events you need to intercept.

Most event callbacks are the types of irc_event_callback_t. There are also events, which generate irc_eventcode_callback_t, irc_event_dcc_chat_t and irc_event_dcc_send_t callbacks.

Field Documentation

  irc_event_callback_t irc_callbacks_t::event_channel

The 'channel' event is triggered upon receipt of a PRIVMSG message to an entire channel, which means that someone on a channel with the client has said something aloud. Your own messages don't trigger PRIVMSG event.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, contains the channel name.
    params[1] optional, contains the message text

  irc_event_callback_t irc_callbacks_t::event_channel_notice

The 'channel_notice' event is triggered upon receipt of a NOTICE message which means that someone has sent the client a public notice. According to RFC 1459, the only difference between NOTICE and PRIVMSG is that you should NEVER automatically reply to NOTICE messages. Unfortunately, this rule is frequently violated by IRC servers itself - for example, NICKSERV messages require reply, and are NOTICEs.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, contains the channel name.
    params[1] optional, contains the message text

  irc_event_callback_t irc_callbacks_t::event_connect

The 'on_connect' event is triggered when the client successfully connects to the server, and could send commands to the server. No extra params supplied; params is 0.

  irc_event_callback_t irc_callbacks_t::event_ctcp_action

The 'action' event is triggered when the client receives the CTCP ACTION message. These messages usually looks like:

 [23:32:55] * Tim gonna sleep.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, the ACTION message.

  irc_event_callback_t irc_callbacks_t::event_ctcp_rep

The 'ctcp' event is triggered when the client receives the CTCP reply.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, the CTCP message itself with its arguments.

  irc_event_callback_t irc_callbacks_t::event_ctcp_req

The 'ctcp' event is triggered when the client receives the CTCP request. By default, the built-in CTCP request handler is used. The build-in handler automatically replies on most CTCP messages, so you will rarely need to override it.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, the complete CTCP message, including its arguments.

Mirc generates PING, FINGER, VERSION, TIME and ACTION messages, check the source code of libirc_event_ctcp_internal function to see how to write your own CTCP request handler. Also you may find useful this question in FAQ: What is CTCP, and why do I need my own handler?

  irc_event_dcc_chat_t irc_callbacks_t::event_dcc_chat_req

The 'dcc chat' event is triggered when someone requests a DCC CHAT from you.

See the params in irc_event_dcc_chat_t specification.

  irc_event_dcc_send_t irc_callbacks_t::event_dcc_send_req

The 'dcc chat' event is triggered when someone wants to send a file to you via DCC SEND request.

See the params in irc_event_dcc_send_t specification.

  irc_event_callback_t irc_callbacks_t::event_invite

The 'invite' event is triggered upon receipt of an INVITE message, which means that someone is permitting the client's entry into a +i channel.

Parameters:
    origin the person, who INVITEs you.
    params[0] mandatory, contains your nick.
    params[1] mandatory, contains the channel name you're invited into.

See also:
    irc_cmd_invite irc_cmd_chanmode_invite

  irc_event_callback_t irc_callbacks_t::event_join

The 'join' event is triggered upon receipt of a JOIN message, which means that someone has entered a channel that the client is on.

Parameters:
    origin the person, who joins the channel. By comparing it with your own nickname, you can check whether your JOIN command succeed.
    params[0] mandatory, contains the channel name.

  irc_event_callback_t irc_callbacks_t::event_kick

The 'kick' event is triggered upon receipt of a KICK message, which means that someone on a channel with the client (or possibly the client itself!) has been forcibly ejected.

Parameters:
    origin the person, who kicked the poor.
    params[0] mandatory, contains the channel name.
    params[0] optional, contains the nick of kicked person.
    params[1] optional, contains the kick text

  irc_event_callback_t irc_callbacks_t::event_mode

The 'mode' event is triggered upon receipt of a channel MODE message, which means that someone on a channel with the client has changed the channel's parameters.

Parameters:
    origin the person, who changed the channel mode.
    params[0] mandatory, contains the channel name.
    params[1] mandatory, contains the changed channel mode, like '+t', '-i' and so on.
    params[2] optional, contains the mode argument (for example, a key for +k mode, or user who got the channel operator status for +o mode)

  irc_event_callback_t irc_callbacks_t::event_nick

The 'nick' event is triggered when the client receives a NICK message, meaning that someone (including you) on a channel with the client has changed their nickname.

Parameters:
    origin the person, who changes the nick. Note that it can be you!
    params[0] mandatory, contains the new nick.

  irc_event_callback_t irc_callbacks_t::event_notice

The 'notice' event is triggered upon receipt of a NOTICE message which means that someone has sent the client a public or private notice. According to RFC 1459, the only difference between NOTICE and PRIVMSG is that you should NEVER automatically reply to NOTICE messages. Unfortunately, this rule is frequently violated by IRC servers itself - for example, NICKSERV messages require reply, and are NOTICEs.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, contains the target nick name.
    params[1] optional, contains the message text

  irc_eventcode_callback_t irc_callbacks_t::event_numeric

The 'numeric' event is triggered upon receipt of any numeric response from the server. There is a lot of such responses, see the full list here: Numeric reply codes from RFC1459.

See the params in irc_eventcode_callback_t specification.

  irc_event_callback_t irc_callbacks_t::event_part

The 'part' event is triggered upon receipt of a PART message, which means that someone has left a channel that the client is on.

Parameters:
    origin the person, who leaves the channel. By comparing it with your own nickname, you can check whether your PART command succeed.
    params[0] mandatory, contains the channel name.
    params[1] optional, contains the reason message (user-defined).

  irc_event_callback_t irc_callbacks_t::event_privmsg

The 'privmsg' event is triggered upon receipt of a PRIVMSG message which is addressed to one or more clients, which means that someone is sending the client a private message.

Parameters:
    origin the person, who generates the message.
    params[0] mandatory, contains your nick.
    params[1] optional, contains the message text

  irc_event_callback_t irc_callbacks_t::event_quit

The 'quit' event is triggered upon receipt of a QUIT message, which means that someone on a channel with the client has disconnected.

Parameters:
    origin the person, who is disconnected
    params[0] optional, contains the reason message (user-specified).

  irc_event_callback_t irc_callbacks_t::event_topic

The 'topic' event is triggered upon receipt of a TOPIC message, which means that someone on a channel with the client has changed the channel's topic.

Parameters:
    origin the person, who changes the channel topic.
    params[0] mandatory, contains the channel name.
    params[1] optional, contains the new topic.

  irc_event_callback_t irc_callbacks_t::event_umode

The 'umode' event is triggered upon receipt of a user MODE message, which means that your user mode has been changed.

Parameters:
    origin the person, who changed the channel mode.
    params[0] mandatory, contains the user changed mode, like '+t', '-i' and so on.

  irc_event_callback_t irc_callbacks_t::event_unknown

The 'unknown' event is triggered upon receipt of any number of unclassifiable miscellaneous messages, which aren't handled by the library.

Author

Generated automatically by Doxygen for libircclient from the source code.