#include <irc_connection.h>
Operations | |
| CL_IRCConnection & | operator= (const CL_IRCConnection ©) |
| void | send_command (const CL_String8 &prefix, const CL_String8 &command, const std::vector< CL_String8 > ¶ms) |
| Send command to IRC server. | |
| void | send_pass (const CL_String8 &password) |
| Send password. | |
| void | send_nick (const CL_String8 &nick, int hopcount=-1) |
| Send nick. | |
| void | send_user (const CL_String8 &username, const CL_String8 &hostname, const CL_String8 &servername, const CL_String8 &realname) |
| Send user login/identify command. | |
| void | send_oper (const CL_String8 &user, const CL_String8 &password) |
| Send operator login command. | |
| void | send_quit (const CL_String8 &quitmessage="") |
| Send quit command. | |
| void | send_join (const CL_String8 &channel, const CL_String8 &key="") |
| Send join channel command. | |
| void | send_join (const std::list< CL_String8 > &channels, const std::list< CL_String8 > &keys) |
| Send join. | |
| void | send_part (const CL_String8 &channel, const CL_String8 &reason="") |
| Send part channel command. | |
| void | send_part (const std::list< CL_String8 > &channels, const CL_String8 &reason="") |
| Send part. | |
| void | send_mode (const CL_String8 &target, const CL_String8 &mode, const std::vector< CL_String8 > &args) |
| Send set mode command. | |
| void | send_topic (const CL_String8 &channel, const CL_String8 &topic) |
| Set/Get topic on channel. | |
| void | send_topic (const CL_String8 &channel) |
| Send topic. | |
| void | send_names (const CL_String8 &channel="") |
| List nicks on channel(s). | |
| void | send_names (const std::list< CL_String8 > &channels) |
| Send names. | |
| void | send_list (const CL_String8 &channel="", const CL_String8 &server="") |
| Send list of channels. | |
| void | send_list (const std::list< CL_String8 > &channels, const CL_String8 &server="") |
| Send list. | |
| void | send_invite (const CL_String8 &nickname, const CL_String8 &channel) |
| Send channel join invitation. | |
| void | send_kick (const CL_String8 &channel, const CL_String8 &user, const CL_String8 &comment="") |
| Send kick command. | |
| void | send_kick (const std::list< CL_String8 > &channels, const std::list< CL_String8 > &users, const CL_String8 &comment="") |
| Send kick. | |
| void | send_version (const CL_String8 &server="") |
| Send version command. | |
| void | send_stats (const CL_String8 &query="", const CL_String8 &server="") |
| Send statistics command. | |
| void | send_links (const CL_String8 &remote_server="", const CL_String8 &server_mask="") |
| Send links command. | |
| void | send_time (const CL_String8 &server="") |
| Send time command. | |
| void | send_connect (const CL_String8 &target_server, int port=0, const CL_String8 &remote_server="") |
| Send connect command. | |
| void | send_trace (const CL_String8 &server=CL_String8()) |
| Send trace command. | |
| void | send_admin (const CL_String8 &server=CL_String8()) |
| Send admin command. | |
| void | send_info (const CL_String8 &server=CL_String8()) |
| Send info command. | |
| void | send_privmsg (const CL_String8 &receiver, const CL_String8 &text) |
| Send channel message or private message. | |
| void | send_privmsg (const std::list< CL_String8 > &receivers, const CL_String8 &text) |
| Send privmsg. | |
| void | send_privmsg_ctcp (const CL_String8 &receiver, const CL_String8 &command, const CL_String8 &data) |
| Send Client To Client Protocol (CTCP) message. | |
| void | send_privmsg_ctcp (std::list< CL_String8 > &receivers, const CL_String8 &command, const CL_String8 &data) |
| Send privmsg ctcp. | |
| void | send_notice (const CL_String8 &nickname, const CL_String8 &text) |
| Send notice message. | |
| void | send_notice_ctcp (const CL_String8 &nickname, const CL_String8 &command, const CL_String8 &data) |
| Send Client To Client Protocol (CTCP) notice. | |
| void | send_who (const CL_String8 &name, bool oper=false) |
| Send who command. | |
| void | send_whois (const CL_String8 &nickmask) |
| Send whois command. | |
| void | send_whois (const CL_String8 &server, const CL_String8 &nickmask) |
| Send whois. | |
| void | send_whois (const std::list< CL_String8 > &nickmasks) |
| Send whois. | |
| void | send_whois (const CL_String8 &server, const std::list< CL_String8 > &nickmasks) |
| Send whois. | |
| void | send_whowas (const CL_String8 &nickname, int count=0, const CL_String8 &server="") |
| Send whowas command. | |
| void | send_kill (const CL_String8 &nickname, const CL_String8 &comment) |
| Send kill command. | |
| void | send_ping (const CL_String8 &server, const CL_String8 &server2="") |
| Send ping command. | |
| void | send_pong (const CL_String8 &daemon, const CL_String8 &daemon2="") |
| Send pong command. | |
| static CL_String8 | extract_nick (const CL_String8 &str) |
| Extracts nick part of a fully qualified IRC prefix. | |
| static CL_String8 | extract_user (const CL_String8 &str) |
| Extracts user part of a fully qualified IRC prefix. | |
| static CL_String8 | extract_address (const CL_String8 &str) |
| Extracts address part of a fully qualified IRC prefix. | |
Public Member Functions | |
Construction | |
| CL_IRCConnection () | |
| Constructs a CL_IRCConnection and connects a server. | |
| CL_IRCConnection (const CL_String &server, const CL_String &port=cl_text("6667")) | |
| Constructs a IRCConnection. | |
| CL_IRCConnection (const CL_IRCConnection ©) | |
| Constructs a IRCConnection. | |
| ~CL_IRCConnection () | |
Attributes | |
| const CL_String8 & | get_nick () const |
| Returns our current nick name. | |
| const CL_String8 & | get_username () const |
| Returns the username passed to send_user. | |
| const CL_String8 & | get_hostname () const |
| Returns hostname passed to send_user. | |
| const CL_String8 & | get_servername () const |
| Returns server name passed to send_user. | |
| const CL_String8 & | get_realname () const |
| Returns the real name passed to send_user. | |
Signals | |
| CL_Signal_v1< const CL_String & > & | sig_socket_error () |
| sig_socket_error(error_message) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const std::vector< CL_String8 > & > & | sig_command_received () |
| sig_command_received(prefix, command, params) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const std::vector< CL_String8 > & > & | sig_unknown_command_received () |
| sig_unknown_command_received(prefix, command, params) | |
| CL_Signal_v3< const CL_String8 &, int, const std::vector< CL_String8 > & > & | sig_numeric_reply () |
| sig_numeric_reply(prefix, code, params) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const std::vector< CL_String8 > & > & | sig_name_reply () |
| sig_name_reply(self, channel, users) | |
| CL_Signal_v2< const CL_String8 &, const CL_String8 & > & | sig_nick () |
| sig_nick(old_nick, new_nick) | |
| CL_Signal_v2< const CL_String8 &, const CL_String8 & > & | sig_join () |
| sig_join(nick, channel) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_part () |
| sig_part(nick, channel, reason) | |
| CL_Signal_v4< const CL_String8 &, const CL_String8 &, const CL_String8 &, const std::vector< CL_String8 > & > & | sig_mode () |
| sig_mode(prefix, receiver, mode, params) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_topic () |
| sig_topic(prefix, channel, topic) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_invite () |
| sig_invite(prefix, nick, channel) | |
| CL_Signal_v4< const CL_String8 &, const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_kick () |
| sig_kick(prefix, chan, user, comment) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_privmsg () |
| sig_privmsg(prefix, receiver, text) | |
| CL_Signal_v3< const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_notice () |
| sig_notice(prefix, receiver, text) | |
| CL_Signal_v4< const CL_String8 &, const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_privmsg_ctcp () |
| sig_privmsg_ctcp(prefix, receiver, command, data) | |
| CL_Signal_v4< const CL_String8 &, const CL_String8 &, const CL_String8 &, const CL_String8 & > & | sig_notice_ctcp () |
| sig_notice_ctcp(prefix, receiver, command, data) | |
| CL_Signal_v2< const CL_String8 &, const CL_String8 & > & | sig_ping () |
| sig_ping(daemon1, daemon2) | |
The CL_IRCConnection class represents a socket connection to an IRC server. Upon construction it will connect to the server+port given and then parse each line written by the IRC server. Each time process_data() is called, the CL_IRCConnection will emit the signals for those commands received.
Most IRC networks will expect the connecting IRC client to first send a "nick" command and then a "user" command, as part of the logon process. CL_IRCConnection will not do this, so the general logon procedure looks somewhat like this:
CL_IRCConnection connection("irc.freenode.net", "6667");
connection.send_nick("MyNick");
connection.send_user("username", "our.hostname", "irc.freenode.net", "User Name");
IRC servers will occationally send a "ping" line, which have to be replied with a "pong" command. If this isn't done within some server specific timeout, the IRC network will disconnect the client. CL_IRCConnection will also not do this automatically, so its important you at least hook up the ping slot, to a function looking like this:
void on_ping(const CL_String8 &daemon1, const CL_String8 &daemon2)
{ connection.send_pong(daemon1, daemon2); }
|
|
Constructs a CL_IRCConnection and connects a server.
|
|
||||||||||||
|
Constructs a IRCConnection.
|
|
|
Constructs a IRCConnection.
|
|
|
|
|
|
Extracts address part of a fully qualified IRC prefix.
|
|
|
Extracts nick part of a fully qualified IRC prefix.
|
|
|
Extracts user part of a fully qualified IRC prefix.
|
|
|
Returns hostname passed to send_user.
|
|
|
Returns our current nick name.
|
|
|
Returns the real name passed to send_user.
|
|
|
Returns server name passed to send_user.
|
|
|
Returns the username passed to send_user.
|
|
|
|
|
|
Send admin command.
|
|
||||||||||||||||
|
Send command to IRC server.
|
|
||||||||||||||||
|
Send connect command.
|
|
|
Send info command.
|
|
||||||||||||
|
Send channel join invitation.
|
|
||||||||||||
|
Send join.
|
|
||||||||||||
|
Send join channel command.
|
|
||||||||||||||||
|
Send kick.
|
|
||||||||||||||||
|
Send kick command.
|
|
||||||||||||
|
Send kill command.
|
|
||||||||||||
|
Send links command.
|
|
||||||||||||
|
Send list.
|
|
||||||||||||
|
Send list of channels.
|
|
||||||||||||||||
|
Send set mode command.
|
|
|
Send names.
|
|
|
List nicks on channel(s).
|
|
||||||||||||
|
Send nick.
|
|
||||||||||||
|
Send notice message.
|
|
||||||||||||||||
|
Send Client To Client Protocol (CTCP) notice.
|
|
||||||||||||
|
Send operator login command.
|
|
||||||||||||
|
Send part.
|
|
||||||||||||
|
Send part channel command.
|
|
|
Send password.
|
|
||||||||||||
|
Send ping command.
|
|
||||||||||||
|
Send pong command.
|
|
||||||||||||
|
Send privmsg.
|
|
||||||||||||
|
Send channel message or private message.
|
|
||||||||||||||||
|
Send privmsg ctcp.
|
|
||||||||||||||||
|
Send Client To Client Protocol (CTCP) message.
|
|
|
Send quit command.
|
|
||||||||||||
|
Send statistics command.
|
|
|
Send time command.
|
|
|
Send topic.
|
|
||||||||||||
|
Set/Get topic on channel.
|
|
|
Send trace command.
|
|
||||||||||||||||||||
|
Send user login/identify command.
|
|
|
Send version command.
|
|
||||||||||||
|
Send who command.
|
|
||||||||||||
|
Send whois.
|
|
|
Send whois.
|
|
||||||||||||
|
Send whois.
|
|
|
Send whois command.
|
|
||||||||||||||||
|
Send whowas command.
|
|
|
sig_command_received(prefix, command, params)
|
|
|
sig_invite(prefix, nick, channel)
|
|
|
sig_join(nick, channel)
|
|
|
sig_kick(prefix, chan, user, comment)
|
|
|
sig_mode(prefix, receiver, mode, params)
|
|
|
sig_name_reply(self, channel, users)
|
|
|
sig_nick(old_nick, new_nick)
|
|
|
sig_notice(prefix, receiver, text)
|
|
|
sig_notice_ctcp(prefix, receiver, command, data)
|
|
|
sig_numeric_reply(prefix, code, params)
|
|
|
sig_part(nick, channel, reason)
|
|
|
sig_ping(daemon1, daemon2)
|
|
|
sig_privmsg(prefix, receiver, text)
|
|
|
sig_privmsg_ctcp(prefix, receiver, command, data)
|
|
|
sig_socket_error(error_message)
|
|
|
sig_topic(prefix, channel, topic)
|
|
|
sig_unknown_command_received(prefix, command, params)
|
1.4.6