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 ideas
(^/v) messages unread + messages still sending (^/v) messages unread + messages still sending
sticky avatar at top sticky avatar at top
ability to cancel message being sent
nio nio
fix `RoomForgetResponse.create_error` fix `RoomForgetResponse.create_error`

View File

@ -75,7 +75,12 @@ function onTimelineEventReceived(
"targetUserId": target_user_id, "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({ var found = timelines.getIndices({
"roomId": room_id, "roomId": room_id,
"senderId": sender_id, "senderId": sender_id,

View File

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