mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
Bump dependencies
This commit is contained in:
parent
8b0f60a470
commit
404f064790
2
vendor/manifest
vendored
2
vendor/manifest
vendored
|
|
@ -148,7 +148,7 @@
|
||||||
{
|
{
|
||||||
"importpath": "github.com/matrix-org/gomatrixserverlib",
|
"importpath": "github.com/matrix-org/gomatrixserverlib",
|
||||||
"repository": "https://github.com/matrix-org/gomatrixserverlib",
|
"repository": "https://github.com/matrix-org/gomatrixserverlib",
|
||||||
"revision": "677bbe93ffc9ad9ba5de615cd81185d0493f5d25",
|
"revision": "1c2cbc0872f0b2f19929dd70d22f77486078641e",
|
||||||
"branch": "master"
|
"branch": "master"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package gomatrixserverlib
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
@ -170,3 +171,33 @@ func (ac *FederationClient) LookupRoomAlias(
|
||||||
err = ac.doRequest(ctx, req, &res)
|
err = ac.doRequest(ctx, req, &res)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Backfill asks a homeserver for events early enough for them to not be in the
|
||||||
|
// local database.
|
||||||
|
// See https://matrix.org/docs/spec/server_server/unstable.html#get-matrix-federation-v1-backfill-roomid
|
||||||
|
func (ac *FederationClient) Backfill(
|
||||||
|
ctx context.Context, s ServerName, roomID string, limit int, eventIDs []string,
|
||||||
|
) (res Transaction, err error) {
|
||||||
|
// Encode the room ID so it won't interfer with the path.
|
||||||
|
roomID = url.PathEscape(roomID)
|
||||||
|
|
||||||
|
// Parse the limit into a string so that we can include it in the URL's query.
|
||||||
|
limitStr := strconv.Itoa(limit)
|
||||||
|
|
||||||
|
// Define the URL's query.
|
||||||
|
query := url.Values{}
|
||||||
|
query["v"] = eventIDs
|
||||||
|
query.Set("limit", limitStr)
|
||||||
|
|
||||||
|
// Use the url.URL structure to easily generate the request's URI (path?query).
|
||||||
|
u := url.URL{
|
||||||
|
Path: "/_matrix/federation/v1/backfill/" + roomID + "/",
|
||||||
|
RawQuery: query.Encode(),
|
||||||
|
}
|
||||||
|
path := u.RequestURI()
|
||||||
|
|
||||||
|
// Send the request.
|
||||||
|
req := NewFederationRequest("GET", s, path)
|
||||||
|
err = ac.doRequest(ctx, req, &res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue