Small notification improvements
Changed a check to use isDirectChat (which is a clearer indication of what we want.) I also made sure not to show the account name if you only have one, since that's just useless noise.
This commit is contained in:
@@ -216,12 +216,12 @@ void NotificationsManager::postNotification(NeoChatRoom *room,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
notification->setTitle(room->displayName());
|
||||||
|
|
||||||
QString entry;
|
QString entry;
|
||||||
if (sender == room->displayName()) {
|
if (room->isDirectChat()) {
|
||||||
notification->setTitle(sender);
|
|
||||||
entry = text.toHtmlEscaped();
|
entry = text.toHtmlEscaped();
|
||||||
} else {
|
} else {
|
||||||
notification->setTitle(room->displayName());
|
|
||||||
entry = i18n("%1: %2", sender, text.toHtmlEscaped());
|
entry = i18n("%1: %2", sender, text.toHtmlEscaped());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +253,9 @@ void NotificationsManager::postNotification(NeoChatRoom *room,
|
|||||||
notification->setReplyAction(std::move(replyAction));
|
notification->setReplyAction(std::move(replyAction));
|
||||||
}
|
}
|
||||||
|
|
||||||
notification->setHint(u"x-kde-origin-name"_s, room->localMember().id());
|
if (Controller::instance().accounts()->rowCount() > 1) {
|
||||||
|
notification->setHint(u"x-kde-origin-name"_s, room->localMember().id());
|
||||||
|
}
|
||||||
notification->sendEvent();
|
notification->sendEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +349,9 @@ void NotificationsManager::doPostInviteNotification(QPointer<NeoChatRoom> room)
|
|||||||
m_invitations.remove(room->id());
|
m_invitations.remove(room->id());
|
||||||
});
|
});
|
||||||
|
|
||||||
notification->setHint(u"x-kde-origin-name"_s, room->localMember().id());
|
if (Controller::instance().accounts()->rowCount() > 1) {
|
||||||
|
notification->setHint(u"x-kde-origin-name"_s, room->localMember().id());
|
||||||
|
}
|
||||||
|
|
||||||
notification->sendEvent();
|
notification->sendEvent();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user