diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index ccbb54c45..397a2cd0b 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -100,6 +100,7 @@ QString CallModel::getPeerAddress () const { QString CallModel::getLocalAddress () const { return Utils::coreStringToAppString(mCall->getCallLog()->getLocalAddress()->asStringUriOnly()); } + QString CallModel::getFullPeerAddress () const { return Utils::coreStringToAppString(mRemoteAddress->asString()); } @@ -668,7 +669,9 @@ void CallModel::searchReceived(std::list } }else{ if((*it)->getAddress()->weakEqual(mRemoteAddress)){ - setRemoteDisplayName((*it)->getAddress()->getDisplayName()); + std::string newDisplayName = (*it)->getAddress()->getDisplayName(); + if(!newDisplayName.empty())// Override only if there is one + setRemoteDisplayName(newDisplayName); found = true; } } @@ -702,6 +705,9 @@ void CallModel::setRemoteDisplayName(const std::string& name){ callLog->setRemoteAddress(Utils::interpretUrl(getFullPeerAddress())); } emit fullPeerAddressChanged(); + ChatRoomModel * model = getChatRoomModel(); + if(model) + model->emitFullPeerAddressChanged(); } QString CallModel::getTransferAddress () const { diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 8bdf12575..ab10e8541 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -220,29 +220,26 @@ ChatRoomModel::ChatRoomModel (std::shared_ptr chatRoom, QObj QObject::connect(coreHandlers, &CoreHandlers::callStateChanged, this, &ChatRoomModel::handleCallStateChanged); QObject::connect(coreHandlers, &CoreHandlers::presenceStatusReceived, this, &ChatRoomModel::handlePresenceStatusReceived); //QObject::connect(coreHandlers, &CoreHandlers::isComposingChanged, this, &ChatRoomModel::handleIsComposingChanged); - - QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactAdded, this, &ChatRoomModel::usernameChanged); + QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactAdded, this, &ChatRoomModel::fullPeerAddressChanged); QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactAdded, this, &ChatRoomModel::avatarChanged); - QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactRemoved, this, &ChatRoomModel::usernameChanged); QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactRemoved, this, &ChatRoomModel::fullPeerAddressChanged); QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactRemoved, this, &ChatRoomModel::avatarChanged); - QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactUpdated, this, &ChatRoomModel::usernameChanged); QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactUpdated, this, &ChatRoomModel::fullPeerAddressChanged); QObject::connect(coreManager->getContactsListModel(), &ContactsListModel::contactUpdated, this, &ChatRoomModel::avatarChanged); + + connect(this, &ChatRoomModel::fullPeerAddressChanged, this, &ChatRoomModel::usernameChanged); //QObject::connect(this, &ChatRoomModel::messageCountReset, coreManager, &CoreManager::eventCountChanged ); if(mChatRoom){ mParticipantListModel = std::make_shared(this); connect(mParticipantListModel.get(), &ParticipantListModel::participantsChanged, this, &ChatRoomModel::fullPeerAddressChanged); - connect(mParticipantListModel.get(), &ParticipantListModel::participantsChanged, this, &ChatRoomModel::usernameChanged); auto participants = mChatRoom->getParticipants(); for(auto participant : participants){ auto contact = CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(Utils::coreStringToAppString((participant)->getAddress()->asString())); if(contact) { connect(contact, &ContactModel::contactUpdated, this, &ChatRoomModel::fullPeerAddressChanged); - connect(contact, &ContactModel::contactUpdated, this, &ChatRoomModel::usernameChanged); } } }else @@ -354,6 +351,10 @@ void ChatRoomModel::removeEntry(ChatEvent* entry){ removeRow(row); } } + +void ChatRoomModel::emitFullPeerAddressChanged(){ + emit fullPeerAddressChanged(); +} //-------------------------------------------------------------------------------------------- QString ChatRoomModel::getPeerAddress () const { @@ -403,6 +404,13 @@ QString ChatRoomModel::getUsername () const { if(username != "") return username; + if( mChatRoom->getNbParticipants() == 1 ) { + auto call = mChatRoom->getCall(); + if(call) + username = Utils::getDisplayName(call->getRemoteAddress()); + if(username != "") + return username; + } if( mChatRoom->getNbParticipants() >= 1) username = mParticipantListModel->displayNamesToString(); if(username != "") @@ -854,6 +862,8 @@ void ChatRoomModel::callEnded(std::shared_ptr call){ else{ insertCall(call->getCallLog()); } + // When a call is end, a new log WILL be written in database. It may have information on display name. + QTimer::singleShot(100, this, &ChatRoomModel::fullPeerAddressChanged); } // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index c8c56c627..afec81154 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -269,6 +269,8 @@ public slots: void removeEntry(ChatEvent* entry); + + void emitFullPeerAddressChanged(); // Use to call signal when changing data that are not managed by the chat room (like data coming from call) signals: bool isRemoteComposingChanged (); diff --git a/linphone-app/src/components/file/FileExtractor.cpp b/linphone-app/src/components/file/FileExtractor.cpp index e87fc9d82..a762351f6 100644 --- a/linphone-app/src/components/file/FileExtractor.cpp +++ b/linphone-app/src/components/file/FileExtractor.cpp @@ -60,10 +60,15 @@ void FileExtractor::extract () { } #ifdef WIN32 // Test the presence of bzip2 in the system - int result = QProcess::execute("bzip2.exe", QStringList()); - if( result != -2 || QProcess::execute(Utils::coreStringToAppString(Paths::getToolsDirPath())+"\\bzip2.exe", QStringList())!=-2){ + QProcess process; + process.closeReadChannel(QProcess::StandardOutput); + process.closeReadChannel(QProcess::StandardError); + process.start("bzip2.exe",QStringList("--help") ); + //int result = QProcess::execute("bzip2.exe", QStringList("--help")); + if( process.error() != QProcess::FailedToStart || QProcess::execute(Utils::coreStringToAppString(Paths::getToolsDirPath())+"\\bzip2.exe", QStringList())!=-2){ mTimer->start(); }else{// Download bzip2 + qWarning() << "bzip2 was not found. Downloading it."; QTimer * timer = mTimer; FileDownloader * fileDownloader = new FileDownloader(); int downloadStep = 0; diff --git a/linphone-app/src/utils/Utils.cpp b/linphone-app/src/utils/Utils.cpp index bf024b9fb..2f92006c1 100644 --- a/linphone-app/src/utils/Utils.cpp +++ b/linphone-app/src/utils/Utils.cpp @@ -481,9 +481,9 @@ QString Utils::getDisplayName(const std::shared_ptr& ad return cl->getRemoteAddress()->weakEqual(address); }); if(callLog != callHistory.end()) - displayName = Utils::coreStringToAppString((*callLog)->getRemoteAddress()->getDisplayName()); + displayName = QString::fromStdString((*callLog)->getRemoteAddress()->getDisplayName()); if(displayName == "") - displayName = Utils::coreStringToAppString(address->getDisplayName()); + displayName = QString::fromStdString(address->getDisplayName()); if(displayName == "") displayName = Utils::coreStringToAppString(address->getUsername()); } diff --git a/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml b/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml index cf47a1047..70770ceeb 100644 --- a/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml +++ b/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml @@ -12,7 +12,7 @@ MouseArea { property int delay: TooltipStyle.delay property bool force: false property var tooltipParent: parent - property int maxWidth : window.width + property int maxWidth : window? window.width : tooltipParent.width property bool _visible: false property int hoveringCursor : Qt.PointingHandCursor diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.js b/linphone-app/ui/modules/Linphone/Chat/Chat.js index 86762daf5..ddc3d2855 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.js +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.js @@ -24,6 +24,7 @@ .import QtQuick 2.7 as QtQuick .import Linphone 1.0 as Linphone +.import UtilsCpp 1.0 as UtilsCpp .import 'qrc:/ui/scripts/LinphoneUtils/linphone-utils.js' as LinphoneUtils @@ -50,18 +51,6 @@ function getComponentFromEntry (chatEntry) { return chatEntry.isOutgoing ? 'OutgoingMessage.qml' : 'IncomingMessage.qml' } -function getIsComposingMessage () { - if (!container.proxyModel.isRemoteComposing || !Linphone.SettingsModel.chatEnabled) { - return '' - } - - var sipAddressObserver = chat.sipAddressObserver - return qsTr('isComposing').replace( - '%1', - LinphoneUtils.getContactUsername(sipAddressObserver) - ) -} - function handleFilesDropped (files) { chat.bindToEnd = true files.forEach(container.proxyModel.sendFileMessage) diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index cb3bae55e..6e727329f 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import UtilsCpp 1.0 import 'Chat.js' as Logic diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index b1886dd82..9eb6a5b1a 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -62,7 +62,6 @@ Rectangle { ) :-1 - //username: LinphoneUtils.getContactUsername(_contact || entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '') //username: UtilsCpp.getDisplayName(entry.sipAddress || entry.peerAddress ) username : entry!=undefined && entry.isOneToOne!=undefined && !entry.isOneToOne ? '' : item.username diff --git a/linphone-app/ui/modules/Linphone/History/Event.qml b/linphone-app/ui/modules/Linphone/History/Event.qml index aec5f7e44..06983b187 100644 --- a/linphone-app/ui/modules/Linphone/History/Event.qml +++ b/linphone-app/ui/modules/Linphone/History/Event.qml @@ -5,6 +5,7 @@ import Linphone 1.0 import LinphoneUtils 1.0 import Linphone.Styles 1.0 import Utils 1.0 +import UtilsCpp 1.0 // ============================================================================= @@ -87,7 +88,7 @@ Row { pointSize: HistoryStyle.entry.event.text.pointSize } height: parent.height - text: LinphoneUtils.getContactUsername(_sipAddressObserver) + text: UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) verticalAlignment: Text.AlignVCenter MouseArea{ anchors.fill:parent diff --git a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml index bbf2c5329..ac143407f 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml @@ -257,7 +257,7 @@ Rectangle { isClickable: true } Icon{ - icon: modelData.selected ? 'timer_light' : 'timer' + icon: modelData && modelData.selected ? 'timer_light' : 'timer' iconSize: 15 anchors.right:parent.right anchors.bottom:parent.bottom diff --git a/linphone-app/ui/scripts/LinphoneUtils/linphone-utils.js b/linphone-app/ui/scripts/LinphoneUtils/linphone-utils.js index 1281a6364..53f9e0761 100644 --- a/linphone-app/ui/scripts/LinphoneUtils/linphone-utils.js +++ b/linphone-app/ui/scripts/LinphoneUtils/linphone-utils.js @@ -24,6 +24,7 @@ .pragma library .import Linphone 1.0 as Linphone +.import UtilsCpp 1.0 as UtilsCpp .import 'qrc:/ui/scripts/Utils/utils.js' as Utils @@ -80,37 +81,6 @@ function _getUsername (str) { return Utils.decode(str.substring(start, end)) } -// ----------------------------------------------------------------------------- - -// Returns the username of a contact/sipAddressObserver object or URI string. -function getContactUsername (contact) { - if(contact){ - var object = contact.contact || // Contact object from `SipAddressObserver`. - (contact.vcard && contact) // Contact object. - - // 1. `object` is a contact. - if (object) { - return object.vcard.username - } - - // 2. `object` is just a string. - object = Utils.isString(contact.peerAddress) - ? contact.peerAddress // String from `SipAddressObserver`. - : contact // Just a String. - - // Use display name. - var name = _getDisplayName(object) - if (name != null) { - return name - } - - // Use username. - name = _getUsername(object) - return name == null ? 'Bad EGG' : name - }else - return ''; -} - // ============================================================================= // Codec helpers. // ============================================================================= diff --git a/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml b/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml index 09be11770..717485e0b 100644 --- a/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml +++ b/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml @@ -5,6 +5,8 @@ import Common 1.0 import Linphone 1.0 import LinphoneUtils 1.0 +import UtilsCpp 1.0 + import App.Styles 1.0 // ============================================================================= @@ -42,7 +44,7 @@ Rectangle { height: CallStyle.header.contactDescription.height horizontalTextAlignment: Text.AlignHCenter sipAddress: call.peerAddress - username: LinphoneUtils.getContactUsername(_sipAddressObserver) + username: UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) width: contentWidth } diff --git a/linphone-app/ui/views/App/Calls/Conference.qml b/linphone-app/ui/views/App/Calls/Conference.qml index 5d6a5dec4..c14443710 100644 --- a/linphone-app/ui/views/App/Calls/Conference.qml +++ b/linphone-app/ui/views/App/Calls/Conference.qml @@ -6,6 +6,8 @@ import Common.Styles 1.0 import Linphone 1.0 import LinphoneUtils 1.0 +import UtilsCpp 1.0 + import App.Styles 1.0 // ============================================================================= @@ -135,7 +137,7 @@ Rectangle { horizontalTextAlignment: Text.AlignHCenter sipAddress: parent.sipAddress - username: LinphoneUtils.getContactUsername(parent._sipAddressObserver) + username: UtilsCpp.getDisplayName(parent._sipAddressObserver.peerAddress) } IncallAvatar { diff --git a/linphone-app/ui/views/App/Calls/EndedCall.qml b/linphone-app/ui/views/App/Calls/EndedCall.qml index 241a6225c..72fa5710a 100644 --- a/linphone-app/ui/views/App/Calls/EndedCall.qml +++ b/linphone-app/ui/views/App/Calls/EndedCall.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Linphone 1.0 import LinphoneUtils 1.0 import Utils 1.0 +import UtilsCpp 1.0 import App.Styles 1.0 @@ -38,7 +39,7 @@ Rectangle { horizontalTextAlignment: Text.AlignHCenter sipAddress: _sipAddressObserver.peerAddress - username: LinphoneUtils.getContactUsername(_sipAddressObserver) + username: UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) } Text { diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index 90ad4243e..c0b468270 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -7,6 +7,7 @@ import Common.Styles 1.0 import Linphone 1.0 import LinphoneUtils 1.0 import Utils 1.0 +import UtilsCpp 1.0 import App.Styles 1.0 @@ -126,7 +127,7 @@ Rectangle { anchors.centerIn: parent horizontalTextAlignment: Text.AlignHCenter sipAddress: _sipAddressObserver.peerAddress - username: LinphoneUtils.getContactUsername(_sipAddressObserver) + username: UtilsCpp.getDisplayName(sipAddress) height: parent.height width: parent.width - rightActions.width - leftActions.width diff --git a/linphone-app/ui/views/App/Calls/IncallAvatar.qml b/linphone-app/ui/views/App/Calls/IncallAvatar.qml index 520eae683..20c6fe229 100644 --- a/linphone-app/ui/views/App/Calls/IncallAvatar.qml +++ b/linphone-app/ui/views/App/Calls/IncallAvatar.qml @@ -3,6 +3,8 @@ import QtQuick 2.7 import Linphone 1.0 import LinphoneUtils 1.0 +import UtilsCpp 1.0 + import App.Styles 1.0 // ============================================================================= @@ -11,7 +13,7 @@ Avatar { property var call readonly property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver(call.fullPeerAddress, call.fullLocalAddress) - readonly property var _username: LinphoneUtils.getContactUsername(_sipAddressObserver) + readonly property var _username: UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) backgroundColor: CallStyle.container.avatar.backgroundColor foregroundColor: call.status === CallModel.CallStatusPaused diff --git a/linphone-app/ui/views/App/Main/ContactEdit.js b/linphone-app/ui/views/App/Main/ContactEdit.js index 2d5e3bf72..00df25b7f 100644 --- a/linphone-app/ui/views/App/Main/ContactEdit.js +++ b/linphone-app/ui/views/App/Main/ContactEdit.js @@ -22,6 +22,7 @@ // ============================================================================= .import Linphone 1.0 as Linphone +.import UtilsCpp 1.0 as UtilsCpp .import 'qrc:/ui/scripts/Utils/utils.js' as Utils .import 'qrc:/ui/scripts/LinphoneUtils/linphone-utils.js' as LinphoneUtils @@ -48,31 +49,6 @@ function handleContactUpdated () { } } -function handleCreation () { - var sipAddress = contactEdit.sipAddress - var contact = contactEdit._contact = Linphone.SipAddressesModel.mapSipAddressToContact( - sipAddress - ) - - if (!contact) { - // Add a new contact. - var vcard = Linphone.CoreManager.createDetachedVcardModel() - - if (sipAddress && sipAddress.length > 0) { - vcard.addSipAddress(sipAddress) - vcard.username = LinphoneUtils.getContactUsername(Linphone.SipAddressesModel.getSipAddressObserver(sipAddress, sipAddress)) - }else{ - vcard.username = ' '// Username initialization to avoid Belr parsing issue when setting new name - } - - contactEdit._vcard = vcard - contactEdit._edition = true - } else { - // See or edit a contact. - contactEdit._vcard = contact.vcard - } -} - function handleVcardChanged (vcard) { if (!vcard) { vcard = {} diff --git a/linphone-app/ui/views/App/Main/ContactEdit.qml b/linphone-app/ui/views/App/Main/ContactEdit.qml index 8d03e7f20..931093b46 100644 --- a/linphone-app/ui/views/App/Main/ContactEdit.qml +++ b/linphone-app/ui/views/App/Main/ContactEdit.qml @@ -7,6 +7,8 @@ import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import UtilsCpp 1.0 + import App.Styles 1.0 import 'ContactEdit.js' as Logic @@ -28,7 +30,30 @@ ColumnLayout { spacing: 0 - Component.onCompleted: Logic.handleCreation() + Component.onCompleted:{ + var sipAddress = contactEdit.sipAddress + var contact = contactEdit._contact = SipAddressesModel.mapSipAddressToContact( + sipAddress + ) + + if (!contact) { + // Add a new contact. + var vcard = CoreManager.createDetachedVcardModel() + + if (sipAddress && sipAddress.length > 0) { + vcard.addSipAddress(sipAddress) + vcard.username = UtilsCpp.getDisplayName(SipAddressesModel.getSipAddressObserver(sipAddress, sipAddress).peerAddress) + }else{ + vcard.username = ' '// Username initialization to avoid Belr parsing issue when setting new name + } + + contactEdit._vcard = vcard + contactEdit._edition = true + } else { + // See or edit a contact. + contactEdit._vcard = contact.vcard + } + } onVcardChanged: Logic.handleVcardChanged(vcard) diff --git a/linphone-app/ui/views/App/Main/Contacts.qml b/linphone-app/ui/views/App/Main/Contacts.qml index 460bd8cf5..fa8a1af0c 100644 --- a/linphone-app/ui/views/App/Main/Contacts.qml +++ b/linphone-app/ui/views/App/Main/Contacts.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Utils 1.0 +import UtilsCpp 1.0 import LinphoneEnums 1.0 import App.Styles 1.0 diff --git a/linphone-app/ui/views/App/Main/Conversation.js b/linphone-app/ui/views/App/Main/Conversation.js index 49fe73515..7e7a6c6ef 100644 --- a/linphone-app/ui/views/App/Main/Conversation.js +++ b/linphone-app/ui/views/App/Main/Conversation.js @@ -22,6 +22,7 @@ // ============================================================================= .import Linphone 1.0 as Linphone +.import UtilsCpp 1.0 as UtilsCpp .import 'qrc:/ui/scripts/LinphoneUtils/linphone-utils.js' as LinphoneUtils .import 'qrc:/ui/scripts/Utils/utils.js' as Utils @@ -51,10 +52,6 @@ function getEditTooltipText() { return conversation._sipAddressObserver.contact ? qsTr('tooltipContactEdit') : qsTr('tooltipContactAdd') } -function getUsername () { - return LinphoneUtils.getContactUsername(conversation._sipAddressObserver) -} - function updateChatFilter (button) { var ChatRoomModel = Linphone.ChatRoomModel if (button === 0) { @@ -72,4 +69,4 @@ function openConferenceManager (params) { App.smartShowWindow(callsWindow) callsWindow.openConferenceManager(params) -} \ No newline at end of file +} diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index e60e80789..d2525d8ce 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -88,7 +88,7 @@ ColumnLayout { presenceLevel: chatRoomModel.presenceStatus //username: Logic.getUsername() - username: chatRoomModel?chatRoomModel.username:Logic.getUsername() + username: chatRoomModel?chatRoomModel.username:UtilsCpp.getDisplayName(conversation._sipAddressObserver.peerAddress) visible: !groupChat.visible } diff --git a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml index 347e2cf8a..110811801 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Utils 1.0 +import UtilsCpp 1.0 import LinphoneUtils 1.0 import LinphoneEnums 1.0 @@ -67,7 +68,7 @@ DialogPlus { Layout.leftMargin: 14 username: modelData?(modelData.contactModel ? modelData.contactModel.vcard.username :modelData.username?modelData.username: - LinphoneUtils.getContactUsername(modelData.sipAddress) + UtilsCpp.getDisplayName(modelData.sipAddress) ):'' Icon{ property int securityLevel : modelData.securityLevel @@ -201,4 +202,4 @@ DialogPlus { } } } -} \ No newline at end of file +} diff --git a/linphone-app/ui/views/App/Main/HistoryView.js b/linphone-app/ui/views/App/Main/HistoryView.js index bc657b104..5cf60c27a 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.js +++ b/linphone-app/ui/views/App/Main/HistoryView.js @@ -22,6 +22,7 @@ // ============================================================================= .import Linphone 1.0 as Linphone +.import UtilsCpp 1.0 as UtilsCpp .import 'qrc:/ui/scripts/LinphoneUtils/linphone-utils.js' as LinphoneUtils .import 'qrc:/ui/scripts/Utils/utils.js' as Utils @@ -51,10 +52,6 @@ function getEditTooltipText() { return historyView._sipAddressObserver && historyView._sipAddressObserver.contact ? qsTr('tooltipContactEdit') : qsTr('tooltipContactAdd') } -function getUsername () { - return LinphoneUtils.getContactUsername(historyView._sipAddressObserver) -} - function updateHistoryFilter (button) { var HistoryModel = Linphone.HistoryModel if (button === 0) { diff --git a/linphone-app/ui/views/App/Main/HistoryView.qml b/linphone-app/ui/views/App/Main/HistoryView.qml index 6429052c0..02d5a49dc 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.qml +++ b/linphone-app/ui/views/App/Main/HistoryView.qml @@ -3,6 +3,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 +import UtilsCpp 1.0 import App.Styles 1.0 @@ -55,7 +56,7 @@ ColumnLayout { historyView._sipAddressObserver.presenceStatus ):null - username: peerAddress?Logic.getUsername():null + username: peerAddress? UtilsCpp.getDisplayName(historyView._sipAddressObserver.peerAddress):null visible:peerAddress }