From 5829d54f70826aa11a2105db45637c4b59d3f924 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 8 May 2020 00:23:44 +0200 Subject: [PATCH] Display name on notifications by using full SIP addresses --- linphone-app/src/app/cli/Cli.cpp | 2 +- linphone-app/src/components/call/CallModel.cpp | 5 ++--- linphone-app/src/components/chat/ChatModel.cpp | 4 ++-- linphone-app/src/components/notifier/Notifier.cpp | 4 ++-- .../src/components/settings/AccountSettingsModel.cpp | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/linphone-app/src/app/cli/Cli.cpp b/linphone-app/src/app/cli/Cli.cpp index bbfdbc59b..16110163a 100644 --- a/linphone-app/src/app/cli/Cli.cpp +++ b/linphone-app/src/app/cli/Cli.cpp @@ -295,7 +295,7 @@ void Cli::Command::executeUri (const shared_ptr &address) con args[argName] = QByteArray::fromBase64(QByteArray(header.c_str(), int(header.length()))); } address->clean(); - args["sip-address"] = Utils::coreStringToAppString(address->asStringUriOnly()); + args["sip-address"] = Utils::coreStringToAppString(address->asString()); execute(args); } diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 44a91cf7d..95fca70b8 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -88,13 +88,12 @@ CallModel::~CallModel () { // ----------------------------------------------------------------------------- QString CallModel::getPeerAddress () const { - return Utils::coreStringToAppString(mCall->getRemoteAddress()->asStringUriOnly()); + return Utils::coreStringToAppString(mCall->getRemoteAddress()->asString()); } QString CallModel::getLocalAddress () const { - return Utils::coreStringToAppString(mCall->getCallLog()->getLocalAddress()->asStringUriOnly()); + return Utils::coreStringToAppString(mCall->getCallLog()->getLocalAddress()->asString()); } - // ----------------------------------------------------------------------------- void CallModel::setRecordFile (const shared_ptr &callParams) { diff --git a/linphone-app/src/components/chat/ChatModel.cpp b/linphone-app/src/components/chat/ChatModel.cpp index 8c1c9ad73..b585bbcdf 100644 --- a/linphone-app/src/components/chat/ChatModel.cpp +++ b/linphone-app/src/components/chat/ChatModel.cpp @@ -383,13 +383,13 @@ bool ChatModel::removeRows (int row, int count, const QModelIndex &parent) { QString ChatModel::getPeerAddress () const { return Utils::coreStringToAppString( - mChatRoom->getPeerAddress()->asStringUriOnly() + mChatRoom->getPeerAddress()->asString() ); } QString ChatModel::getLocalAddress () const { return Utils::coreStringToAppString( - mChatRoom->getLocalAddress()->asStringUriOnly() + mChatRoom->getLocalAddress()->asString() ); } diff --git a/linphone-app/src/components/notifier/Notifier.cpp b/linphone-app/src/components/notifier/Notifier.cpp index ee7d8524f..22dbbc450 100644 --- a/linphone-app/src/components/notifier/Notifier.cpp +++ b/linphone-app/src/components/notifier/Notifier.cpp @@ -245,8 +245,8 @@ void Notifier::notifyReceivedMessage (const shared_ptr &m : Utils::coreStringToAppString(message->getText()); shared_ptr chatRoom(message->getChatRoom()); - map["peerAddress"] = Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly()); - map["localAddress"] = Utils::coreStringToAppString(chatRoom->getLocalAddress()->asStringUriOnly()); + map["peerAddress"] = Utils::coreStringToAppString(chatRoom->getPeerAddress()->asString()); + map["localAddress"] = Utils::coreStringToAppString(chatRoom->getLocalAddress()->asString()); map["window"].setValue(App::getInstance()->getMainWindow()); CREATE_NOTIFICATION(Notifier::ReceivedMessage, map) } diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 9d4751d42..0f131a3ac 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -397,7 +397,7 @@ QVariantList AccountSettingsModel::getAccounts () const { { QVariantMap account; - account["sipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asStringUriOnly()); + account["sipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asString()); account["unreadMessageCount"] = core->getUnreadChatMessageCountFromLocal(core->createPrimaryContactParsed()); account["proxyConfig"].setValue(nullptr); accounts << account; @@ -405,7 +405,7 @@ QVariantList AccountSettingsModel::getAccounts () const { for (const auto &proxyConfig : core->getProxyConfigList()) { QVariantMap account; - account["sipAddress"] = Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asStringUriOnly()); + account["sipAddress"] = Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asString()); account["proxyConfig"].setValue(proxyConfig); account["unreadMessageCount"] = proxyConfig->getUnreadChatMessageCount(); accounts << account;