moment/src/qml/Models/Timelines.qml

25 lines
700 B
QML
Raw Normal View History

2019-07-07 23:52:41 -04:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
2019-07-04 16:01:44 -04:00
import SortFilterProxyModel 0.2
import "../Base"
HListModel {
function lastEventOf(roomId) {
2019-07-18 05:18:13 -04:00
for (let i = 0; i < count; i++) {
let item = get(i) // TODO: standardize
if (item.roomId == roomId) { return item }
2019-07-04 16:01:44 -04:00
}
2019-07-18 05:18:13 -04:00
return null
2019-07-04 16:01:44 -04:00
}
sorters: ExpressionSorter {
expression: modelLeft.isLocalEcho && ! modelRight.isLocalEcho ?
true :
! modelLeft.isLocalEcho && modelRight.isLocalEcho ?
false :
modelLeft.date > modelRight.date // descending order
2019-07-04 16:01:44 -04:00
}
}