/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2018, 2020 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2018 Attila Molnar <attilamolnar@hush.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
/** Constructor, string source, string target, copies text.
* @param source Source user.
- * @param targetuser Target user.
+ * @param target Target string.
* @param text Privmsg text, will be copied.
* @param mt Message type.
+ * @param status Prefix character for status messages. If non-zero the message is a status message. Optional, defaults to 0.
*/
- Privmsg(const std::string& source, const std::string& target, const std::string& text, MessageType mt = MSG_PRIVMSG)
+ Privmsg(const std::string& source, const std::string& target, const std::string& text, MessageType mt = MSG_PRIVMSG, char status = 0)
: ClientProtocol::Message(CommandStrFromMsgType(mt), source)
{
- PushParam(target);
+ if (status)
+ {
+ std::string rawtarget(1, status);
+ rawtarget.append(target);
+ PushParam(rawtarget);
+ }
+ else
+ {
+ PushParam(target);
+ }
PushParam(text);
}
/** Constructor, user source, string target, copies text.
* @param source Source user.
- * @param targetuser Target string.
+ * @param target Target string.
* @param text Privmsg text, will not be copied.
* @param mt Message type.
*/
/** Constructor, string source, string target, does not copy text.
* @param source Source string.
- * @param targetuser Target string.
+ * @param target Target string.
* @param text Privmsg text, will not be copied.
* @param mt Message type.
*/
/** Constructor, string source, user target, does not copy text.
* @param source Source string.
- * @param targetchan Target user.
+ * @param targetuser Target user.
* @param text Privmsg text, will not be copied.
* @param mt Message type.
*/