#include <ircprotocol.h>
Public Member Functions | |
IRCProtocol () | |
Constructor. | |
~IRCProtocol () | |
Destructor. | |
Static Public Member Functions | |
static vector< string > | identify (string, string, string, string) |
Construct a string to identify to an irc server. | |
static string | quitServer (string raison="autokilled!") |
Construct a string to quit an irc server. | |
static string | joinChannel (string) |
Construct a string to join a channel. | |
static string | leaveChannel (string, string raison="\\o_") |
Construct a string to leave a channel. | |
static string | changeNick (string) |
Construct a string to change nick. | |
static string | ping (string) |
Construct a string to ping the server. | |
static string | pong (string) |
Construct a string to respond to a ping. | |
static string | sendMsg (string, string) |
Construct a string to send a message. | |
static vector< string > | sendMsg (string, vector< string >) |
Construct a vector with strings to send several messages. | |
static string | sendAction (string, string) |
Construct a string to send an action on a channel. | |
static string | changeTopic (string, string) |
Construct a string to change a channel topic. | |
static vector< string > | applyModes (string, vector< string >, char, char, unsigned int) |
Construct strings to apply a mode on different people. | |
static vector< string > | op (vector< string >, string) |
Construct strings to op people on a channel. | |
static string | op (string, string) |
Construct a string to op a user on a channel. | |
static vector< string > | unop (vector< string >, string) |
Construct strings to unop people on a channel. | |
static string | unop (string, string) |
Construct a string to unop a user on a channel. | |
static vector< string > | voice (vector< string >, string) |
Construct strings to voice people on a channel. | |
static string | voice (string, string) |
Construct a string to voice a user on a channel. | |
static vector< string > | unvoice (vector< string >, string) |
Construct strings to unvoice people on a channel. | |
static string | unvoice (string, string) |
Construct a string to unvoice a user on a channel. | |
static string | ban (string, string) |
Construct a string to ban a host on a channel. | |
static string | unban (string, string) |
Construct a string to unban a host on a channel. | |
static string | sendNotice (string, string) |
Construct a string to send a notice. | |
static vector< string > | sendNotices (string, vector< string >) |
Construct strings to send notices. | |
static string | kick (string, string, string) |
Construct a string to kick someone from channel. | |
static string | who (string, string) |
Construct a string for a WHO command. | |
static string | invite (string, string) |
Construct a string for a INVITE command. |
This class convert "humain" strings to IRC messages This class allow the bot to connect to different servers type simply by changing its code methods All methods a static, no object needed
Definition at line 44 of file ircprotocol.h.
IRCProtocol::IRCProtocol | ( | ) |
IRCProtocol::~IRCProtocol | ( | ) |
vector< string > IRCProtocol::applyModes | ( | string | channel, | |
vector< string > | users_list, | |||
char | sign, | |||
char | mode, | |||
unsigned int | limit | |||
) | [static] |
Construct strings to apply a mode on different people.
Construct strings to apply a mode on different people
channel | Channel where apply modes | |
users_list | Users on witch apply modes | |
mode | Mode ti apply | |
sign | Mode sign | |
limit | Limit for size |
Definition at line 181 of file ircprotocol.cpp.
Referenced by unbanall().
string IRCProtocol::ban | ( | string | mask, | |
string | channel | |||
) | [static] |
Construct a string to ban a host on a channel.
Format a string to ban a mask on a channel
mask | mask to ban | |
channel | ban's channel |
Definition at line 302 of file ircprotocol.cpp.
Referenced by ban(), banmask(), and joinHandler().
string IRCProtocol::changeNick | ( | string | nick | ) | [static] |
Construct a string to change nick.
Format a string to change the bot nickname
nick | New nick |
Definition at line 99 of file ircprotocol.cpp.
Referenced by getMyFirstNick(), identify(), secondaryNick(), and setNick().
string IRCProtocol::changeTopic | ( | string | channel, | |
string | topic | |||
) | [static] |
Construct a string to change a channel topic.
Format a string to change a topic
channel | Channel witch topic will change | |
topic | New topic |
Definition at line 167 of file ircprotocol.cpp.
Referenced by topic(), and topicHandler().
vector< string > IRCProtocol::identify | ( | string | pass, | |
string | ident, | |||
string | name, | |||
string | nick | |||
) | [static] |
Construct a string to identify to an irc server.
Format strings to identify to an IRC server according to parameters
pass | IRC server password (empty string if not required) | |
ident | Connection Ident | |
name | Connection Name | |
nick | Connection Nick |
Definition at line 53 of file ircprotocol.cpp.
References changeNick().
Referenced by BotKernel::connect().
string IRCProtocol::invite | ( | string | channel, | |
string | nick | |||
) | [static] |
Construct a string for a INVITE command.
Format a string to send a INVITE command
channel | Channel where invite the user | |
nick | Nick to invite |
Definition at line 465 of file ircprotocol.cpp.
Referenced by invite().
string IRCProtocol::joinChannel | ( | string | channel | ) | [static] |
Construct a string to join a channel.
Format a string to join a channel
channel | Channel to join |
Definition at line 78 of file ircprotocol.cpp.
Referenced by cycleChannel(), joinChannel(), kickHandler(), onEndOfMOTD(), onInvite(), partHandler(), quitHandler(), and rejoinChan().
string IRCProtocol::kick | ( | string | nick, | |
string | chan, | |||
string | reason | |||
) | [static] |
Construct a string to kick someone from channel.
Format a string to kick a user from a channel
nick | User nick to kick | |
chan | Channel from witch one the user is kicked | |
reason | Kick reason, can be empty |
Definition at line 454 of file ircprotocol.cpp.
Referenced by ban(), banmask(), joinHandler(), kick(), kickall(), kickHandler(), masskick(), modeHandler(), and randomKick().
string IRCProtocol::leaveChannel | ( | string | channel, | |
string | reason = "\\o_" | |||
) | [static] |
Construct a string to leave a channel.
Format a string to leave a channel
channel | Channel to leave | |
reason | Leave msg. Can be empty |
Definition at line 89 of file ircprotocol.cpp.
Referenced by cycleChannel(), kickHandler(), leaveChannel(), partHandler(), and quitHandler().
string IRCProtocol::op | ( | string | nick, | |
string | channel | |||
) | [static] |
Construct a string to op a user on a channel.
Construct a string to op a user on a channel Obsolete : use applyModes instead
nick | Nick to op | |
channel | Channel where the nick must be opped |
Definition at line 246 of file ircprotocol.cpp.
vector< string > IRCProtocol::op | ( | vector< string > | vectorNicks, | |
string | channel | |||
) | [static] |
Construct strings to op people on a channel.
Format strings to op users on a channel Obsolete : use applyModes instead
vectorNicks | Vector containing string containing nicks to op | |
channel | Channel where nicks must be opped |
Definition at line 212 of file ircprotocol.cpp.
Referenced by joinHandler(), op(), and opall().
string IRCProtocol::ping | ( | string | ping | ) | [static] |
Construct a string to ping the server.
Format a string to ping the server
ping | String that the server must reply to validate the ping |
Definition at line 109 of file ircprotocol.cpp.
Referenced by checkConnection().
string IRCProtocol::pong | ( | string | pong | ) | [static] |
Construct a string to respond to a ping.
Format a string to pong the server
pong | string ping answer |
Definition at line 119 of file ircprotocol.cpp.
Referenced by pinged().
string IRCProtocol::quitServer | ( | string | reason = "autokilled!" |
) | [static] |
Construct a string to quit an irc server.
Format a string to quit an IRC server
reason | Quit message. Can be empty |
Definition at line 68 of file ircprotocol.cpp.
Referenced by disconnect().
string IRCProtocol::sendAction | ( | string | channel, | |
string | action | |||
) | [static] |
Construct a string to send an action on a channel.
Send an action on a channel. An action is that kind of message : * trustyrc slaps toto
channel | Channel where to send the action | |
action | Action to send |
Definition at line 156 of file ircprotocol.cpp.
Referenced by slapUser().
vector< string > IRCProtocol::sendMsg | ( | string | destination, | |
vector< string > | messages | |||
) | [static] |
Construct a vector with strings to send several messages.
Format a strings to send a messages to a channel or to a user
destination | Messages receiver (channel or user(pv query)) | |
messages | Messages to send |
Definition at line 141 of file ircprotocol.cpp.
string IRCProtocol::sendMsg | ( | string | destination, | |
string | message | |||
) | [static] |
Construct a string to send a message.
Format a string to send a message to a channel or to a user
Definition at line 130 of file ircprotocol.cpp.
Referenced by autoop(), autovoice(), ball(), bug(), bzsearch(), checkBug(), danstonchat(), displayAdvertise(), displayPaste(), endSurvey(), fas(), greplog(), hl(), host2ip(), ip2host(), lamoule(), lastQuote(), lastseen(), launchSurvey(), myFunction(), planet(), player(), protectmodes(), protecttopic(), q3(), quote(), randomKick(), searchQuote(), stopSurvey(), tele(), tell(), top5(), topshot(), toptotal(), trad(), unautoop(), unautovoice(), unprotectmodes(), unprotecttopic(), warsow(), whoowns(), and wiki().
string IRCProtocol::sendNotice | ( | string | destination, | |
string | notice | |||
) | [static] |
Construct a string to send a notice.
Format a string to send a notice
destination | Notice receiver (nick or channel) | |
notice | Notice message |
Definition at line 414 of file ircprotocol.cpp.
Referenced by addad(), addIgnore(), addOnlyon(), addQuote(), addsuperadmin(), addtempsuperadmin(), adinfos(), chanlev(), clearCountDowns(), ctcp_ping(), ctcp_version(), delad(), deletekey(), deleteplayer(), delIgnore(), delOnlyon(), delQuote(), delsuperadmin(), disable(), enable(), BotKernel::executeFunction(), flushconffile(), getconfvalue(), getnbcountdowns(), help(), increase(), isIgnored(), lamoule(), launchSurvey(), load(), loadconffile(), loadnocheck(), moduleinfos(), nextscore(), notice(), online(), prefix(), quoteInfos(), reloadfas(), setconfvalue(), setlogkeepfiles(), setloglevel(), setlogperiod(), setSuperAdminPass(), slapme(), stopSurvey(), sysinfos(), unload(), unloadnocheck(), uptime(), version(), and vote().
vector< string > IRCProtocol::sendNotices | ( | string | destination, | |
vector< string > | notices | |||
) | [static] |
Construct strings to send notices.
Format strings to send notices
destination | Notice receiver (nick or channel) | |
notices | Notices messages |
Definition at line 425 of file ircprotocol.cpp.
Referenced by baninfos(), banlist(), chanlev(), commandsStatus(), ignoreList(), listads(), listlibs(), listmodules(), superadminlist(), and whoami().
string IRCProtocol::unban | ( | string | mask, | |
string | channel | |||
) | [static] |
Construct a string to unban a host on a channel.
Format a string to unban a mask on a channel
mask | Mask to unban | |
channel | Channel where to unban the user |
Definition at line 313 of file ircprotocol.cpp.
Referenced by bandel(), and Moderation::clearOutBans().
string IRCProtocol::unop | ( | string | nick, | |
string | channel | |||
) | [static] |
Construct a string to unop a user on a channel.
Construct a string to unop a user on a channel
nick | Nick to unop | |
channel | Channel where the nick must be unopped |
Definition at line 291 of file ircprotocol.cpp.
vector< string > IRCProtocol::unop | ( | vector< string > | vectorNicks, | |
string | channel | |||
) | [static] |
Construct strings to unop people on a channel.
Format strings to unop users on a channel Obsolete : use applyModes instead
vectorNicks | Vector containing string containing nicks to unop | |
channel | Channel where nicks must be unopped |
Definition at line 258 of file ircprotocol.cpp.
string IRCProtocol::unvoice | ( | string | nick, | |
string | channel | |||
) | [static] |
Construct a string to unvoice a user on a channel.
Construct a string to unvoice a user on a channel
nick | Nick to unvoice | |
channel | Channel where the nick must be unvoiced |
Definition at line 403 of file ircprotocol.cpp.
vector< string > IRCProtocol::unvoice | ( | vector< string > | vectorNicks, | |
string | channel | |||
) | [static] |
Construct strings to unvoice people on a channel.
Format strings to unvoice users on a channel Obsolete : use applyModes instead
vectorNicks | Vector containing string containing nicks to unvoice | |
channel | Channel where nicks must be unvoiced |
Definition at line 370 of file ircprotocol.cpp.
Referenced by unvoice(), and unvoiceall().
string IRCProtocol::voice | ( | string | nick, | |
string | channel | |||
) | [static] |
Construct a string to voice a user on a channel.
Construct a string to voice a user on a channel
nick | Nick to voice | |
channel | Channel where the nick must be voiced |
Definition at line 358 of file ircprotocol.cpp.
vector< string > IRCProtocol::voice | ( | vector< string > | vectorNicks, | |
string | channel | |||
) | [static] |
Construct strings to voice people on a channel.
Format strings to voice users on a channel Obsolete : use applyModes instead
vectorNicks | Vector containing string containing nicks to voice | |
channel | Channel where nicks must be voiced |
Definition at line 325 of file ircprotocol.cpp.
Referenced by joinHandler(), voice(), and voiceall().
string IRCProtocol::who | ( | string | channel, | |
string | params | |||
) | [static] |
Construct a string for a WHO command.
Format a string to send a WHO command
channel | Channel for the WHO command | |
params | Parameters for WHO command |
Definition at line 439 of file ircprotocol.cpp.
Referenced by onJoin(), and reloadUsers().