diff --git a/solanaceae/tox_contacts/tox_contact_model2.cpp b/solanaceae/tox_contacts/tox_contact_model2.cpp index 557cb72..d727c3d 100644 --- a/solanaceae/tox_contacts/tox_contact_model2.cpp +++ b/solanaceae/tox_contacts/tox_contact_model2.cpp @@ -196,7 +196,17 @@ Contact3Handle ToxContactModel2::getContactFriend(uint32_t friend_number) { } if (!_cr.all_of(c)) { - _cr.emplace_or_replace(c, std::min(_cr.get(c).ts, ts)); + if (_cr.all_of(c)) { + _cr.emplace_or_replace(c, + std::min( + _cr.get(c).ts, + ts + ) + ); + } else { + // TODO: did we? + _cr.emplace_or_replace(c, ts); + } } std::cout << "TCM2: created friend contact " << friend_number << "\n";