Move NeoChatRoom::showMessage to Controller

It doesn't fit into NeoChatRoom conceptually
This commit is contained in:
Tobias Fella
2024-06-18 22:10:02 +02:00
parent d76e44512e
commit e11c97cdc0
6 changed files with 81 additions and 63 deletions

View File

@@ -36,6 +36,7 @@
#include "chatbarcache.h"
#include "clipboard.h"
#include "controller.h"
#include "eventhandler.h"
#include "events/joinrulesevent.h"
#include "events/pollevent.h"
@@ -1346,10 +1347,9 @@ void NeoChatRoom::updatePushNotificationState(QString type)
void NeoChatRoom::reportEvent(const QString &eventId, const QString &reason)
{
auto job = connection()->callApi<ReportContentJob>(id(), eventId, -50, reason);
connect(job, &BaseJob::finished, this, [this, job]() {
connect(job, &BaseJob::finished, this, [job]() {
if (job->error() == BaseJob::Success) {
Q_EMIT showMessage(Positive, i18n("Report sent successfully."));
Q_EMIT showMessage(MessageType::Positive, i18n("Report sent successfully."));
Q_EMIT Controller::instance().showMessage(Controller::Positive, i18n("Report sent successfully."));
}
});
}