diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index f36a07b..89f1765 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -154,11 +154,11 @@ void ChatGui4::render(void) { if (ImGui::BeginChild("message_log", {0, -100}, false, ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { - ImGui::Checkbox("show extra info", &_show_chat_extra_info); - if (ImGui::SmallButton("test")) { - _cr.emplace_or_replace(*_selected_contact, "tomato_v1_256.png"); - _cr.emplace_or_replace(*_selected_contact); - std::cout << "DEBUG: added AvatarFile comp to contact\n"; + if (ImGui::BeginMenu("debug")) { + ImGui::Checkbox("show extra info", &_show_chat_extra_info); + ImGui::Checkbox("show avatar transfers", &_show_chat_avatar_tf); + + ImGui::EndMenu(); } ImGui::EndMenuBar(); } @@ -466,7 +466,13 @@ void ChatGui4::renderMessageBodyText(Message3Registry& reg, const Message3 e) { } void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) { - if (reg.all_of(e) && reg.get(e).kind == 1) { + if ( + !_show_chat_avatar_tf + && ( + reg.all_of(e) + && reg.get(e).kind == 1 + ) + ) { // TODO: this looks ugly ImGui::TextDisabled("set avatar"); return; diff --git a/src/chat_gui4.hpp b/src/chat_gui4.hpp index 73b5739..df7d375 100644 --- a/src/chat_gui4.hpp +++ b/src/chat_gui4.hpp @@ -31,7 +31,8 @@ class ChatGui4 { // TODO: per contact std::string _text_input_buffer; - bool _show_chat_extra_info {true}; + bool _show_chat_extra_info {false}; + bool _show_chat_avatar_tf {false}; float TEXT_BASE_WIDTH {1}; float TEXT_BASE_HEIGHT {1}; diff --git a/src/settings_window.cpp b/src/settings_window.cpp index 4468120..e67e261 100644 --- a/src/settings_window.cpp +++ b/src/settings_window.cpp @@ -109,7 +109,7 @@ void SettingsWindow::render(void) { if (ImGui::BeginMenuBar()) { ImGui::Separator(); if (ImGui::BeginMenu("Settings")) { - if (ImGui::MenuItem("show settings window")) { + if (ImGui::MenuItem("settings window")) { _show_window = true; } ImGui::EndMenu(); diff --git a/src/tox_avatar_manager.cpp b/src/tox_avatar_manager.cpp index 8efa480..cd98ed5 100644 --- a/src/tox_avatar_manager.cpp +++ b/src/tox_avatar_manager.cpp @@ -140,14 +140,14 @@ void ToxAvatarManager::checkMsg(Message3Handle h) { const auto& file_info = h.get(); + const auto contact = h.get().c; + // TCS-2.2.4 if (file_info.total_size > 65536ul) { // TODO: mark handled? return; // too large } - const auto contact = h.get().c; - // TCS-2.2.10 if (file_info.file_list.empty() || file_info.file_list.front().file_name.empty() || file_info.total_size == 0) { // reset @@ -186,16 +186,18 @@ void ToxAvatarManager::checkMsg(Message3Handle h) { h.emplace_or_replace(); } else { - const auto& supposed_file_hash = h.get().id; - // check file id for existing hash if (std::filesystem::is_regular_file(file_path)) { + //const auto& supposed_file_hash = h.get().id; // load file // hash file //_t.toxHash(); + std::filesystem::remove(file_path); // hack, hard replace existing file } + std::cout << "TAM: accepted avatar ft\n"; + // if not already on disk _accept_queue.push_back(AcceptEntry{h, file_path}); }