mirror-chatterino2/src/providers/twitch/IrcMessageHandler.hpp

59 lines
2.1 KiB
C++
Raw Normal View History

2018-01-01 23:54:54 +01:00
#pragma once
#include <IrcMessage>
#include "messages/Message.hpp"
2018-01-01 23:54:54 +01:00
namespace chatterino {
class TwitchIrcServer;
class Channel;
2018-06-04 12:23:23 +02:00
2018-01-01 23:54:54 +01:00
class IrcMessageHandler
{
IrcMessageHandler() = default;
2018-01-01 23:54:54 +01:00
public:
static IrcMessageHandler &getInstance();
// parseMessage parses a single IRC message into 0+ Chatterino messages
std::vector<MessagePtr> parseMessage(Channel *channel,
Communi::IrcMessage *message);
// parsePrivMessage arses a single IRC PRIVMSG into 0-1 Chatterino messages
std::vector<MessagePtr> parsePrivMessage(
Channel *channel, Communi::IrcPrivateMessage *message);
2018-08-06 21:17:03 +02:00
void handlePrivMessage(Communi::IrcPrivateMessage *message,
TwitchIrcServer &server);
2018-06-04 12:23:23 +02:00
2018-01-01 23:54:54 +01:00
void handleRoomStateMessage(Communi::IrcMessage *message);
void handleClearChatMessage(Communi::IrcMessage *message);
void handleClearMessageMessage(Communi::IrcMessage *message);
2018-01-01 23:54:54 +01:00
void handleUserStateMessage(Communi::IrcMessage *message);
void handleWhisperMessage(Communi::IrcMessage *message);
// parseUserNoticeMessage parses a single IRC USERNOTICE message into 0+
// chatterino messages
std::vector<MessagePtr> parseUserNoticeMessage(
Channel *channel, Communi::IrcMessage *message);
2018-08-06 21:17:03 +02:00
void handleUserNoticeMessage(Communi::IrcMessage *message,
TwitchIrcServer &server);
2018-01-01 23:54:54 +01:00
void handleModeMessage(Communi::IrcMessage *message);
// parseNoticeMessage parses a single IRC NOTICE message into 0+ chatterino
// messages
std::vector<MessagePtr> parseNoticeMessage(
Communi::IrcNoticeMessage *message);
2018-01-01 23:54:54 +01:00
void handleNoticeMessage(Communi::IrcNoticeMessage *message);
void handleJoinMessage(Communi::IrcMessage *message);
void handlePartMessage(Communi::IrcMessage *message);
2018-06-04 12:23:23 +02:00
private:
2018-08-06 21:17:03 +02:00
void addMessage(Communi::IrcMessage *message, const QString &target,
const QString &content, TwitchIrcServer &server, bool isResub,
2018-08-06 21:17:03 +02:00
bool isAction);
2018-01-01 23:54:54 +01:00
};
2018-02-05 15:11:50 +01:00
} // namespace chatterino