add hack to copy the ngc chat id

This commit is contained in:
Green Sky 2023-12-13 14:02:31 +01:00
parent 1cdde5170b
commit 7495a50723
No known key found for this signature in database

View File

@ -6,6 +6,9 @@
#include <solanaceae/tox_messages/components.hpp>
#include <solanaceae/contact/components.hpp>
// HACK: remove them
#include <solanaceae/tox_contacts/components.hpp>
#include <solanaceae/toxcore/utils.hpp>
#include <imgui/imgui.h>
#include <imgui/misc/cpp/imgui_stdlib.h>
@ -158,6 +161,16 @@ void ChatGui4::render(void) {
ImGui::Checkbox("show extra info", &_show_chat_extra_info);
ImGui::Checkbox("show avatar transfers", &_show_chat_avatar_tf);
ImGui::SeparatorText("tox");
if (_cr.all_of<Contact::Components::ToxGroupPersistent>(*_selected_contact)) {
if (ImGui::MenuItem("copy ngc chatid")) {
const auto& chat_id = _cr.get<Contact::Components::ToxGroupPersistent>(*_selected_contact).chat_id.data;
const auto chat_id_str = bin2hex(std::vector<uint8_t>{chat_id.begin(), chat_id.end()});
ImGui::SetClipboardText(chat_id_str.c_str());
}
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();