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