Commit 0f09a0b5 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ChatModel): ignore CallStatusAcceptedElsewhere and CallStatusDeclinedElsewhere states

parent 6715a13e
...@@ -608,6 +608,10 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) { ...@@ -608,6 +608,10 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
case linphone::CallStatusEarlyAborted: case linphone::CallStatusEarlyAborted:
return; // Ignore aborted calls. return; // Ignore aborted calls.
case linphone::CallStatusAcceptedElsewhere:
case linphone::CallStatusDeclinedElsewhere:
return; // Ignore accepted calls on other device.
case linphone::CallStatusSuccess: case linphone::CallStatusSuccess:
case linphone::CallStatusMissed: case linphone::CallStatusMissed:
case linphone::CallStatusDeclined: case linphone::CallStatusDeclined:
...@@ -615,21 +619,21 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) { ...@@ -615,21 +619,21 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
} }
auto insertEntry = [this]( auto insertEntry = [this](
const ChatEntryData &pair, const ChatEntryData &pair,
const QList<ChatEntryData>::iterator *start = NULL const QList<ChatEntryData>::iterator *start = NULL
) { ) {
auto it = lower_bound(start ? *start : mEntries.begin(), mEntries.end(), pair, [](const ChatEntryData &a, const ChatEntryData &b) { auto it = lower_bound(start ? *start : mEntries.begin(), mEntries.end(), pair, [](const ChatEntryData &a, const ChatEntryData &b) {
return a.first["timestamp"] < b.first["timestamp"]; return a.first["timestamp"] < b.first["timestamp"];
}); });
int row = static_cast<int>(distance(mEntries.begin(), it)); int row = static_cast<int>(distance(mEntries.begin(), it));
beginInsertRows(QModelIndex(), row, row); beginInsertRows(QModelIndex(), row, row);
it = mEntries.insert(it, pair); it = mEntries.insert(it, pair);
endInsertRows(); endInsertRows();
return it; return it;
}; };
// Add start call. // Add start call.
QVariantMap start; QVariantMap start;
......
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