Commit 4b97a94d authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/sip-addresses/SipAddressesModel): use correct call timestamp

parent 4dbfd7c6
......@@ -338,7 +338,11 @@ void SipAddressesModel::initSipAddresses () {
QVariantMap map;
map["sipAddress"] = sip_address;
map["timestamp"] = QDateTime::fromMSecsSinceEpoch((call_log->getStartDate() + call_log->getDuration()) * 1000);
// The duration can be wrong if status is not success.
map["timestamp"] = call_log->getStatus() == linphone::CallStatus::CallStatusSuccess
? QDateTime::fromMSecsSinceEpoch((call_log->getStartDate() + call_log->getDuration()) * 1000)
: QDateTime::fromMSecsSinceEpoch(call_log->getStartDate() * 1000);
auto it = m_sip_addresses.find(sip_address);
if (it == m_sip_addresses.end() || map["timestamp"] > (*it)["timestamp"])
......
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