From 6da64712048fff812f86a2be4c57078a5f4e3201 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 1 Oct 2026 18:39:31 +0300 Subject: [PATCH] Apply task-scoped media preparation events to the shared Qt composer --- tools/chatgui/src/messagelist.cpp | 9 +++++++++ tools/chatgui/src/messagelist.h | 1 + 2 files changed, 10 insertions(+) diff --git a/tools/chatgui/src/messagelist.cpp b/tools/chatgui/src/messagelist.cpp index d746ab0a..9277a59a 100644 --- a/tools/chatgui/src/messagelist.cpp +++ b/tools/chatgui/src/messagelist.cpp @@ -1054,6 +1054,15 @@ void MessageList::requestDmMessages(const QString& channelId) { gui_bridge_post_uasync_fn(dm_messages_trampoline, req); } +void MessageList::onAttachmentPreparation(const uint8_t* data, int len) { + if (!data || len < 18 || len != 18 + data[0] || data[len - 1] > 2) { + DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "Invalid attachment preparation event bytes=%d", len); return; + } + int length = data[0]; + m_inputBar->updatePreparation(QString::fromUtf8((const char*)data + 1, length), + QByteArray((const char*)data + 1 + length, 16), data[len - 1]); +} + void MessageList::onDmMessages(const uint8_t* data, int len) { if (len < 3) return; uint8_t cl = data[0]; diff --git a/tools/chatgui/src/messagelist.h b/tools/chatgui/src/messagelist.h index 28855f67..883e5d4b 100644 --- a/tools/chatgui/src/messagelist.h +++ b/tools/chatgui/src/messagelist.h @@ -29,6 +29,7 @@ public: void updateMessageProgress(const QString& chId, int64_t msgId, int blocksDone, int numBlocks); void onAttachmentDownloaded(const QString& chId, int64_t msgId); void onDmMessages(const uint8_t* data, int len); + void onAttachmentPreparation(const uint8_t* data, int len); void onRadioTalk(quint64 groupId, quint64 srcNodeId, bool on); /* индикация говорящего */ signals: