2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "messages/word.hpp"
|
2017-03-11 11:32:19 +01:00
|
|
|
|
2017-01-11 01:08:20 +01:00
|
|
|
#include <chrono>
|
2017-04-12 17:46:44 +02:00
|
|
|
#include <memory>
|
2017-09-24 18:43:24 +02:00
|
|
|
#include <vector>
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-03-11 11:32:19 +01:00
|
|
|
|
|
|
|
class Channel;
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace messages {
|
2017-04-12 17:46:44 +02:00
|
|
|
class Message;
|
|
|
|
|
|
|
|
typedef std::shared_ptr<Message> SharedMessage;
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
class Message
|
|
|
|
{
|
|
|
|
public:
|
2017-04-12 17:46:44 +02:00
|
|
|
bool getCanHighlightTab() const;
|
2017-09-24 18:43:24 +02:00
|
|
|
void setHighlight(bool value);
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &getTimeoutUser() const;
|
|
|
|
int getTimeoutCount() const;
|
|
|
|
const QString &getUserName() const;
|
|
|
|
const QString &getDisplayName() const;
|
|
|
|
const QString &getContent() const;
|
|
|
|
const std::chrono::time_point<std::chrono::system_clock> &getParseTime() const;
|
|
|
|
std::vector<Word> &getWords();
|
|
|
|
bool isDisabled() const;
|
|
|
|
const QString &getId() const;
|
2017-01-05 20:49:33 +01:00
|
|
|
|
2017-06-13 22:03:29 +02:00
|
|
|
const QString text;
|
2017-09-16 00:05:06 +02:00
|
|
|
bool centered = false;
|
2017-06-06 21:18:05 +02:00
|
|
|
|
2017-12-16 18:11:36 +01:00
|
|
|
static Message *createSystemMessage(const QString &text);
|
|
|
|
|
2017-12-16 19:08:32 +01:00
|
|
|
static Message *createTimeoutMessage(const QString &username, const QString &durationInSeconds,
|
|
|
|
const QString &reason);
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
private:
|
2017-01-11 18:52:09 +01:00
|
|
|
static LazyLoadedImage *badgeStaff;
|
|
|
|
static LazyLoadedImage *badgeAdmin;
|
|
|
|
static LazyLoadedImage *badgeGlobalmod;
|
|
|
|
static LazyLoadedImage *badgeModerator;
|
|
|
|
static LazyLoadedImage *badgeTurbo;
|
|
|
|
static LazyLoadedImage *badgeBroadcaster;
|
|
|
|
static LazyLoadedImage *badgePremium;
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
static QRegularExpression *cheerRegex;
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-09-24 18:43:24 +02:00
|
|
|
// what is highlightTab?
|
2017-06-13 22:03:29 +02:00
|
|
|
bool highlightTab = false;
|
2017-09-24 18:43:24 +02:00
|
|
|
|
2017-06-13 22:03:29 +02:00
|
|
|
QString timeoutUser = "";
|
|
|
|
int timeoutCount = 0;
|
|
|
|
bool disabled = false;
|
|
|
|
std::chrono::time_point<std::chrono::system_clock> parseTime;
|
2017-01-28 20:29:02 +01:00
|
|
|
|
2017-06-13 22:03:29 +02:00
|
|
|
QString userName = "";
|
|
|
|
QString displayName = "";
|
|
|
|
QString content;
|
|
|
|
QString id = "";
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-06-13 22:03:29 +02:00
|
|
|
std::vector<Word> words;
|
2017-01-05 16:07:20 +01:00
|
|
|
};
|
2017-01-28 20:29:02 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace messages
|
|
|
|
} // namespace chatterino
|