Skip to content

Commit

Permalink
add hack to copy the ngc chat id
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Dec 13, 2023
1 parent 1cdde51 commit 7495a50
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/chat_gui4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7495a50

Please sign in to comment.