diff --git a/tests/ui/modules/Linphone/Chat/IncomingMessage.qml b/tests/ui/modules/Linphone/Chat/IncomingMessage.qml index 62aa3077e..799f7aa8e 100644 --- a/tests/ui/modules/Linphone/Chat/IncomingMessage.qml +++ b/tests/ui/modules/Linphone/Chat/IncomingMessage.qml @@ -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