InspIRCd  3.0
Public Member Functions | List of all members
ClientProtocol::MessageSource Class Reference
Inheritance diagram for ClientProtocol::MessageSource:
ClientProtocol::Message ClientProtocol::Messages::Error ClientProtocol::Messages::Invite ClientProtocol::Messages::Join ClientProtocol::Messages::Kick ClientProtocol::Messages::Mode ClientProtocol::Messages::Nick ClientProtocol::Messages::Numeric ClientProtocol::Messages::Part ClientProtocol::Messages::Ping ClientProtocol::Messages::Pong ClientProtocol::Messages::Privmsg ClientProtocol::Messages::Quit ClientProtocol::Messages::Topic

Public Member Functions

 MessageSource (User *Sourceuser=NULL)
 
 MessageSource (const std::string &Sourcestr, User *Sourceuser=NULL)
 
const std::string * GetSource () const
 
UserGetSourceUser () const
 
void SetSourceUser (User *Sourceuser)
 
void SetSource (const std::string &Sourcestr, User *Sourceuser=NULL)
 
void SetSource (const MessageSource &other)
 

Constructor & Destructor Documentation

◆ MessageSource() [1/2]

ClientProtocol::MessageSource::MessageSource ( User Sourceuser = NULL)
inline

Constructor, sets the source to be the full host of a user or sets it to be nothing. The actual source string when serializing will be obtained from User::GetFullHost() if the user is non-NULL.

Parameters
SourceuserUser to set as source of the message. If NULL, the message won't have a source when serialized. Optional, defaults to NULL.

◆ MessageSource() [2/2]

ClientProtocol::MessageSource::MessageSource ( const std::string &  Sourcestr,
User Sourceuser = NULL 
)
inline

Constructor, sets the source to the supplied string and optionally sets the source user.

Parameters
SourcestrString to use as message source for serialization purposes. Must remain valid as long as this object is alive.
SourceuserUser to set as source. Optional, defaults to NULL. It will not be used for serialization but if provided it may be used internally, for example to create message tags. Useful when the source string is synthesized but it is still related to a User.

Member Function Documentation

◆ GetSource()

const std::string* ClientProtocol::MessageSource::GetSource ( ) const
inline

Get the source of this message as a string.

Returns
Pointer to the message source string or NULL if there is no source.

◆ GetSourceUser()

User* ClientProtocol::MessageSource::GetSourceUser ( ) const
inline

Get the source User. This shouldn't be used for serialization, use GetSource() for that.

Returns
User pointer if the message has a source user, NULL otherwise.

◆ SetSource() [1/2]

void ClientProtocol::MessageSource::SetSource ( const std::string &  Sourcestr,
User Sourceuser = NULL 
)
inline

Set the source string and optionally source user. See the two parameter constructor for a more detailed description.

Parameters
SourcestrString source, to be used for serialization purposes. Must remain valid as long as this object is alive.
SourceuserSource user to set, optional.

◆ SetSource() [2/2]

void ClientProtocol::MessageSource::SetSource ( const MessageSource other)
inline

Copy the source from a MessageSource object.

Parameters
otherMessageSource object to copy from.

◆ SetSourceUser()

void ClientProtocol::MessageSource::SetSourceUser ( User Sourceuser)
inline

Set the source of this message to a User. See the one parameter constructor for a more detailed description.

Parameters
SourceuserUser to set as source.

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