1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 06:45:45 +02:00

messagelistview: fix sequencing on edition

No need to re-compute sequencing as deleted messages are just
replaced by "Deleted message" and edition should not change any
sequencing

Change-Id: I03e210ac88b919b76b409583de2221406e468f50
GitLab: #991
This commit is contained in:
Sébastien Blin 2023-03-03 14:49:05 -05:00
parent 266aae543d
commit 5380a86b5c

View file

@ -179,27 +179,6 @@ JamiListView {
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
currentIndex: -1 currentIndex: -1
// This connection to dataChanged resolves the styling for
// messages before and after an erased message.
Connections {
target: MessagesAdapter.messageListModel
function onDataChanged(tl, br, roles) {
if (!(roles.includes(MessageList.Body) &&
roles.includes(MessageList.PreviousBodies))) {
return
}
const staleIndex = tl.row
var pItem = root.itemAtIndex(staleIndex - 1)
var nItem = root.itemAtIndex(staleIndex + 1)
var ppItem = root.itemAtIndex(staleIndex + 2)
var nnItem = root.itemAtIndex(staleIndex + 2)
computeTimestampVisibility(ppItem, staleIndex - 2, pItem, staleIndex - 1)
computeSequencing(ppItem, pItem, nItem)
computeTimestampVisibility(nItem, staleIndex + 1, nnItem, staleIndex + 2)
computeSequencing(pItem, nItem, nnItem)
}
}
model: MessagesAdapter.messageListModel model: MessagesAdapter.messageListModel
delegate: DelegateChooser { delegate: DelegateChooser {
id: delegateChooser id: delegateChooser