Don't show room name in notification if equal to sender

This is the case for direct messages.
This commit is contained in:
Nicolas Fella
2020-11-25 02:01:18 +01:00
parent 619fc3907f
commit e5064dffe5

View File

@@ -34,7 +34,13 @@ void NotificationsManager::postNotification(const QString &roomid, const QString
QPixmap img;
img.convertFromImage(icon);
KNotification *notification = new KNotification("message");
notification->setTitle(i18n("%1 (%2)", sender, roomname));
if (sender == roomname) {
notification->setTitle(sender);
} else {
notification->setTitle(i18n("%1 (%2)", sender, roomname));
}
notification->setText(text.toHtmlEscaped());
notification->setPixmap(img);
notification->sendEvent();