diff --git a/src/call.cpp b/src/call.cpp index 6dd022b73134ab11a547c20da90cbbb4b1c1cc06..bb8c7e00d158a254b4f0dee89673e059fb338881 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -2001,10 +2001,7 @@ QVariant Call::roleData(int role) const return tr("Conference"); else if (lifeCycleState() == Call::LifeCycleState::CREATION) return dialNumber(); - else if (d_ptr->m_PeerName.isEmpty()) - return ct?ct->formattedName():peerContactMethod()?peerContactMethod()->uri():dialNumber(); - else - return formattedName(); + return formattedName(); case Qt::ToolTipRole: return tr("Account: ") + (account()?account()->alias():QString()); case Qt::EditRole: diff --git a/src/contactmethod.cpp b/src/contactmethod.cpp index b8c09bf2ab9f3ef64f8f0b18dd039b558a0f2db8..22292d45967f60eb7046187d8bfc9eace22f4a26 100644 --- a/src/contactmethod.cpp +++ b/src/contactmethod.cpp @@ -462,7 +462,13 @@ QVariant ContactMethod::roleData(int role) const QVariant cat; switch (role) { case static_cast<int>(Call::Role::Name): - cat = contact()?contact()->formattedName():primaryName(); + /* the formatted name could be empty either because the name of the contact is actually + * empty, or because the PersonPlaceHolder was never matched to a Person, in either case + * we prefer to display the URI in this case */ + if (contact() and !contact()->formattedName().isEmpty()) + cat = contact()->formattedName(); + else + cat = primaryName(); break; case Qt::ToolTipRole: cat = presenceMessage();