Commit 0c7387f8 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Linphone/Chat): format correcly sections

parent 5f4e3cf3
......@@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
return QVariant();
switch (role) {
case: Roles::ChatEntry
case Roles::ChatEntry:
return QVariant::fromValue(m_entries[row]);
case: Roles::SectionDate
return QVariant::fromValue(m_entries[row]["sectionDate"]);
case Roles::SectionDate:
return QVariant::fromValue(m_entries[row]["timestamp"].toDate());
}
return QVariant();
......@@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
for (auto &message : chat_room->getHistory(0)) {
QVariantMap map;
map["sectionDate"] = 1465389121;
// UTC format.
map["timestamp"] = QDateTime::fromTime_t(message->getTime());
map["type"] = "message";
map["content"] = Utils::linphoneStringToQString(
......
......@@ -65,7 +65,7 @@ ColumnLayout {
// Cast section to integer because Qt converts the
// sectionDate in string!!!
text: new Date(+section).toLocaleDateString(
text: new Date(section).toLocaleDateString(
Qt.locale(App.locale())
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment