diff --git a/external/solanaceae_contact b/external/solanaceae_contact index 5adf5bf..fdbe643 160000 --- a/external/solanaceae_contact +++ b/external/solanaceae_contact @@ -1 +1 @@ -Subproject commit 5adf5bf9dae2790f33181b27db454a95089c2492 +Subproject commit fdbe643958969a4a8a3128a144ce29f2c951bc5f diff --git a/external/solanaceae_tox b/external/solanaceae_tox index 91ae067..83367b2 160000 --- a/external/solanaceae_tox +++ b/external/solanaceae_tox @@ -1 +1 @@ -Subproject commit 91ae0671b0d31276d4fa6495c28db1c3a0bd67eb +Subproject commit 83367b2d2ee203807cd569189278dc3bb222c5ab diff --git a/src/chat_gui/contact_list.cpp b/src/chat_gui/contact_list.cpp index 70ecc69..7ca1d2d 100644 --- a/src/chat_gui/contact_list.cpp +++ b/src/chat_gui/contact_list.cpp @@ -1,6 +1,7 @@ #include "./contact_list.hpp" #include +#include #include #include #include @@ -325,6 +326,7 @@ bool renderContactList( ) { bool selection_changed {false}; for (const Contact4 cv : view) { + ImGui::PushID(entt::to_integral(cv)); ContactHandle4 c{cr, cv}; const bool selected = selected_c == c; @@ -342,6 +344,36 @@ bool renderContactList( selected_c = c; selection_changed = true; } + + // TODO: move to own function + if (ImGui::BeginPopupContextItem("contact_context")) { + if (c.all_of()) { + const auto& cm = c.get(); + // TODO: make hookable + if (ImGui::BeginMenu("invite to")) { + // big? + //for (const auto& c : cr.view()) { + // // filter + // if (cr.any_of(c)) { + // continue; + // } + for (auto [tov] : cr.storage().each()) { + if (cm->canInvite(c, tov)) { + ContactHandle4 to{cr, tov}; + + if (renderContactBig(th, contact_tc, to, 1, false, true, false)) { + // TODO: error check + cm->invite(c, tov); + } + } + } + ImGui::EndMenu(); + } + } + + ImGui::EndPopup(); + } + ImGui::PopID(); } return selection_changed; }