Skip to content
Snippets Groups Projects
Commit dfd1f6c7 authored by Nicolas Vengeon's avatar Nicolas Vengeon
Browse files

MessageListView: wrong new message sequence

GitLab: #983

Change-Id: Ida7b6e84768aac69113af8d29b96a4627ae6c9f4
parent b5684844
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ JamiListView { ...@@ -63,6 +63,7 @@ JamiListView {
var pItemIndex = itemIndex - 1 var pItemIndex = itemIndex - 1
var nItem = root.itemAtIndex(itemIndex + 1) var nItem = root.itemAtIndex(itemIndex + 1)
var nItemIndex = itemIndex + 1 var nItemIndex = itemIndex + 1
// middle insertion // middle insertion
if (pItem && nItem) { if (pItem && nItem) {
computeTimestampVisibility(item, itemIndex, nItem, nItemIndex) computeTimestampVisibility(item, itemIndex, nItem, nItemIndex)
...@@ -80,10 +81,17 @@ JamiListView { ...@@ -80,10 +81,17 @@ JamiListView {
} }
// index 0 insertion = new message // index 0 insertion = new message
if (itemIndex === 0) { if (itemIndex === 0) {
if (!nItem && !CurrentConversation.allMessagesLoaded) // Compute the timestamp visibility when a new message is received/sent.
Qt.callLater(computeChatview, item, itemIndex) // This needs to be done in a delayed fashion because the new message is inserted
else // at the top of the list and the list is not yet updated.
computeSequencing( null, item, root.itemAtIndex(itemIndex + 1)) Qt.callLater(() => {
var fItem = root.itemAtIndex(1)
if (fItem) {
computeTimestampVisibility(item, 0, fItem, 1)
computeSequencing(null, item, fItem)
computeSequencing(item, fItem, root.itemAtIndex(2))
}
})
} }
// top element // top element
if(itemIndex === root.count - 1 && CurrentConversation.allMessagesLoaded) { if(itemIndex === root.count - 1 && CurrentConversation.allMessagesLoaded) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment