From 7495a50723cf2e78bb81b79a81e92b529b311e92 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 13 Dec 2023 14:02:31 +0100 Subject: [PATCH] add hack to copy the ngc chat id --- src/chat_gui4.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index b1021969..31547d4e 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -6,6 +6,9 @@ #include #include +// HACK: remove them +#include +#include #include #include @@ -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(*_selected_contact)) { + if (ImGui::MenuItem("copy ngc chatid")) { + const auto& chat_id = _cr.get(*_selected_contact).chat_id.data; + const auto chat_id_str = bin2hex(std::vector{chat_id.begin(), chat_id.end()}); + ImGui::SetClipboardText(chat_id_str.c_str()); + } + } + ImGui::EndMenu(); } ImGui::EndMenuBar();