Sorta transplanted the code over

This commit is contained in:
Neil Alexander 2021-12-15 13:59:58 +00:00
parent 69111355d0
commit 2203dd9d8a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
22 changed files with 1111 additions and 778 deletions

View file

@ -106,6 +106,21 @@ func (a *FederationInternalAPI) LookupStateIDs(
return ires.(gomatrixserverlib.RespStateIDs), nil
}
func (a *FederationInternalAPI) LookupMissingEvents(
ctx context.Context, s gomatrixserverlib.ServerName, roomID string,
missing gomatrixserverlib.MissingEvents, roomVersion gomatrixserverlib.RoomVersion,
) (res gomatrixserverlib.RespMissingEvents, err error) {
ctx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
ires, err := a.doRequest(s, func() (interface{}, error) {
return a.federation.LookupMissingEvents(ctx, s, roomID, missing, roomVersion)
})
if err != nil {
return gomatrixserverlib.RespMissingEvents{}, err
}
return ires.(gomatrixserverlib.RespMissingEvents), nil
}
func (a *FederationInternalAPI) GetEvent(
ctx context.Context, s gomatrixserverlib.ServerName, eventID string,
) (res gomatrixserverlib.Transaction, err error) {