mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
41 lines
842 B
Plaintext
41 lines
842 B
Plaintext
|
#include "message.h"
|
||
|
#include "qcolor.h"
|
||
|
#include "colorscheme.h"
|
||
|
|
||
|
Message::Message(const QString &text)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
Message::Message(const IrcPrivateMessage& ircMessage, const Channel& Channel)
|
||
|
{
|
||
|
m_parseTime = std::chrono::system_clock::now();
|
||
|
|
||
|
auto words = new QList<Word>();
|
||
|
|
||
|
// username
|
||
|
m_userName = ircMessage.account();
|
||
|
|
||
|
if (m_userName.isEmpty())
|
||
|
{
|
||
|
auto iterator = ircMessage.tags().find("login");
|
||
|
|
||
|
if (iterator != ircMessage.tags().end())
|
||
|
{
|
||
|
m_userName = iterator.value().toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// highlights
|
||
|
#warning "xD"
|
||
|
|
||
|
// color
|
||
|
QColor usernameColor = ColorScheme::SystemMessageColor;
|
||
|
|
||
|
auto iterator = ircMessage.tags().find("color");
|
||
|
if (iterator != ircMessage.tags().end())
|
||
|
{
|
||
|
usernameColor = QColor(iterator.value().toString());
|
||
|
}
|
||
|
}
|