diff --git a/CMakeLists.txt b/CMakeLists.txt index 709b5834..0f84236b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ if (TOMATO_ASAN) #link_libraries(-fsanitize=address) link_libraries(-fsanitize=address,undefined) #link_libraries(-fsanitize=undefined) + link_libraries(-static-libasan) # make it "work" on nix message("II enabled ASAN") else() message("!! can not enable ASAN on this platform (gcc/clang + win)") diff --git a/flake.nix b/flake.nix index b5985b84..f0e95401 100644 --- a/flake.nix +++ b/flake.nix @@ -139,7 +139,10 @@ pkg-config ]; - shellHook = "echo hello to tomato dev shell!"; + shellHook = '' + echo hello to tomato dev shell! + export LD_LIBRARY_PATH=/run/opengl-driver/lib + ''; }; apps.default = { diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index 9ae85ac6..b0de4269 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -1176,31 +1176,6 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) { if (o.all_of()) { const auto& local_info = o.get(); if (!local_info.file_path.empty() && ImGui::BeginPopupContextItem("##file_c")) { - if (o.all_of()) { - if (ImGui::BeginMenu("forward")) { - for (const auto& c : _cr.view()) { - // filter - if (_cr.any_of(c)) { - continue; - } - // TODO: check for contact capability - // or just error popup?/noti/toast - - if (renderContactBig(_theme, _contact_tc, {_cr, c}, 1, false, true, false)) { - // TODO: try object interface first instead, then fall back to send with SingleInfoLocal - //_rmm.sendFileObj(c, o); - std::filesystem::path path = o.get().file_path; - _rmm.sendFilePath(c, path.filename().generic_u8string(), path.generic_u8string()); - } - } - ImGui::EndMenu(); - } - } else { - ImGui::TextDisabled("forward"); - } - - ImGui::Separator(); - if (ImGui::MenuItem("open")) { const std::string url {file_path_to_file_url(local_info.file_path)}; std::cout << "opening file '" << url << "'\n"; @@ -1209,6 +1184,27 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) { ImGui::Separator(); + if (ImGui::BeginMenu("forward", o.all_of())) { + for (const auto& c : _cr.view()) { + // filter + if (_cr.any_of(c)) { + continue; + } + // TODO: check for contact capability + // or just error popup?/noti/toast + + if (renderContactBig(_theme, _contact_tc, {_cr, c}, 1, false, true, false)) { + // TODO: try object interface first instead, then fall back to send with SingleInfoLocal + //_rmm.sendFileObj(c, o); + std::filesystem::path path = o.get().file_path; + _rmm.sendFilePath(c, path.filename().generic_u8string(), path.generic_u8string()); + } + } + ImGui::EndMenu(); + } + + ImGui::Separator(); + if (ImGui::MenuItem("copy file")) { const std::string url {file_path_to_file_url(local_info.file_path)}; //ImGui::SetClipboardText(url.c_str());