mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 05:12:46 +00:00
MSC2836 threading: part 2 (#1596)
* Update GMSL * Add MSC2836EventRelationships to fedsender * Call MSC2836EventRelationships in reqCtx * auth remote servers * Extract room ID and servers from previous events; refactor a bit * initial cut of federated threading * Use the right client/fed struct in the response * Add QueryAuthChain for use with MSC2836 * Add auth chain to federated response * Fix pointers * under CI: more logging and enable mscs, nil fix * Handle direction: up * Actually send message events to the roomserver.. * Add children and children_hash to unsigned, with tests * Add logic for exploring threads and tracking children; missing storage functions * Implement storage functions for children * Add fetchUnknownEvent * Do federated hits for include_children if we have unexplored children * Use /ev_rel rather than /event as the former includes child metadata * Remove cross-room threading impl * Enable MSC2836 in the p2p demo * Namespace mscs db * Enable msc2836 for ygg Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
c052edafdd
commit
b507312d4c
21 changed files with 896 additions and 252 deletions
|
@ -132,6 +132,15 @@ type RoomserverInternalAPI interface {
|
|||
response *QueryStateAndAuthChainResponse,
|
||||
) error
|
||||
|
||||
// QueryAuthChain returns the entire auth chain for the event IDs given.
|
||||
// The response includes the events in the request.
|
||||
// Omits without error for any missing auth events. There will be no duplicates.
|
||||
QueryAuthChain(
|
||||
ctx context.Context,
|
||||
request *QueryAuthChainRequest,
|
||||
response *QueryAuthChainResponse,
|
||||
) error
|
||||
|
||||
// QueryCurrentState retrieves the requested state events. If state events are not found, they will be missing from
|
||||
// the response.
|
||||
QueryCurrentState(ctx context.Context, req *QueryCurrentStateRequest, res *QueryCurrentStateResponse) error
|
||||
|
|
|
@ -324,6 +324,16 @@ func (t *RoomserverInternalAPITrace) QueryServerBannedFromRoom(ctx context.Conte
|
|||
return err
|
||||
}
|
||||
|
||||
func (t *RoomserverInternalAPITrace) QueryAuthChain(
|
||||
ctx context.Context,
|
||||
request *QueryAuthChainRequest,
|
||||
response *QueryAuthChainResponse,
|
||||
) error {
|
||||
err := t.Impl.QueryAuthChain(ctx, request, response)
|
||||
util.GetLogger(ctx).WithError(err).Infof("QueryAuthChain req=%+v res=%+v", js(request), js(response))
|
||||
return err
|
||||
}
|
||||
|
||||
func js(thing interface{}) string {
|
||||
b, err := json.Marshal(thing)
|
||||
if err != nil {
|
||||
|
|
|
@ -275,6 +275,14 @@ type QueryPublishedRoomsResponse struct {
|
|||
RoomIDs []string
|
||||
}
|
||||
|
||||
type QueryAuthChainRequest struct {
|
||||
EventIDs []string
|
||||
}
|
||||
|
||||
type QueryAuthChainResponse struct {
|
||||
AuthChain []*gomatrixserverlib.HeaderedEvent
|
||||
}
|
||||
|
||||
type QuerySharedUsersRequest struct {
|
||||
UserID string
|
||||
ExcludeRoomIDs []string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue