diff --git a/src/controller.cpp b/src/controller.cpp index 4c54896a7..bc4445b58 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -168,7 +168,6 @@ void Controller::addConnection(NeoChatConnection *c) connect(c, &NeoChatConnection::syncDone, this, [this, c]() { m_notificationsManager.handleNotifications(c); }); - connect(c, &NeoChatConnection::showInviteNotification, &m_notificationsManager, &NotificationsManager::postInviteNotification); c->sync(); diff --git a/src/neochatconnection.cpp b/src/neochatconnection.cpp index 74dd8a4e2..cd14f8ce8 100644 --- a/src/neochatconnection.cpp +++ b/src/neochatconnection.cpp @@ -109,10 +109,6 @@ void NeoChatConnection::connectSignals() Q_EMIT homeHaveHighlightNotificationsChanged(); }); }); - connect(this, &NeoChatConnection::invitedRoom, this, [this](Quotient::Room *room) { - auto r = dynamic_cast(room); - connect(r, &NeoChatRoom::showInviteNotification, this, &NeoChatConnection::showInviteNotification); - }); connect(this, &NeoChatConnection::leftRoom, this, [this](Room *room, Room *prev) { Q_UNUSED(room) if (prev && prev->isDirectChat()) { diff --git a/src/neochatconnection.h b/src/neochatconnection.h index 79054994c..06c5cfccc 100644 --- a/src/neochatconnection.h +++ b/src/neochatconnection.h @@ -205,11 +205,6 @@ Q_SIGNALS: */ void errorOccured(const QString &error); - /** - * @brief Request a notification be shown for an invite to this room. - */ - void showInviteNotification(NeoChatRoom *room); - private: bool m_isOnline = true; void setIsOnline(bool isOnline); diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index d8ef7aac0..c82b8e777 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -124,9 +124,6 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS updatePushNotificationState(QStringLiteral("m.push_rules")); Q_EMIT canEncryptRoomChanged(); - if (this->joinState() == JoinState::Invite) { - Q_EMIT showInviteNotification(this); - } }, Qt::SingleShotConnection); connect(this, &Room::changed, this, [this] { diff --git a/src/neochatroom.h b/src/neochatroom.h index 849ca5707..76ffb7944 100644 --- a/src/neochatroom.h +++ b/src/neochatroom.h @@ -654,14 +654,6 @@ Q_SIGNALS: */ void showMessage(MessageType::Type messageType, const QString &message); - /** - * @brief Request a notification be shown for an invite to this room. - * - * @note This may later be blocked if there are any rules on where invites can - * come from, but this is not NeoChatRoom's responsibility. - */ - void showInviteNotification(NeoChatRoom *room); - public Q_SLOTS: /** * @brief Upload a file to the matrix server and post the file to the room. diff --git a/src/notificationsmanager.cpp b/src/notificationsmanager.cpp index ebe17f2a4..dcef8f7a9 100644 --- a/src/notificationsmanager.cpp +++ b/src/notificationsmanager.cpp @@ -127,9 +127,8 @@ void NotificationsManager::processNotificationJob(QPointer co } auto sender = room->member(notification["event"_ls]["sender"_ls].toString()); - // Don't display notifications for events in invited rooms - // This should prevent empty notifications from appearing when they shouldn't if (room->joinState() == JoinState::Invite) { + postInviteNotification(qobject_cast(room)); continue; }