Fix notification receiver name.

This commit is contained in:
John Preston 2020-06-30 12:03:42 +04:00
parent 613a2f358a
commit 06c9e55c26

View file

@ -577,7 +577,17 @@ Manager::DisplayOptions Manager::GetNotificationOptions(HistoryItem *item) {
QString Manager::addTargetAccountName(
const QString &title,
not_null<Main::Session*> 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()