Fix date bug in tt-rss service

The value "Created on" of messages received from tiny tiny rss server are
always 1969 or 1970. A 32-bit int can not record the timestamp in milliseconds.
Changing to qint64 solve the problem.
This commit is contained in:
fanteik 2017-12-13 22:12:02 +01:00
parent 5d5564b4d1
commit 296a11e05f

View file

@ -580,8 +580,9 @@ QList<Message> TtRssGetHeadlinesResponse::messages() const {
message.m_contents = mapped["content"].toString();
// Multiply by 1000 because Tiny Tiny RSS API does not include miliseconds in Unix
// date/time number.
message.m_created = TextFactory::parseDateTime(int(mapped["updated"].toDouble()) * 1000);
// date/time number.
const qint64 t = static_cast<qint64>(mapped["updated"].toDouble()) * 1000;
message.m_created = TextFactory::parseDateTime(t);
message.m_createdFromFeed = true;
message.m_customId = QString::number(mapped["id"].toInt());
message.m_feedId = mapped["feed_id"].toString();