Commit 34fbdac7 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Linphone/Chat/IncomingMessage): display avatar only for the...

feat(ui/modules/Linphone/Chat/IncomingMessage): display avatar only for the first incoming message of a sequence
parent 30d8de51
......@@ -21,8 +21,18 @@ RowLayout {
anchors.centerIn: parent
height: ChatStyle.entry.message.incoming.avatarSize
image: _contactObserver.contact ? _contactObserver.contact.avatar : ''
username: LinphoneUtils.getContactUsername(_contactObserver.contact || _contactObserver.sipAddress)
username: LinphoneUtils.getContactUsername(_contactObserver.contact || proxyModel.sipAddress)
width: ChatStyle.entry.message.incoming.avatarSize
// The avatar is only visible for the first message of a incoming messages sequence.
visible: {
if (index === 0) {
return true
}
var entry = proxyModel.data(proxyModel.index(index - 1, 0))
return entry.type !== ChatModel.MessageEntry || entry.isOutgoing
}
}
}
......@@ -33,7 +43,7 @@ RowLayout {
// Not a style. Workaround to avoid a 0 width.
// Arbitrary value.
Layout.minimumWidth: 20
Layout.minimumWidth: 1
backgroundColor: ChatStyle.entry.message.incoming.backgroundColor
color: ChatStyle.entry.message.incoming.text.color
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment