From bbbd227a4e0fdf9f77240fece9b78f312a213770 Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Wed, 9 Sep 2015 15:27:38 -0400
Subject: [PATCH] PeerName: do not set it to empty when call is over

The call details map<string string> has mostly empty values once the call is over,
we do not want it to override an existing peer name to be empty in this case.
This results in the display name being saved in the call history.

Issue: #80221
Change-Id: I119bded6c79f226c67418538ce835ff54eae7521
---
 src/call.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/call.cpp b/src/call.cpp
index bb8c7e00..2cee894e 100644
--- a/src/call.cpp
+++ b/src/call.cpp
@@ -1174,7 +1174,8 @@ Call::State CallPrivate::stateChanged(const QString& newStateName)
       }
 
       MapStringString details = getCallDetailsCommon(m_DringId);
-      if (details[CallPrivate::DetailsMapFields::PEER_NAME] != m_PeerName)
+      if (!details[CallPrivate::DetailsMapFields::PEER_NAME].isEmpty()
+          and ( details[CallPrivate::DetailsMapFields::PEER_NAME] != m_PeerName) )
          m_PeerName = details[CallPrivate::DetailsMapFields::PEER_NAME];
 
       //Load the certificate if it's now available
-- 
GitLab