Honour history_visibility when backfilling (#990)

* Make backfill work for shared history visibility

* fetch missing state on backfill to remember snapshots correctly

* Fix gmsl to not mux in auth events into room state

* Whoops

* Linting
This commit is contained in:
Kegsay 2020-04-29 18:41:45 +01:00 committed by GitHub
parent 458b364781
commit 4ad52c67ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 195 additions and 52 deletions

View file

@ -16,7 +16,9 @@ package routing
import (
"context"
"encoding/json"
"net/http"
"time"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
@ -29,13 +31,20 @@ func GetEvent(
request *gomatrixserverlib.FederationRequest,
query api.RoomserverQueryAPI,
eventID string,
origin gomatrixserverlib.ServerName,
) util.JSONResponse {
event, err := getEvent(ctx, request, query, eventID)
if err != nil {
return *err
}
return util.JSONResponse{Code: http.StatusOK, JSON: event}
return util.JSONResponse{Code: http.StatusOK, JSON: gomatrixserverlib.Transaction{
Origin: origin,
OriginServerTS: gomatrixserverlib.AsTimestamp(time.Now()),
PDUs: []json.RawMessage{
event.JSON(),
},
}}
}
// getEvent returns the requested event,

View file

@ -126,7 +126,7 @@ func Setup(
return util.ErrorResponse(err)
}
return GetEvent(
httpReq.Context(), request, query, vars["eventID"],
httpReq.Context(), request, query, vars["eventID"], cfg.Matrix.ServerName,
)
},
)).Methods(http.MethodGet)