#include <message.h>
Public Member Functions | |
Message (string) | |
Constructor. | |
Message () | |
Constructor. | |
~Message () | |
Destructor. | |
vector< string > | getSplit () |
Return all parts of the message. | |
void | setMessage (string) |
Set the message string. | |
unsigned int | nbParts () |
Return parts number. | |
string | getPart (unsigned int) |
Return a part of the message. | |
string | getSender () |
Return the message's sender's informations (nick,ident,host). | |
string | getNickSender () |
Message's sender's nick. | |
string | getHostSender () |
Message's sender's host. | |
string | getIdentSender () |
Message's sender's ident. | |
bool | isPrivate () |
True if the message is a private one. | |
bool | isPublic () |
True if the message is a public one (channel). | |
string | getSource () |
Return the message source (channel or botnick). | |
string | getMessage () |
Return the raw msg (irc format). | |
time_t | getElapsedTime () |
Get elapsed time between message creation and now. | |
Private Attributes | |
string | message |
The raw message. | |
vector< string > | split |
Message splitted (by spaces). | |
bool | pv |
True oif the message is private. | |
time_t | timestamp |
timestamp of the message |
This class stores messages from the irc server and parse them to make informations easier to obtain. Please be carefull. All methods works with message comming FROM the server, not for those that are sended TO the server
Definition at line 44 of file message.h.
Message::Message | ( | string | message | ) |
Constructor.
Class constructor Split different parts of the messaeg to make it easier to use
message | IRC message |
Definition at line 37 of file message.cpp.
References setMessage().
Message::Message | ( | ) |
Constructor.
Constructor Used for unknow string that are set after whith setMessage()
Definition at line 46 of file message.cpp.
Message::~Message | ( | ) |
time_t Message::getElapsedTime | ( | ) |
Get elapsed time between message creation and now.
Get elapsed time between message creation and now (in seconds)
Definition at line 214 of file message.cpp.
References timestamp.
Referenced by testMsgTimestamp().
string Message::getHostSender | ( | ) |
Message's sender's host.
Get message sender's host
Definition at line 132 of file message.cpp.
References getPart(), message, and split.
Referenced by joinHandler(), kickHandler(), modeHandler(), and onJoin().
string Message::getIdentSender | ( | ) |
string Message::getMessage | ( | ) |
Return the raw msg (irc format).
Get the raw message
Definition at line 205 of file message.cpp.
References message.
Referenced by BotKernel::addCountDown(), displayAdvertise(), error(), launchSurvey(), rejoinChan(), and BotKernel::send().
string Message::getNickSender | ( | ) |
Message's sender's nick.
Get message sender's nick
Definition at line 118 of file message.cpp.
References getPart(), and message.
Referenced by addad(), addIgnore(), addOnlyon(), addQuote(), addsuperadmin(), addtempsuperadmin(), adinfos(), autoop(), autovoice(), ban(), bandel(), baninfos(), banlist(), banmask(), chanlev(), clearCountDowns(), commandsStatus(), ctcp_ping(), ctcp_version(), delad(), deletekey(), deleteplayer(), delIgnore(), delOnlyon(), delQuote(), delsuperadmin(), disable(), enable(), BotKernel::executeFunction(), flushconffile(), getconfvalue(), getnbcountdowns(), help(), ignoreList(), increase(), isIgnored(), joinHandler(), kick(), kickall(), kickHandler(), lamoule(), launchSurvey(), listads(), listlibs(), listmodules(), load(), loadconffile(), loadnocheck(), masskick(), modeHandler(), modeHandlerProtect(), moduleinfos(), myFunction(), nextscore(), nick(), nickHandler(), onJoin(), online(), onPart(), onQuit(), op(), opall(), partHandler(), prefix(), privmsgHandler(), quitHandler(), quoteInfos(), randomKick(), reloadfas(), setconfvalue(), setlogkeepfiles(), setloglevel(), setlogperiod(), setSuperAdminPass(), slapme(), slapUser(), stopSurvey(), superadminlist(), sysinfos(), topic(), topicHandler(), unautoop(), unautovoice(), unbanall(), unload(), unloadnocheck(), unop(), unopall(), unvoice(), unvoiceall(), uptime(), version(), voice(), voiceall(), vote(), and whoami().
string Message::getPart | ( | unsigned int | index | ) |
Return a part of the message.
Return a part of the message. This part is the one pointed by the given index
index | Index of the wanted message part (start to zero) |
Definition at line 180 of file message.cpp.
References split.
Referenced by addad(), addIgnore(), addOnlyon(), addsuperadmin(), addtempsuperadmin(), adinfos(), allowedCommandCheck(), ban(), bandel(), baninfos(), banmask(), bannedHandler(), bug(), chanlev(), checkBug(), ctcp_ping(), cycleChannel(), danstonchat(), delad(), deletekey(), deleteplayer(), delIgnore(), delOnlyon(), delQuote(), delsuperadmin(), disable(), enable(), event352(), fas(), getconfvalue(), getHostSender(), getIdentSender(), getNickSender(), getSender(), getSource(), hl(), host2ip(), increase(), invite(), ip2host(), isIgnored(), joinChannel(), kick(), kickHandler(), lastseen(), leaveChannel(), load(), loadnocheck(), masskick(), mode(), modeHandler(), modeHandlerProtect(), moduleinfos(), BotKernel::msgTreatment(), nextscore(), nick_changed(), nickHandler(), notice(), onInvite(), onKick(), op(), pinged(), planet(), player(), privmsgHandler(), q3(), quote(), quoteInfos(), sendHandler(), setconfvalue(), setlogkeepfiles(), setloglevel(), setlogperiod(), setNick(), setSuperAdminPass(), slapme(), tell(), testIgnoredUser(), testMsgTimestamp(), topicInfos(), topicJoin(), trad(), unload(), unloadnocheck(), unop(), unvoice(), voice(), vote(), warsow(), whoowns(), and wiki().
string Message::getSender | ( | ) |
Return the message's sender's informations (nick,ident,host).
Give the message sender (nick host ident)
Definition at line 104 of file message.cpp.
References getPart(), and split.
Referenced by addad(), addIgnore(), addOnlyon(), addQuote(), addsuperadmin(), addtempsuperadmin(), adinfos(), autoop(), autovoice(), ban(), bandel(), baninfos(), banlist(), banmask(), chanlev(), clearCountDowns(), commandsStatus(), cycleChannel(), delad(), deletekey(), deleteplayer(), delIgnore(), delOnlyon(), delQuote(), delsuperadmin(), disable(), disconnect(), enable(), flushconffile(), getconfvalue(), getnbcountdowns(), ignoreList(), increase(), invite(), isIgnored(), joinChannel(), joinHandler(), kick(), kickall(), kickHandler(), leaveChannel(), listads(), listlibs(), listmodules(), load(), loadconffile(), loadnocheck(), masskick(), modeHandler(), modeHandlerProtect(), moduleinfos(), nextscore(), notice(), onInvite(), op(), opall(), partHandler(), protectmodes(), protecttopic(), quoteInfos(), randomKick(), raw(), reauth(), reloadfas(), reset(), setconfvalue(), setlogkeepfiles(), setloglevel(), setlogperiod(), setNick(), setSuperAdminPass(), stopSurvey(), superadminlist(), tell(), testIgnoredUser(), testMsgTimestamp(), topic(), topicHandler(), unautoop(), unautovoice(), unbanall(), unload(), unloadnocheck(), unop(), unopall(), unprotectmodes(), unprotecttopic(), unvoice(), unvoiceall(), voice(), voiceall(), and whoami().
string Message::getSource | ( | ) |
Return the message source (channel or botnick).
Get the message source (channel or bot nick if private)
Definition at line 196 of file message.cpp.
References getPart().
Referenced by allowedCommandCheck(), autoop(), autovoice(), ball(), ban(), bandel(), baninfos(), banlist(), banmask(), bug(), bzsearch(), checkBug(), danstonchat(), displayPaste(), endSurvey(), fas(), greplog(), hl(), host2ip(), ip2host(), joinHandler(), kick(), kickall(), kickHandler(), lamoule(), lastQuote(), lastseen(), launchSurvey(), masskick(), mode(), modeHandler(), modeHandlerProtect(), myFunction(), nick(), onInvite(), onJoin(), onKick(), onPart(), op(), opall(), partHandler(), planet(), player(), privmsgHandler(), protectmodes(), protecttopic(), q3(), quote(), randomKick(), searchQuote(), setMessage(), slapUser(), stopSurvey(), tele(), top5(), topic(), topicHandler(), topshot(), toptotal(), trad(), unautoop(), unautovoice(), unbanall(), unop(), unopall(), unprotectmodes(), unprotecttopic(), unvoice(), unvoiceall(), voice(), voiceall(), vote(), warsow(), whoowns(), and wiki().
vector< string > Message::getSplit | ( | ) |
Return all parts of the message.
Return different parts of the message
Definition at line 95 of file message.cpp.
References split.
Referenced by addad(), addIgnore(), addOnlyon(), addQuote(), addsuperadmin(), addtempsuperadmin(), allowedCommandCheck(), ban(), banmask(), bzsearch(), chanlev(), cycleChannel(), deletekey(), delIgnore(), delOnlyon(), delsuperadmin(), disable(), enable(), event005(), getconfvalue(), greplog(), host2ip(), ip2host(), isIgnored(), joinChannel(), kick(), kickHandler(), leaveChannel(), masskick(), mode(), modeHandler(), BotKernel::msgTreatment(), notice(), op(), partHandler(), planet(), privmsgHandler(), quitHandler(), raw(), searchQuote(), sendHandler(), setconfvalue(), setNick(), setSuperAdminPass(), slapUser(), tell(), topic(), topicHandler(), topicJoin(), trad(), unop(), unvoice(), voice(), and wiki().
bool Message::isPrivate | ( | ) |
True if the message is a private one.
Tell if the message is private to the bot
Definition at line 160 of file message.cpp.
References pv.
Referenced by addad(), addIgnore(), addOnlyon(), addsuperadmin(), addtempsuperadmin(), adinfos(), chanlev(), clearCountDowns(), commandsStatus(), cycleChannel(), delad(), deletekey(), delIgnore(), delOnlyon(), delsuperadmin(), disable(), disconnect(), enable(), flushconffile(), getconfvalue(), getnbcountdowns(), ignoreList(), invite(), isIgnored(), isPublic(), joinChannel(), leaveChannel(), listads(), listlibs(), listmodules(), load(), loadconffile(), loadnocheck(), moduleinfos(), notice(), onInvite(), raw(), reauth(), reloadfas(), reset(), setconfvalue(), setlogkeepfiles(), setloglevel(), setlogperiod(), setNick(), setSuperAdminPass(), superadminlist(), tell(), unload(), and unloadnocheck().
bool Message::isPublic | ( | ) |
True if the message is a public one (channel).
Tell if the message is public (on a channel)
Definition at line 169 of file message.cpp.
References isPrivate().
Referenced by addQuote(), allowedCommandCheck(), autoop(), autovoice(), ball(), ban(), bandel(), baninfos(), banlist(), banmask(), bug(), bzsearch(), checkBug(), danstonchat(), deleteplayer(), delQuote(), displayPaste(), fas(), greplog(), hl(), host2ip(), increase(), ip2host(), kick(), kickall(), lamoule(), lastQuote(), lastseen(), launchSurvey(), masskick(), myFunction(), nextscore(), op(), opall(), planet(), player(), privmsgHandler(), protectmodes(), protecttopic(), q3(), quote(), quoteInfos(), randomKick(), searchQuote(), slapme(), stopSurvey(), tele(), top5(), topic(), topshot(), toptotal(), trad(), unautoop(), unautovoice(), unbanall(), unop(), unopall(), unprotectmodes(), unprotecttopic(), unvoice(), unvoiceall(), voice(), voiceall(), vote(), warsow(), whoowns(), and wiki().
unsigned int Message::nbParts | ( | ) |
Return parts number.
Return parts number's message
Definition at line 87 of file message.cpp.
References split.
Referenced by addad(), addQuote(), adinfos(), ball(), ban(), bandel(), baninfos(), banmask(), bug(), bzsearch(), checkBug(), danstonchat(), delad(), deleteplayer(), delQuote(), fas(), greplog(), hl(), increase(), invite(), lastseen(), load(), loadnocheck(), moduleinfos(), BotKernel::msgTreatment(), nextscore(), partHandler(), planet(), player(), q3(), quote(), quoteInfos(), searchQuote(), setlogkeepfiles(), setloglevel(), setlogperiod(), slapme(), trad(), unload(), unloadnocheck(), warsow(), whoowns(), and wiki().
void Message::setMessage | ( | string | message | ) |
Set the message string.
Set the message string and split it
message | IRC message |
Definition at line 64 of file message.cpp.
References getSource(), pv, split, Tools::stringToVector(), and timestamp.
Referenced by addad(), Message(), BotKernel::run(), and BotKernel::send().
string Message::message [private] |
The raw message.
Definition at line 80 of file message.h.
Referenced by getHostSender(), getIdentSender(), getMessage(), getNickSender(), and Message().
bool Message::pv [private] |
True oif the message is private.
Definition at line 84 of file message.h.
Referenced by isPrivate(), and setMessage().
vector<string> Message::split [private] |
Message splitted (by spaces).
Definition at line 82 of file message.h.
Referenced by getHostSender(), getIdentSender(), getPart(), getSender(), getSplit(), Message(), nbParts(), and setMessage().
time_t Message::timestamp [private] |
timestamp of the message
Definition at line 86 of file message.h.
Referenced by getElapsedTime(), and setMessage().