2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2017 Peter Powell <petpow@saberuk.com>
6 * This file is part of InspIRCd. InspIRCd is free software: you can
7 * redistribute it and/or modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /** Whether message was a PRIVMSG or a NOTICE. */
25 /** The message is a PRIVMSG. */
28 /** The message is a NOTICE. */
32 class CoreExport MessageDetails
35 /* Whether to send the original message back to clients with echo-message support. */
38 /** The users who are exempted from receiving this message. */
41 /* The original message as sent by the user. */
42 const std::string originaltext;
44 /** IRCv3 message tags sent to the server by the user. */
45 const ClientProtocol::TagMap tags_in;
47 /** IRCv3 message tags sent out to users who get this message. */
48 ClientProtocol::TagMap tags_out;
50 /** The message which will be sent to clients. */
53 /** The type of message. */
54 const MessageType type;
56 MessageDetails(MessageType mt, const std::string& msg, const ClientProtocol::TagMap& tags)
66 /** Represents the target of a message (NOTICE, PRIVMSG, etc). */
67 class CoreExport MessageTarget
70 /** An enumeration of possible message target types. */
73 /** The target of the message is a user. */
76 /** The target of the message is a channel. */
79 /** The target of the message is a server. */
84 /** The target of the message. */
88 /** If type is TYPE_CHANNEL and the user specified a status rank. */
91 /** The type of the target of the message. If this is TYPE_CHANNEL then dest
92 * is a Channel*, TYPE_USER then dest is a User*, and TYPE_SERVER then dest is
93 * a std::string* containing a server glob.
95 MessageTarget::TargetType type;
97 /** Initialises a new channel message target.
98 * @param channel The channel which is the target of the message.
99 * @param statuschar The lowest status rank that the message is being sent to.
101 MessageTarget(Channel* channel, char statuschar)
108 /** Initialises a new user message target.
109 * @param user The user which is the target of the message.
111 MessageTarget(User* user)
118 /** Initialises a new server message target.
119 * @param server The server glob which is the target of the message.
121 MessageTarget(std::string* server)
128 /** Retrieves the target of this message. */
132 return static_cast<T*>(dest);