aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-10 15:37:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-10 16:22:27 +0900
commitd8a7d9cbef6d90b6b15ffbf26bf43f5555dbaefd (patch)
tree16f0d7c023ce6f9be626b11c0f54d9bdf470f003
parentdf7f9bd2c26ca67fb3d221f9d3a68e34fb25a235 (diff)
downloadlibquotient-d8a7d9cbef6d90b6b15ffbf26bf43f5555dbaefd.tar.gz
libquotient-d8a7d9cbef6d90b6b15ffbf26bf43f5555dbaefd.zip
Enable sending requests for redaction to the server
Closes #118
-rw-r--r--room.cpp7
-rw-r--r--room.h2
2 files changed, 9 insertions, 0 deletions
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<UnbanJob>(id(), userId);
}
+void Room::redactEvent(const QString& eventId, const QString& reason)
+{
+ connection()->callApi<RedactEventJob>(
+ 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();