mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 14:33:10 -06:00
Wire everything up in the rs API
This commit is contained in:
parent
c393e47e7a
commit
efd92ac4f7
|
|
@ -271,6 +271,7 @@ type ClientRoomserverAPI interface {
|
||||||
roomID, eventID, reportingUserID, reason string,
|
roomID, eventID, reportingUserID, reason string,
|
||||||
score int64,
|
score int64,
|
||||||
) (int64, error)
|
) (int64, error)
|
||||||
|
QueryAdminEventReports(ctx context.Context, from, limit uint64, backwards bool, userID, roomID string) ([]QueryAdminEventReportsResponse, int64, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserRoomserverAPI interface {
|
type UserRoomserverAPI interface {
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,23 @@ type QueryServerBannedFromRoomResponse struct {
|
||||||
Banned bool `json:"banned"`
|
Banned bool `json:"banned"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type QueryAdminEventReportsResponse struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
Score int64 `json:"score"`
|
||||||
|
EventNID types.EventNID `json:"-"` // only used to query the state
|
||||||
|
RoomNID types.RoomNID `json:"-"` // only used to query the state
|
||||||
|
ReportingUserNID types.EventStateKeyNID `json:"-"` // only used in the DB
|
||||||
|
SenderNID types.EventStateKeyNID `json:"-"` // only used in the DB
|
||||||
|
RoomID string `json:"room_id"`
|
||||||
|
EventID string `json:"event_id"`
|
||||||
|
UserID string `json:"user_id"` // the user reporting the event
|
||||||
|
Reason string `json:"reason"`
|
||||||
|
Sender string `json:"sender"` // the user sending the reported event
|
||||||
|
CanonicalAlias string `json:"canonical_alias"`
|
||||||
|
RoomName string `json:"name"`
|
||||||
|
ReceivedTS spec.Timestamp `json:"received_ts"`
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalJSON stringifies the room ID and StateKeyTuple keys so they can be sent over the wire in HTTP API mode.
|
// MarshalJSON stringifies the room ID and StateKeyTuple keys so they can be sent over the wire in HTTP API mode.
|
||||||
func (r *QueryBulkStateContentResponse) MarshalJSON() ([]byte, error) {
|
func (r *QueryBulkStateContentResponse) MarshalJSON() ([]byte, error) {
|
||||||
se := make(map[string]string)
|
se := make(map[string]string)
|
||||||
|
|
|
||||||
|
|
@ -1104,3 +1104,8 @@ func (r *Queryer) QueryUserIDForSender(ctx context.Context, roomID spec.RoomID,
|
||||||
func (r *Queryer) RoomsWithACLs(ctx context.Context) ([]string, error) {
|
func (r *Queryer) RoomsWithACLs(ctx context.Context) ([]string, error) {
|
||||||
return r.DB.RoomsWithACLs(ctx)
|
return r.DB.RoomsWithACLs(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QueryAdminEventReports returns event reports given a filter.
|
||||||
|
func (r *Queryer) QueryAdminEventReports(ctx context.Context, from uint64, limit uint64, backwards bool, userID, roomID string) ([]api.QueryAdminEventReportsResponse, int64, error) {
|
||||||
|
return r.DB.QueryAdminEventReports(ctx, from, limit, backwards, userID, roomID)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue