From 194751627ffd397e8881ce1777af0f8e33eefa30 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 25 Jul 2024 15:35:12 -0400 Subject: [PATCH] Don't display notifications for invite rooms Sometimes a ghost notification will appear, this is sometimes a stray m.room.invite notification we didn't handle or some other event. Let's outright reject all notifications from Invite-type rooms to prevent this from happening altogether. (cherry picked from commit 83c6ce0ace59b7221e5915fddc9bd78bca025915) --- src/notificationsmanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/notificationsmanager.cpp b/src/notificationsmanager.cpp index aa12d37ab..83a427695 100644 --- a/src/notificationsmanager.cpp +++ b/src/notificationsmanager.cpp @@ -110,6 +110,12 @@ void NotificationsManager::processNotificationJob(QPointer co } auto sender = room->member(notification["event"_ls]["sender"_ls].toString()); + // Don't display notifications for events in invited rooms + // This should prevent empty notifications from appearing when they shouldn't + if (room->joinState() == JoinState::Invite) { + continue; + } + QString body; if (notification["event"_ls]["type"_ls].toString() == "org.matrix.msc3381.poll.start"_ls) { body = notification["event"_ls]["content"_ls]["org.matrix.msc3381.poll.start"_ls]["question"_ls]["body"_ls].toString();