From 86ac99004d170dee622fefc7f7bcebb5bb11d562 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sun, 1 Nov 2020 21:58:22 +0100 Subject: [PATCH] Notifications: disable previewBody/Summary for now, update README --- README.md | 2 +- src/notificationmanager.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c6b6db..fd87b4e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Sebastian J. Wolf [sebastian@ygriega.de](mailto:sebastian@ygriega.de) and severa Fernschreiber wouldn't be the same without all the people helping in making it better. Thank you very much to all contributors! ### Code (Features, Bugfixes, Optimizations etc.) -- Chat list model, TDLib receiver, project dependencies: [Slava Monich](https://github.com/monich) +- Chat list model, notifications, TDLib receiver, project dependencies: [Slava Monich](https://github.com/monich) - Chat info page, performance improvements to chat page, location support, app initialization/registration with Telegram, project dependencies: [jgibbon](https://github.com/jgibbon) - Copy message to clipboard [Christian Stemmle](https://github.com/chstem) diff --git a/src/notificationmanager.cpp b/src/notificationmanager.cpp index e2ad90a..d80c939 100644 --- a/src/notificationmanager.cpp +++ b/src/notificationmanager.cpp @@ -378,8 +378,16 @@ void NotificationManager::publishNotification(const NotificationGroup *notificat nemoNotification->setSummary(chatInformation ? chatInformation->title : QString()); if (needFeedback) { nemoNotification->setCategory(NOTIFICATION_CATEGORY); - nemoNotification->setPreviewBody(nemoNotification->body()); - nemoNotification->setPreviewSummary(nemoNotification->summary()); + + // Setting preview body & summary to a non-empty string causes a notification popup, + // no matter if we are in the current chat, in the app or not. That might be annoying + // In the future, we can show this popup depending if the app/chat is open or not + // + // nemoNotification->setPreviewBody(nemoNotification->body()); + // nemoNotification->setPreviewSummary(nemoNotification->summary()); + + nemoNotification->setPreviewBody(QString()); + nemoNotification->setPreviewSummary(QString()); ngfClient->play(NGF_EVENT); } else { nemoNotification->setCategory(QString());