Switch to v2 of RAnders00's recent-messages API, so we support showing

old sub messages and stuff
This commit is contained in:
Rasmus Karlsson
2019-04-13 19:14:58 +02:00
parent a4cba22bcb
commit 8b3867fa7d
4 changed files with 183 additions and 39 deletions
+13 -1
View File
@@ -109,12 +109,24 @@ MessagePtr TwitchMessageBuilder::build()
this->appendChannelName();
if (this->tags.contains("rm-deleted"))
{
this->message().flags.set(MessageFlag::Disabled);
}
// timestamp
bool isPastMsg = this->tags.contains("historical");
if (isPastMsg)
{
// This may be architecture dependent(datatype)
qint64 ts = this->tags.value("tmi-sent-ts").toLongLong();
bool customReceived = false;
qint64 ts =
this->tags.value("rm-received-ts").toLongLong(&customReceived);
if (!customReceived)
{
ts = this->tags.value("tmi-sent-ts").toLongLong();
}
QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(ts);
this->emplace<TimestampElement>(dateTime.time());
}