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 () {
// Get sip addresses from calls.
QSet<QString> address_done;
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))
continue; // Already used.
......
......@@ -18,19 +18,11 @@ Rectangle {
property alias sipAddressColor: description.sipAddressColor
property alias usernameColor: description.usernameColor
// Can be a SipAddress object of SipAddressesModel or just a string.
property var sipAddress
property var _contact: Utils.isObject(sipAddress)
? sipAddress.contact
: SipAddressesModel.mapSipAddressToContact(sipAddress)
property var entry
property var _contact: entry.contact
// ---------------------------------------------------------------------------
function _getSipAddress () {
return item.sipAddress.sipAddress || item.sipAddress
}
color: 'transparent' // No color by default.
height: ContactStyle.height
......@@ -49,7 +41,7 @@ Rectangle {
Layout.preferredWidth: ContactStyle.contentHeight
image: _contact && _contact.vcard.avatar
presenceLevel: _contact ? _contact.presenceLevel : -1
username: LinphoneUtils.getContactUsername(_contact || _getSipAddress())
username: LinphoneUtils.getContactUsername(_contact || entry.sipAddress)
}
ContactDescription {
......@@ -57,7 +49,7 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
sipAddress: _getSipAddress()
sipAddress: entry.sipAddress
username: avatar.username
}
......
......@@ -104,7 +104,7 @@ SearchBox {
Contact {
Layout.fillHeight: true
Layout.fillWidth: true
sipAddress: $entry.sipAddress
entry: $entry
}
// ---------------------------------------------------------------------
......
......@@ -97,7 +97,7 @@ ColumnLayout {
? TimelineStyle.contact.backgroundColor.a
: TimelineStyle.contact.backgroundColor.b
)
sipAddress: $timelineEntry
entry: $timelineEntry
sipAddressColor: view.currentIndex === index
? TimelineStyle.contact.sipAddress.color.selected
: 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