From 2d96139d4aa108ac827a9d31aac2865dc8fbd439 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sun, 27 Oct 2024 15:09:06 +0100 Subject: [PATCH] prep message serl for file objects --- external/solanaceae_message_serializer | 2 +- src/chat_gui4.cpp | 7 ++++++- src/main_screen.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/external/solanaceae_message_serializer b/external/solanaceae_message_serializer index e574c4f7..f83026be 160000 --- a/external/solanaceae_message_serializer +++ b/external/solanaceae_message_serializer @@ -1 +1 @@ -Subproject commit e574c4f7798ab8529879fb9f58795ac3c346daf6 +Subproject commit f83026beed88ef344ce5f59ea369eef152742e68 diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index cfb6b2c9..832a16be 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -1048,6 +1048,11 @@ void ChatGui4::renderMessageBodyText(Message3Registry& reg, const Message3 e) { void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) { auto o = reg.get(e).o; + if (!o) { + ImGui::TextDisabled("file message missing file object!"); + return; + } + if ( !_show_chat_avatar_tf && ( @@ -1457,7 +1462,7 @@ void ChatGui4::pasteFile(const char* mime_type) { size_t data_size = 0; void* data = SDL_GetClipboardData(mime_type, &data_size); - std::cout << "CG: pasted image of size " << data_size << " mime " << mime_type << "\n"; + std::cout << "CG: pasted image of size: " << data_size << " mimetype: " << mime_type << "\n"; _sip.sendMemory( static_cast(data), data_size, diff --git a/src/main_screen.cpp b/src/main_screen.cpp index fbb02e34..d49a6c2c 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -20,7 +20,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme renderer(renderer_), conf(std::move(conf_)), rmm(cr), - msnj{cr, {}, {}}, + msnj{cr, os, {}, {}}, mts(rmm), sm(os), tc(save_path, save_password),