Keep local echo delegates at the bottom
This commit is contained in:
parent
1db406d9af
commit
dbcfad1c50
1
TODO.md
1
TODO.md
@ -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`
|
||||||
|
@ -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,
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user