diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2023-10-26 09:57:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 09:57:47 +0200 |
commit | 1512810303a19073a0df32a38b76537660a03b3c (patch) | |
tree | a3ab747606a732e4d8f1614af21d9365b9786489 /src/timeline | |
parent | 904d3f257ac7775ee3cde91b919b364824329061 (diff) | |
parent | bb971b057526c77af47181e2c956cb415c4e4bbc (diff) |
Merge pull request #1539 from Nheko-Reborn/issue1410
Add report message functionality
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 8 | ||||
-rw-r--r-- | src/timeline/TimelineModel.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index e8a0a507..aefdc860 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1607,6 +1607,14 @@ TimelineModel::redactAllFromUser(const QString &userid, const QString &reason) std::this_thread::sleep_for(std::chrono::milliseconds(50)); } } + +void +TimelineModel::reportEvent(const QString &eventId, const QString &reason, const int score) +{ + http::client()->report_event( + room_id_.toStdString(), eventId.toStdString(), reason.toStdString(), score); +} + void TimelineModel::redactEvent(const QString &id, const QString &reason) { diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h index 4ffd61ec..b9a48327 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h @@ -331,6 +331,8 @@ public: Q_INVOKABLE void showReadReceipts(const QString &id); Q_INVOKABLE void redactEvent(const QString &id, const QString &reason = ""); Q_INVOKABLE void redactAllFromUser(const QString &userid, const QString &reason = ""); + Q_INVOKABLE void + reportEvent(const QString &eventId, const QString &reason = {}, const int score = -50); Q_INVOKABLE int idToIndex(const QString &id) const; Q_INVOKABLE QString indexToId(int index) const; Q_INVOKABLE void openMedia(const QString &eventId); |