aboutsummaryrefslogtreecommitdiff
path: root/roomserver/api/output.go
diff options
context:
space:
mode:
authorNeil <neilalexanderr@gmail.com>2023-01-19 20:02:32 +0000
committerGitHub <noreply@github.com>2023-01-19 21:02:32 +0100
commit738686ae686004c5efa9fe2096502cdc426c6dd8 (patch)
treee5c8e31aea47167be61aa326982ad9db1a00c15e /roomserver/api/output.go
parent67f5c5bc1e837bbdee14d7d3388984ed8960528a (diff)
Add `/_dendrite/admin/purgeRoom/{roomID}` (#2662)
This adds a new admin endpoint `/_dendrite/admin/purgeRoom/{roomID}`. It completely erases all database entries for a given room ID. The roomserver will start by clearing all data for that room and then will generate an output event to notify downstream components (i.e. the sync API and federation API) to do the same. It does not currently clear media and it is currently not implemented for SQLite since it relies on SQL array operations right now. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> Co-authored-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
Diffstat (limited to 'roomserver/api/output.go')
-rw-r--r--roomserver/api/output.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/roomserver/api/output.go b/roomserver/api/output.go
index 36d0625c..0c0f52c4 100644
--- a/roomserver/api/output.go
+++ b/roomserver/api/output.go
@@ -55,6 +55,8 @@ const (
OutputTypeNewInboundPeek OutputType = "new_inbound_peek"
// OutputTypeRetirePeek indicates that the kafka event is an OutputRetirePeek
OutputTypeRetirePeek OutputType = "retire_peek"
+ // OutputTypePurgeRoom indicates the event is an OutputPurgeRoom
+ OutputTypePurgeRoom OutputType = "purge_room"
)
// An OutputEvent is an entry in the roomserver output kafka log.
@@ -78,6 +80,8 @@ type OutputEvent struct {
NewInboundPeek *OutputNewInboundPeek `json:"new_inbound_peek,omitempty"`
// The content of event with type OutputTypeRetirePeek
RetirePeek *OutputRetirePeek `json:"retire_peek,omitempty"`
+ // The content of the event with type OutputPurgeRoom
+ PurgeRoom *OutputPurgeRoom `json:"purge_room,omitempty"`
}
// Type of the OutputNewRoomEvent.
@@ -257,3 +261,7 @@ type OutputRetirePeek struct {
UserID string
DeviceID string
}
+
+type OutputPurgeRoom struct {
+ RoomID string
+}