2017-06-11 09:31:45 +02:00
|
|
|
#include "messages/message.hpp"
|
|
|
|
#include "channel.hpp"
|
|
|
|
#include "colorscheme.hpp"
|
|
|
|
#include "emojis.hpp"
|
|
|
|
#include "emotemanager.hpp"
|
|
|
|
#include "fontmanager.hpp"
|
|
|
|
#include "ircmanager.hpp"
|
|
|
|
#include "messages/link.hpp"
|
|
|
|
#include "resources.hpp"
|
|
|
|
#include "settingsmanager.hpp"
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-06-11 09:31:45 +02:00
|
|
|
#include <QColor>
|
2017-02-17 23:51:35 +01:00
|
|
|
#include <QObjectUserData>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <QStringList>
|
2017-06-07 10:09:24 +02:00
|
|
|
|
2017-01-05 16:43:01 +01:00
|
|
|
#include <ctime>
|
2017-01-11 01:08:20 +01:00
|
|
|
#include <list>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <tuple>
|
2017-01-05 16:43:01 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
Message::Message(const QString &text)
|
2017-04-12 17:46:44 +02:00
|
|
|
: _words()
|
2017-06-06 21:18:05 +02:00
|
|
|
, _text(text)
|
2017-01-05 16:07:20 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
_words.push_back(
|
|
|
|
Word(text, Word::Text, ColorScheme::getInstance().SystemMessageColor, text, QString()));
|
2017-01-05 16:07:20 +01:00
|
|
|
}
|
|
|
|
|
2017-06-06 21:18:05 +02:00
|
|
|
Message::Message(const QString &text, const std::vector<Word> &words)
|
2017-04-12 17:46:44 +02:00
|
|
|
: _words(words)
|
2017-06-06 21:18:05 +02:00
|
|
|
, _text(text)
|
2017-01-05 16:07:20 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
}
|
2017-01-11 18:52:09 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool Message::getCanHighlightTab() const
|
|
|
|
{
|
|
|
|
return _highlightTab;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &Message::getTimeoutUser() const
|
|
|
|
{
|
|
|
|
return _timeoutUser;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
int Message::getTimeoutCount() const
|
|
|
|
{
|
|
|
|
return _timeoutCount;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &Message::getUserName() const
|
|
|
|
{
|
|
|
|
return _userName;
|
|
|
|
}
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &Message::getDisplayName() const
|
|
|
|
{
|
|
|
|
return _displayName;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &Message::getContent() const
|
|
|
|
{
|
|
|
|
return _content;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const std::chrono::time_point<std::chrono::system_clock> &Message::getParseTime() const
|
|
|
|
{
|
|
|
|
return _parseTime;
|
|
|
|
}
|
2017-01-07 20:43:55 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
std::vector<Word> &Message::getWords()
|
|
|
|
{
|
|
|
|
return _words;
|
2017-01-06 23:28:48 +01:00
|
|
|
}
|
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool Message::isDisabled() const
|
2017-01-07 20:43:55 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
return _isDisabled;
|
2017-01-07 20:43:55 +01:00
|
|
|
}
|
2017-01-28 20:29:02 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &Message::getId() const
|
2017-01-28 20:29:02 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
return _id;
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
2017-01-28 20:29:02 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace messages
|
|
|
|
} // namespace chatterino
|