Implement reporting events
BUG: 458856
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
#include <jobs/downloadfilejob.h>
|
||||
#include <qt_connection_util.h>
|
||||
#include <user.h>
|
||||
#include <csapi/report_content.h>
|
||||
#include <events/eventcontent.h>
|
||||
|
||||
#include "controller.h"
|
||||
#include "neochatconfig.h"
|
||||
@@ -1082,3 +1084,13 @@ void NeoChatRoom::updatePushNotificationState(QString type)
|
||||
m_currentPushNotificationState = PushNotificationState::Default;
|
||||
Q_EMIT pushNotificationStateChanged(m_currentPushNotificationState);
|
||||
}
|
||||
|
||||
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]() {
|
||||
if (job->error() == BaseJob::Success) {
|
||||
Q_EMIT positiveMessage(i18n("Report sent successfully."));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ public:
|
||||
Q_INVOKABLE QString htmlSafeName() const;
|
||||
Q_INVOKABLE QString htmlSafeDisplayName() const;
|
||||
Q_INVOKABLE void clearInvitationNotification();
|
||||
Q_INVOKABLE void reportEvent(const QString &eventId, const QString &reason);
|
||||
|
||||
Q_INVOKABLE void setPushNotificationState(PushNotificationState::State state);
|
||||
|
||||
@@ -192,6 +193,7 @@ Q_SIGNALS:
|
||||
void isInviteChanged();
|
||||
void displayNameChanged();
|
||||
void pushNotificationStateChanged(PushNotificationState::State state);
|
||||
void positiveMessage(const QString &message);
|
||||
|
||||
public Q_SLOTS:
|
||||
void uploadFile(const QUrl &url, const QString &body = QString());
|
||||
|
||||
Reference in New Issue
Block a user