From c134861cd9e3bd38cb567461ed689ae8a25c0daa Mon Sep 17 00:00:00 2001
From: Ilya Fedin <fedin-ilja2010@ya.ru>
Date: Thu, 29 Dec 2022 05:03:40 +0400
Subject: [PATCH] Have notification subtitle in title on Linux when body-markup
 is not supported

This makes it look way better
---
 .../linux/notifications_manager_linux.cpp     | 23 ++++++++++---------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
index 93c6aaf1d..2184fcecd 100644
--- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp
@@ -385,12 +385,12 @@ bool NotificationData::init(
 		const QString &msg,
 		Window::Notifications::Manager::DisplayOptions options) {
 	if (_application) {
-		_notification = Gio::Notification::create(title.toStdString());
-
-		_notification->set_body(
+		_notification = Gio::Notification::create(
 			subtitle.isEmpty()
-				? msg.toStdString()
-				: u"%1\n%2"_q.arg(subtitle, msg).toStdString());
+				? title.toStdString()
+				: subtitle.toStdString() + " (" + title.toStdString() + ')');
+
+		_notification->set_body(msg.toStdString());
 
 		_notification->set_icon(
 			Gio::ThemedIcon::create(base::IconName().toStdString()));
@@ -500,19 +500,22 @@ bool NotificationData::init(
 		});
 	};
 
-	_title = title.toStdString();
 	_imageKey = GetImageKey(CurrentServerInformationValue().specVersion);
 
 	if (capabilities.contains(u"body-markup"_q)) {
+		_title = title.toStdString();
+
 		_body = subtitle.isEmpty()
 			? msg.toHtmlEscaped().toStdString()
 			: u"<b>%1</b>\n%2"_q.arg(
 				subtitle.toHtmlEscaped(),
 				msg.toHtmlEscaped()).toStdString();
 	} else {
-		_body = subtitle.isEmpty()
-			? msg.toStdString()
-			: u"%1\n%2"_q.arg(subtitle, msg).toStdString();
+		_title = subtitle.isEmpty()
+			? title.toStdString()
+			: subtitle.toStdString() + " (" + title.toStdString() + ')';
+
+		_body = msg.toStdString();
 	}
 
 	if (capabilities.contains("actions")) {
@@ -820,8 +823,6 @@ bool ByDefault() {
 	static const auto NeededCapabilities = {
 		// To show message content
 		u"body"_q,
-		// To make the sender name bold
-		u"body-markup"_q,
 		// To have buttons on notifications
 		u"actions"_q,
 		// To have quick reply