Message Class Reference

Class that manage messages from the irc server. More...

#include <message.h>

List of all members.

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


Detailed Description

Class that manage messages from the irc server.

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.


Constructor & Destructor Documentation

Message::Message ( string  message  ) 

Constructor.

Class constructor Split different parts of the messaeg to make it easier to use

Parameters:
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.

References message, and split.

Message::~Message (  ) 

Destructor.

Class destructor

Definition at line 55 of file message.cpp.


Member Function Documentation

time_t Message::getElapsedTime (  ) 

Get elapsed time between message creation and now.

Get elapsed time between message creation and now (in seconds)

Returns:
Elapsed time between message creation and now

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

Returns:
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 (  ) 

Message's sender's ident.

Get message sender's ident

Returns:
message sender's ident

Definition at line 146 of file message.cpp.

References getPart(), message, and split.

Referenced by onJoin().

string Message::getMessage (  ) 

Return the raw msg (irc format).

Get the raw message

Returns:
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 (  ) 

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

Parameters:
index Index of the wanted message part (start to zero)
Returns:
Part of the message. empty if index is superior to the parts message number

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 (  ) 

string Message::getSource (  ) 

vector< string > Message::getSplit (  ) 

bool Message::isPrivate (  ) 

bool Message::isPublic (  ) 

unsigned int Message::nbParts (  ) 

void Message::setMessage ( string  message  ) 

Set the message string.

Set the message string and split it

Parameters:
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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Sun Aug 16 15:28:49 2009 for trustyRC by  doxygen 1.5.8