Commit 65e53dee authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app):

  - use `asStringUriOnly` instead of `asString` to parse calls in `SipAddressesModel`
  - `Contact` component uses only a `SipAddress` object now
parent e361a6a6
...@@ -265,7 +265,7 @@ void SipAddressesModel::initSipAddresses () { ...@@ -265,7 +265,7 @@ void SipAddressesModel::initSipAddresses () {
// Get sip addresses from calls. // Get sip addresses from calls.
QSet<QString> address_done; QSet<QString> address_done;
for (const auto &call_log : core->getCallLogs()) { for (const auto &call_log : core->getCallLogs()) {
QString sip_address = ::Utils::linphoneStringToQString(call_log->getRemoteAddress()->asString()); QString sip_address = ::Utils::linphoneStringToQString(call_log->getRemoteAddress()->asStringUriOnly());
if (address_done.contains(sip_address)) if (address_done.contains(sip_address))
continue; // Already used. continue; // Already used.
......
...@@ -18,19 +18,11 @@ Rectangle { ...@@ -18,19 +18,11 @@ Rectangle {
property alias sipAddressColor: description.sipAddressColor property alias sipAddressColor: description.sipAddressColor
property alias usernameColor: description.usernameColor property alias usernameColor: description.usernameColor
// Can be a SipAddress object of SipAddressesModel or just a string. property var entry
property var sipAddress property var _contact: entry.contact
property var _contact: Utils.isObject(sipAddress)
? sipAddress.contact
: SipAddressesModel.mapSipAddressToContact(sipAddress)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function _getSipAddress () {
return item.sipAddress.sipAddress || item.sipAddress
}
color: 'transparent' // No color by default. color: 'transparent' // No color by default.
height: ContactStyle.height height: ContactStyle.height
...@@ -49,7 +41,7 @@ Rectangle { ...@@ -49,7 +41,7 @@ Rectangle {
Layout.preferredWidth: ContactStyle.contentHeight Layout.preferredWidth: ContactStyle.contentHeight
image: _contact && _contact.vcard.avatar image: _contact && _contact.vcard.avatar
presenceLevel: _contact ? _contact.presenceLevel : -1 presenceLevel: _contact ? _contact.presenceLevel : -1
username: LinphoneUtils.getContactUsername(_contact || _getSipAddress()) username: LinphoneUtils.getContactUsername(_contact || entry.sipAddress)
} }
ContactDescription { ContactDescription {
...@@ -57,7 +49,7 @@ Rectangle { ...@@ -57,7 +49,7 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
sipAddress: _getSipAddress() sipAddress: entry.sipAddress
username: avatar.username username: avatar.username
} }
......
...@@ -104,7 +104,7 @@ SearchBox { ...@@ -104,7 +104,7 @@ SearchBox {
Contact { Contact {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
sipAddress: $entry.sipAddress entry: $entry
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
......
...@@ -97,7 +97,7 @@ ColumnLayout { ...@@ -97,7 +97,7 @@ ColumnLayout {
? TimelineStyle.contact.backgroundColor.a ? TimelineStyle.contact.backgroundColor.a
: TimelineStyle.contact.backgroundColor.b : TimelineStyle.contact.backgroundColor.b
) )
sipAddress: $timelineEntry entry: $timelineEntry
sipAddressColor: view.currentIndex === index sipAddressColor: view.currentIndex === index
? TimelineStyle.contact.sipAddress.color.selected ? TimelineStyle.contact.sipAddress.color.selected
: TimelineStyle.contact.sipAddress.color.normal : TimelineStyle.contact.sipAddress.color.normal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment