forked from Green-Sky/tomato
static asan and reorder forward/open
This commit is contained in:
parent
b48d7e3cfd
commit
b133c5f79f
@ -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)")
|
||||
|
@ -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 = {
|
||||
|
@ -1176,31 +1176,6 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
||||
if (o.all_of<ObjComp::F::SingleInfoLocal>()) {
|
||||
const auto& local_info = o.get<ObjComp::F::SingleInfoLocal>();
|
||||
if (!local_info.file_path.empty() && ImGui::BeginPopupContextItem("##file_c")) {
|
||||
if (o.all_of<ObjComp::F::TagLocalHaveAll>()) {
|
||||
if (ImGui::BeginMenu("forward")) {
|
||||
for (const auto& c : _cr.view<Contact::Components::TagBig>()) {
|
||||
// filter
|
||||
if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(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<ObjComp::F::SingleInfoLocal>().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<ObjComp::F::TagLocalHaveAll>())) {
|
||||
for (const auto& c : _cr.view<Contact::Components::TagBig>()) {
|
||||
// filter
|
||||
if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(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<ObjComp::F::SingleInfoLocal>().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());
|
||||
|
Loading…
Reference in New Issue
Block a user