Handles core communication with IRC server. More...
#include <string>
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <time.h>
#include "utils/memleak.h"
#include "utils/my_assert.h"
#include "utils.h"
#include "params.h"
#include "variable.h"
#include "var_keeper.h"
#include "nick_track/c_tracked_msg_to_server.h"
#include "script_consts/script_consts.h"
Go to the source code of this file.
Classes | |
struct | c_005 |
Stores parsed data of ISUPPORT 005 numeric reply. More... | |
class | c_global_keeper |
Stores super global variables (state of bot) for functions. More... | |
class | c_global_keeper::c_session_keeper |
Keeps session ID valid and restores the old one. More... | |
struct | c_msg_to_server |
Stores messages for server (for bot's flood protection mechanism). More... | |
Functions | |
void | irc_await_dcc_chat (const string &nick, const string &user_name_as_in_logic, int dcc_group) |
Called to await DCC connection from user. | |
bool | irc_ban (const string &channel, const string &mask, int priority=CRITICAL_PRIORITY) |
Bans (MODE #channel +b mask) host mask on channel. | |
bool | irc_chan_mode (const string &channel, const string &mode, int priority) |
Sets mode of channel. | |
void | irc_cleanup () |
bool | irc_cmp_strings_case_insensitive (string s1, string s2) |
Compares two strings, case in-sensitive, according to casemapping from IRC server. | |
int | irc_connect (const string &bind_ip, string host_, unsigned short port, const string &ssl) |
Connects to server. | |
bool | irc_deop (const string &channel, const string &nick, int priority) |
Sets -o (chan op) status to nick on channel. | |
bool | irc_deop_ban_mask (const string &channel, const string &nick, const string &mask, int priority) |
Sets -o (chan op) status to nick on channel, and sets +b ban mask on channel. | |
bool | irc_devoice (const string &channel, const string &nick, int priority) |
Sets -v (voice) status to nick on channel. | |
int | irc_disconnect () |
Disconnects from server. | |
void | irc_dummy_operation () |
c_online_user | irc_find_user (const string &nick) |
Finds c_online_user record in irc_channel list for user. | |
void | irc_get_005 (map< string, string > &raw, map< char, char > &prefix, string &chm_a, string &chm_b, string &chm_c, string &chm_d) |
Gets information from parsed RPL_ISUPPORT message (005 numeric). | |
string | irc_get_chan_mode (const string &channel, string &topic) |
Returns channel mode. | |
string | irc_get_fullname (const string &nick) |
Looks-up user from nick name and checks its full name. | |
string | irc_get_host (const string &nick) |
Looks-up host of online user. | |
string | irc_get_ident (const string &nick) |
Looks-up ident of online user. | |
string | irc_get_mode (const string &channel, const string &nick) |
Looks-up user from nick name and checks its mode on channel. | |
string | irc_get_modes_for_log (const string &channel, const string &nick) |
Looks-up user from nick name and returns their mode(s) for logging purposes to channel log. | |
string | irc_get_nick (const string &user) |
Looks-up user from name in logic.txt to nick name (if online). | |
bool | irc_got_op (const string &channel) |
Checks if bot has op (+o) on channel. | |
bool | irc_is_ircop (const string &nick) |
Looks-up user from name in logic.txt and checks if it is an irc operator (if online). | |
string | irc_is_online (string user) |
bool | irc_join (const string &channel, const string &key) |
JOINs channel. | |
bool | irc_kick (const string &channel, const string &nick, const string &reason, int priority=CRITICAL_PRIORITY) |
Kicks nick on channel. | |
void | irc_loop_heavy_time_consuming_operation (const string &msg) |
This function should be called in a deep sleep loop ("sleep" command/function in user's script) to process receives from IRC server; respond to server's PINGs; put incomming messages (except for server PINGs) into queue to process them after deep sleep has gone away. | |
int | irc_loop_process_input () |
This is called in loop to process messages from server. | |
bool | irc_loop_putserv () |
This function should be called in a loop to process send and receive to/from server. | |
bool | irc_notice (const string &target, const string &msg, int priority) |
Sends NOTICE to user/channel. | |
bool | irc_op (const string &channel, const string &nick, int priority) |
Sets +o (chan op) status to nick on channel. | |
bool | irc_part (const string &channel, const string &reason) |
PARTs channel. | |
bool | irc_privmsg (const string &target, const string &msg, int priority) |
Sends PRIVMSG to user/channel. | |
void | irc_put (const string &data, int priority) |
Raw-ly puts message to queue to send to server. | |
bool | irc_putserv (const c_tracked_msg_to_server &msg_to_send, bool wait_for_response, int priority) |
Puts message for server to queue to send. | |
void | irc_quit (const string &reason, bool wait=true) |
Quits the IRC. | |
void | irc_rehashed () |
Called from logic.cpp after rehashing. Deletes all online users and so applies new configuration. | |
void | irc_set_redir (bool follow_redirs) |
Sets value of irc_follow_redirs flag. | |
bool | irc_unban (const string &channel, const string &mask, int priority=HIGH_PRIORITY) |
Unbans (MODE #channel -b mask) host mask on channel. | |
bool | irc_voice (const string &channel, const string &nick, int priority) |
Sets +v (voice) status to nick on channel. |
Handles core communication with IRC server.
Definition in file irc.h.