Remove unneeded parameter
This commit is contained in:
@@ -31,12 +31,7 @@ NotificationsManager::NotificationsManager(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void NotificationsManager::postNotification(NeoChatRoom *room,
|
||||
const QString &roomName,
|
||||
const QString &sender,
|
||||
const QString &text,
|
||||
const QImage &icon,
|
||||
const QString &replyEventId)
|
||||
void NotificationsManager::postNotification(NeoChatRoom *room, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId)
|
||||
{
|
||||
if (!NeoChatConfig::self()->showNotifications()) {
|
||||
return;
|
||||
@@ -46,10 +41,10 @@ void NotificationsManager::postNotification(NeoChatRoom *room,
|
||||
img.convertFromImage(icon);
|
||||
KNotification *notification = new KNotification("message");
|
||||
|
||||
if (sender == roomName) {
|
||||
if (sender == room->displayName()) {
|
||||
notification->setTitle(sender);
|
||||
} else {
|
||||
notification->setTitle(i18n("%1 (%2)", sender, roomName));
|
||||
notification->setTitle(i18n("%1 (%2)", sender, room->displayName()));
|
||||
}
|
||||
|
||||
notification->setText(text.toHtmlEscaped());
|
||||
|
||||
@@ -19,8 +19,7 @@ class NotificationsManager : public QObject
|
||||
public:
|
||||
static NotificationsManager &instance();
|
||||
|
||||
Q_INVOKABLE void
|
||||
postNotification(NeoChatRoom *room, const QString &roomName, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId);
|
||||
Q_INVOKABLE void postNotification(NeoChatRoom *room, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId);
|
||||
void postInviteNotification(NeoChatRoom *room, const QString &title, const QString &sender, const QImage &icon);
|
||||
|
||||
private:
|
||||
|
||||
@@ -236,7 +236,6 @@ void RoomListModel::handleNotifications()
|
||||
avatar_image = room->avatar(128);
|
||||
}
|
||||
NotificationsManager::instance().postNotification(dynamic_cast<NeoChatRoom *>(room),
|
||||
room->displayName(),
|
||||
sender->displayname(room),
|
||||
notification["event"].toObject()["content"].toObject()["body"].toString(),
|
||||
avatar_image,
|
||||
|
||||
Reference in New Issue
Block a user