diff --git a/tests/ui/modules/Linphone/Contact/Contact.qml b/tests/ui/modules/Linphone/Contact/Contact.qml index cf5a57b88..f6b708bad 100644 --- a/tests/ui/modules/Linphone/Contact/Contact.qml +++ b/tests/ui/modules/Linphone/Contact/Contact.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import Utils 1.0 // =================================================================== @@ -12,6 +13,7 @@ Rectangle { property alias sipAddressColor: description.sipAddressColor property alias usernameColor: description.usernameColor + // Can be a contact object or just a sip address. property var contact color: 'transparent' // No color by default. @@ -30,9 +32,11 @@ Rectangle { Layout.preferredHeight: ContactStyle.contentHeight Layout.preferredWidth: ContactStyle.contentHeight - image: contact.avatar - presenceLevel: contact.presenceLevel - username: contact.username + image: contact.avatar || '' + presenceLevel: contact.presenceLevel || Presence.White + username: Utils.isString(contact) + ? contact.substring(4, contact.indexOf('@')) // 4 = length("sip:") + : contact.username } ContactDescription { @@ -40,7 +44,9 @@ Rectangle { Layout.fillHeight: true Layout.fillWidth: true - sipAddress: contact.sipAddress + sipAddress: Utils.isString(contact) + ? contact + : contact.sipAddress username: avatar.username } diff --git a/tests/ui/modules/Linphone/Timeline.qml b/tests/ui/modules/Linphone/Timeline.qml index bd70be321..c5d47fe1a 100644 --- a/tests/ui/modules/Linphone/Timeline.qml +++ b/tests/ui/modules/Linphone/Timeline.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import Utils 1.0 // =================================================================== @@ -12,7 +13,7 @@ ColumnLayout { property alias model: view.model - signal contactSelected (var contact) + signal entrySelected (var entry) // ----------------------------------------------------------------- @@ -63,9 +64,16 @@ ColumnLayout { currentIndex: -1 delegate: Item { - property var contact: ContactsListModel.mapSipAddressToContact( - $timelineEntry.sipAddresses - ) + property var contact: { + Utils.assert( + !Utils.isArray($timelineEntry.sipAddresses), + 'Conferences are not supported at this moment.' + ) + + return ContactsListModel.mapSipAddressToContact( + $timelineEntry.sipAddresses + ) || $timelineEntry.sipAddresses + } height: TimelineStyle.contact.height width: parent.width @@ -97,7 +105,7 @@ ColumnLayout { onClicked: { view.currentIndex = index - timeline.contactSelected(parent.contact) + timeline.entrySelected(parent.contact) } } } diff --git a/tests/ui/views/App/MainWindow/MainWindow.qml b/tests/ui/views/App/MainWindow/MainWindow.qml index 23e1f94d8..e86b9656c 100644 --- a/tests/ui/views/App/MainWindow/MainWindow.qml +++ b/tests/ui/views/App/MainWindow/MainWindow.qml @@ -160,9 +160,9 @@ ApplicationWindow { Layout.fillWidth: true model: TimelineModel - onContactSelected: { + onEntrySelected: { menu.resetSelectedEntry() - setView('Conversation', { contact: contact }) + setView('Conversation', { contact: entry }) } } }