moment/src/qml/Models/Timelines.qml

26 lines
741 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.
2019-07-04 16:01:44 -04:00
import QtQuick 2.7
import SortFilterProxyModel 0.2
import "../Base"
HListModel {
function lastEventOf(room_id) {
// Return an event item or undefined if none found
for (var i = 0; i < count; i++) {
var item = get(i) // TODO: standardize
if (item.roomId == room_id) { return item }
}
}
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
}
}