Implemented loading recent messages. (#162)

This commit is contained in:
Cranken
2017-12-27 01:22:12 +01:00
committed by fourtf
parent 2fc546cada
commit 223f4af55a
5 changed files with 46 additions and 14 deletions
+12 -2
View File
@@ -47,7 +47,17 @@ SharedMessage TwitchMessageBuilder::parse()
// The timestamp is always appended to the builder
// Whether or not will be rendered is decided/checked later
this->appendTimestamp();
// Appends the correct timestamp if the message is a past message
bool isPastMsg = this->tags.contains("historical");
if(isPastMsg) {
// This may be architecture dependent(datatype)
qint64 ts = this->tags.value("tmi-sent-ts").toLongLong();
QDateTime time = QDateTime::fromMSecsSinceEpoch(ts);
this->appendTimestamp(time);
} else {
this->appendTimestamp();
}
this->parseMessageID();
@@ -66,7 +76,7 @@ SharedMessage TwitchMessageBuilder::parse()
this->appendUsername();
// highlights
if (settings.enableHighlights) {
if (settings.enableHighlights && !isPastMsg) {
this->parseHighlights();
}