InspIRCd  3.0
Public Types | Public Member Functions | Public Attributes | List of all members
MessageTarget Class Reference

#include <message.h>

Public Types

enum  TargetType { TYPE_USER, TYPE_CHANNEL, TYPE_SERVER }
 

Public Member Functions

 MessageTarget (Channel *channel, char statuschar)
 
 MessageTarget (User *user)
 
 MessageTarget (std::string *server)
 
template<typename T >
T * Get () const
 

Public Attributes

char status
 
MessageTarget::TargetType type
 

Detailed Description

Represents the target of a message (NOTICE, PRIVMSG, etc).

Member Enumeration Documentation

◆ TargetType

An enumeration of possible message target types.

Enumerator
TYPE_USER 

The target of the message is a user.

TYPE_CHANNEL 

The target of the message is a channel.

TYPE_SERVER 

The target of the message is a server.

Constructor & Destructor Documentation

◆ MessageTarget() [1/3]

MessageTarget::MessageTarget ( Channel channel,
char  statuschar 
)
inline

Initialises a new channel message target.

Parameters
channelThe channel which is the target of the message.
statuscharThe lowest status rank that the message is being sent to.

◆ MessageTarget() [2/3]

MessageTarget::MessageTarget ( User user)
inline

Initialises a new user message target.

Parameters
userThe user which is the target of the message.

◆ MessageTarget() [3/3]

MessageTarget::MessageTarget ( std::string *  server)
inline

Initialises a new server message target.

Parameters
serverThe server glob which is the target of the message.

Member Function Documentation

◆ Get()

template<typename T >
T* MessageTarget::Get ( ) const
inline

Retrieves the target of this message.

Member Data Documentation

◆ status

char MessageTarget::status

If type is TYPE_CHANNEL and the user specified a status rank.

◆ type

MessageTarget::TargetType MessageTarget::type

The type of the target of the message. If this is TYPE_CHANNEL then dest is a Channel*, TYPE_USER then dest is a User*, and TYPE_SERVER then dest is a std::string* containing a server glob.


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