mirror-chatterino2/message.cpp.xT5964
2017-01-05 16:07:20 +01:00

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());
}
}