From 0ee89e1b2b051447fb35e2e004c81727284eac37 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 15 Jul 2025 14:59:45 -0400 Subject: [PATCH] Show unable to decrypt events in the room list These were previously (unintentionally) filtered, but I wanted to add them because without showing and caching them my DMs look extremely out of order. And assuming that you get an unexpected "unable to decrypt" event, you would want that room to "shoot to the top" anyway. --- src/libneochat/eventhandler.cpp | 3 +++ src/libneochat/neochatroom.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/libneochat/eventhandler.cpp b/src/libneochat/eventhandler.cpp index adb936bf9..250102fed 100644 --- a/src/libneochat/eventhandler.cpp +++ b/src/libneochat/eventhandler.cpp @@ -448,6 +448,9 @@ QString EventHandler::getBody(const NeoChatRoom *room, const Quotient::RoomEvent [](const PollStartEvent &e) { return e.question(); }, + [](const EncryptedEvent &) { + return i18nc("@info In room list", "Encrypted event"); + }, i18n("Unknown event")); } diff --git a/src/libneochat/neochatroom.cpp b/src/libneochat/neochatroom.cpp index e83848091..e77bf2b41 100644 --- a/src/libneochat/neochatroom.cpp +++ b/src/libneochat/neochatroom.cpp @@ -359,9 +359,14 @@ const RoomEvent *NeoChatRoom::lastEvent(std::function f if (auto lastEvent = eventCast(event)) { return lastEvent; } + if (auto lastEvent = eventCast(event)) { return lastEvent; } + + if (auto lastEvent = eventCast(event)) { + return lastEvent; + } } if (m_cachedEvent != nullptr) {