From 06c9e55c2609d39ea26fca4434f06c7ab839b2d3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 30 Jun 2020 12:03:42 +0400 Subject: [PATCH] Fix notification receiver name. --- .../SourceFiles/window/notifications_manager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index 9ab2fe0226..f9f78850f8 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -577,7 +577,17 @@ Manager::DisplayOptions Manager::GetNotificationOptions(HistoryItem *item) { QString Manager::addTargetAccountName( const QString &title, not_null session) { - return (Core::App().domain().accounts().size() > 1) + const auto add = [&] { + for (const auto &[index, account] : Core::App().domain().accounts()) { + if (const auto other = account->maybeSession()) { + if (other != session) { + return true; + } + } + } + return false; + }(); + return add ? (title + accountNameSeparator() + (session->user()->username.isEmpty()