diff options
author | Kegsay <kegan@matrix.org> | 2020-12-04 14:11:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 14:11:01 +0000 |
commit | b507312d4cf9d35b5d4eaaa01a7f74d095b825f8 (patch) | |
tree | 2812bd7453da07a3c2850fb0b27a740c950af212 /roomserver/inthttp/server.go | |
parent | c052edafdd765d821f9732add4f5d33962ba5ba4 (diff) |
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>
Diffstat (limited to 'roomserver/inthttp/server.go')
-rw-r--r-- | roomserver/inthttp/server.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index ac1fc25b..f9c8ef9f 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -452,4 +452,17 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) + internalAPIMux.Handle(RoomserverQueryAuthChainPath, + httputil.MakeInternalAPI("queryAuthChain", func(req *http.Request) util.JSONResponse { + request := api.QueryAuthChainRequest{} + response := api.QueryAuthChainResponse{} + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.MessageResponse(http.StatusBadRequest, err.Error()) + } + if err := r.QueryAuthChain(req.Context(), &request, &response); err != nil { + return util.ErrorResponse(err) + } + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) } |