Simple logging implemented

Message now stores a copy of the content string
Use .nick() instead of .account() to get the users lowercase name (login name)
This commit is contained in:
Rasmus Karlsson
2017-03-11 11:32:19 +01:00
parent 5dbe6990bd
commit 46f432890f
18 changed files with 338 additions and 66 deletions
+4 -6
View File
@@ -1,4 +1,5 @@
#include "messages/message.h"
#include "channel.h"
#include "colorscheme.h"
#include "emojis.h"
#include "emotes.h"
@@ -30,6 +31,7 @@ Message::Message(const QString &text)
Message::Message(const IrcPrivateMessage &ircMessage, Channel &channel,
bool enablePingSound, bool isReceivedWhisper,
bool isSentWhisper, bool includeChannel)
: content(ircMessage.content())
{
this->parseTime = std::chrono::system_clock::now();
@@ -144,14 +146,10 @@ Message::Message(const IrcPrivateMessage &ircMessage, Channel &channel,
}
// username
this->userName = ircMessage.account();
this->userName = ircMessage.nick();
if (this->userName.isEmpty()) {
auto iterator = tags.find("login");
if (iterator != tags.end()) {
this->userName = iterator.value().toString();
}
this->userName = tags.value(QLatin1String("login")).toString();
}
QString displayName;