Keep local echo delegates at the bottom

This commit is contained in:
miruka 2019-07-04 23:12:21 -04:00
parent 1db406d9af
commit dbcfad1c50
3 changed files with 13 additions and 4 deletions

View File

@ -5,6 +5,7 @@
ideas
(^/v) messages unread + messages still sending
sticky avatar at top
ability to cancel message being sent
nio
fix `RoomForgetResponse.create_error`

View File

@ -75,7 +75,12 @@ function onTimelineEventReceived(
"targetUserId": target_user_id,
}
// Replace any matching local echo
if (is_local_echo) {
timelines.append(item)
return
}
// Replace first matching local echo
var found = timelines.getIndices({
"roomId": room_id,
"senderId": sender_id,

View File

@ -12,8 +12,11 @@ HListModel {
}
}
sorters: RoleSorter {
roleName: "date"
sortOrder: Qt.DescendingOrder
sorters: ExpressionSorter {
expression: modelLeft.isLocalEcho && ! modelRight.isLocalEcho ?
true :
! modelLeft.isLocalEcho && modelRight.isLocalEcho ?
false :
modelLeft.date > modelRight.date // descending order
}
}