From d8a7d9cbef6d90b6b15ffbf26bf43f5555dbaefd Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 10 Dec 2017 15:37:41 +0900 Subject: Enable sending requests for redaction to the server Closes #118 --- room.cpp | 7 +++++++ room.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/room.cpp b/room.cpp index 48486ab8..dfca6bde 100644 --- a/room.cpp +++ b/room.cpp @@ -23,6 +23,7 @@ #include "jobs/generated/banning.h" #include "jobs/generated/leaving.h" #include "jobs/generated/receipts.h" +#include "jobs/generated/redaction.h" #include "jobs/setroomstatejob.h" #include "events/simplestateevents.h" #include "events/roomavatarevent.h" @@ -671,6 +672,12 @@ void Room::unban(const QString& userId) connection()->callApi(id(), userId); } +void Room::redactEvent(const QString& eventId, const QString& reason) +{ + connection()->callApi( + id(), eventId, connection()->generateTxnId(), reason); +} + void Room::Private::dropDuplicateEvents(RoomEvents* events) const { // Collect all duplicate events at the end of the container diff --git a/room.h b/room.h index bef66b86..989692de 100644 --- a/room.h +++ b/room.h @@ -181,6 +181,8 @@ namespace QMatrixClient void kickMember(const QString& memberId, const QString& reason = {}); void ban(const QString& userId, const QString& reason = {}); void unban(const QString& userId); + void redactEvent(const QString& eventId, + const QString& reason = {}); /** Mark all messages in the room as read */ void markAllMessagesAsRead(); -- cgit v1.2.3