mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-20 13:18:06 +00:00
feat(ui/modules/Linphone/Chat/IncomingMessage): display avatar if it exits one hour between two messages
This commit is contained in:
parent
52eb9f2c07
commit
87f2b2e1f3
1 changed files with 9 additions and 3 deletions
|
|
@ -27,11 +27,17 @@ RowLayout {
|
|||
// The avatar is only visible for the first message of a incoming messages sequence.
|
||||
visible: {
|
||||
if (index <= 0) {
|
||||
return true
|
||||
return true // 1. First message, so visible.
|
||||
}
|
||||
|
||||
var entry = proxyModel.data(proxyModel.index(index - 1, 0))
|
||||
return entry.type !== ChatModel.MessageEntry || entry.isOutgoing
|
||||
var previousEntry = proxyModel.data(proxyModel.index(index - 1, 0))
|
||||
|
||||
// 2. Previous entry is a call event. => Visible.
|
||||
// 3. I have sent a message before me contact. => Visible.
|
||||
// 4. One hour between two incoming message. => Visible.
|
||||
return previousEntry.type !== ChatModel.MessageEntry ||
|
||||
previousEntry.isOutgoing ||
|
||||
$chatEntry.timestamp.getTime() - previousEntry.timestamp.getTime() > 3600
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue