added words and message

This commit is contained in:
fourtf
2017-01-05 16:07:20 +01:00
parent 7a7b714e78
commit b7de109335
31 changed files with 679 additions and 31 deletions
+40
View File
@@ -0,0 +1,40 @@
#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());
}
}