From e88f3ce46a89bc9f27eda0839e03982e96c237bd Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 26 Oct 2026 21:33:56 +0100 Subject: [PATCH] Finish PM composer cleanup and skip history requests after shutdown --- tools/chatgui/src/inputbar.cpp | 2 ++ tools/chatgui/src/messagelist.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/chatgui/src/inputbar.cpp b/tools/chatgui/src/inputbar.cpp index b4e82103..03702057 100644 --- a/tools/chatgui/src/inputbar.cpp +++ b/tools/chatgui/src/inputbar.cpp @@ -495,6 +495,8 @@ void InputBar::forgetDmHistory(const QString& target, quint64 generation) { m_pttActive = false; if (m_recorder && m_recorder->isRecording()) m_recorder->stopRecording(); m_recordTarget.clear(); m_recordReply.clear(); m_recordDmGeneration = 0; + m_pttBtn->setStyleSheet("QPushButton { border: none; border-radius: 4px; background: transparent; }" + "QPushButton:hover { background: palette(light); }"); } if (m_channelIdForRecord == target && m_dmGeneration == generation) { ++m_attachmentContext; clearPendingAttachment(); clearReply(); m_input->clear(); diff --git a/tools/chatgui/src/messagelist.cpp b/tools/chatgui/src/messagelist.cpp index 1f1c5bc6..afcc8923 100644 --- a/tools/chatgui/src/messagelist.cpp +++ b/tools/chatgui/src/messagelist.cpp @@ -1493,6 +1493,9 @@ QString MessageList::dmConvId(const QString& channelId) { void MessageList::requestDmMessages(const QString& channelId) { if (!m_currentDmGeneration || m_dmDeleting.value(dmConvId(channelId)) == m_currentDmGeneration) return; + if (!gui_bridge_get_inst() || !gui_bridge_is_uasync_ready()) { + GUI_WARN("PM history request skipped: core unavailable target=%s", qPrintable(channelId)); return; + } QString conv = dmConvId(channelId); struct dm_messages_req* req = (struct dm_messages_req*)u_malloc(sizeof(*req)); if (!req) return;