mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Roomserver API changes (#1118)
* s/QueryBackfill/PerformBackfill/g * OutputEvent now includes AddStateEvents which contain the full event of extra state events * Only include adds not the current event * Get adding state right
This commit is contained in:
parent
25cd2dd1c9
commit
ec7718e7f8
17 changed files with 152 additions and 287 deletions
|
@ -18,7 +18,6 @@ package api
|
|||
|
||||
import (
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
)
|
||||
|
||||
// QueryLatestEventsAndStateRequest is a request to QueryLatestEventsAndState
|
||||
|
@ -204,34 +203,6 @@ type QueryStateAndAuthChainResponse struct {
|
|||
AuthChainEvents []gomatrixserverlib.HeaderedEvent `json:"auth_chain_events"`
|
||||
}
|
||||
|
||||
// QueryBackfillRequest is a request to QueryBackfill.
|
||||
type QueryBackfillRequest struct {
|
||||
// The room to backfill
|
||||
RoomID string `json:"room_id"`
|
||||
// A map of backwards extremity event ID to a list of its prev_event IDs.
|
||||
BackwardsExtremities map[string][]string `json:"backwards_extremities"`
|
||||
// The maximum number of events to retrieve.
|
||||
Limit int `json:"limit"`
|
||||
// The server interested in the events.
|
||||
ServerName gomatrixserverlib.ServerName `json:"server_name"`
|
||||
}
|
||||
|
||||
// PrevEventIDs returns the prev_event IDs of all backwards extremities, de-duplicated in a lexicographically sorted order.
|
||||
func (r *QueryBackfillRequest) PrevEventIDs() []string {
|
||||
var prevEventIDs []string
|
||||
for _, pes := range r.BackwardsExtremities {
|
||||
prevEventIDs = append(prevEventIDs, pes...)
|
||||
}
|
||||
prevEventIDs = util.UniqueStrings(prevEventIDs)
|
||||
return prevEventIDs
|
||||
}
|
||||
|
||||
// QueryBackfillResponse is a response to QueryBackfill.
|
||||
type QueryBackfillResponse struct {
|
||||
// Missing events, arbritrary order.
|
||||
Events []gomatrixserverlib.HeaderedEvent `json:"events"`
|
||||
}
|
||||
|
||||
// QueryRoomVersionCapabilitiesRequest asks for the default room version
|
||||
type QueryRoomVersionCapabilitiesRequest struct{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue