2020-07-04 15:15:59 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/Aliases.hpp"
|
|
|
|
#include "common/Outcome.hpp"
|
|
|
|
#include "messages/SharedMessageBuilder.hpp"
|
|
|
|
|
|
|
|
#include <IrcMessage>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
struct Emote;
|
|
|
|
using EmotePtr = std::shared_ptr<const Emote>;
|
|
|
|
|
|
|
|
class Channel;
|
|
|
|
|
|
|
|
class IrcMessageBuilder : public SharedMessageBuilder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IrcMessageBuilder() = delete;
|
|
|
|
|
|
|
|
explicit IrcMessageBuilder(Channel *_channel,
|
|
|
|
const Communi::IrcPrivateMessage *_ircMessage,
|
|
|
|
const MessageParseArgs &_args);
|
|
|
|
explicit IrcMessageBuilder(Channel *_channel,
|
|
|
|
const Communi::IrcMessage *_ircMessage,
|
|
|
|
const MessageParseArgs &_args, QString content,
|
|
|
|
bool isAction);
|
|
|
|
|
2021-12-04 17:05:57 +01:00
|
|
|
/**
|
|
|
|
* @brief used for global notice messages (i.e. notice messages without a channel as its target)
|
|
|
|
**/
|
|
|
|
explicit IrcMessageBuilder(const Communi::IrcNoticeMessage *_ircMessage,
|
|
|
|
const MessageParseArgs &_args);
|
|
|
|
|
2022-11-18 20:11:56 +01:00
|
|
|
/**
|
|
|
|
* @brief used for whisper messages (i.e. PRIVMSG messages with our nick as the target)
|
|
|
|
**/
|
|
|
|
explicit IrcMessageBuilder(const Communi::IrcPrivateMessage *_ircMessage,
|
|
|
|
const MessageParseArgs &_args);
|
|
|
|
|
2020-07-04 15:15:59 +02:00
|
|
|
MessagePtr build() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void appendUsername();
|
2022-11-18 20:11:56 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief holds the name of the target for the private/direct IRC message
|
|
|
|
*
|
|
|
|
* This might not be our nick
|
|
|
|
*/
|
|
|
|
QString whisperTarget_;
|
2020-07-04 15:15:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|