From de332421f783a94877b7b529a698e0752273e7a4 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 3 Aug 2023 16:12:05 +0200 Subject: [PATCH] more setting group state --- solanaceae/tox_contacts/tox_contact_model2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/solanaceae/tox_contacts/tox_contact_model2.cpp b/solanaceae/tox_contacts/tox_contact_model2.cpp index 89ee4c9..d035727 100644 --- a/solanaceae/tox_contacts/tox_contact_model2.cpp +++ b/solanaceae/tox_contacts/tox_contact_model2.cpp @@ -466,6 +466,14 @@ bool ToxContactModel2::onToxEvent(const Tox_Event_Group_Self_Join* e) { auto c = getContactGroupPeer(group_number, self_id_opt.value()); c.emplace_or_replace(); c.emplace_or_replace(Contact::Components::ConnectionState::State::direct); + + auto gc = getContactGroup(group_number); + assert(static_cast(gc)); // should be no failure mode + gc.emplace_or_replace( + _t.toxGroupIsConnected(group_number).value_or(false) + ? Contact::Components::ConnectionState::State::cloud + : Contact::Components::ConnectionState::State::disconnected + ); } else { assert(false); }