mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Sorta transplanted the code over
This commit is contained in:
parent
69111355d0
commit
2203dd9d8a
22 changed files with 1111 additions and 778 deletions
|
@ -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) {
|
||||
|
|
|
@ -249,6 +249,7 @@ func (r *FederationInternalAPI) performJoinUsingServer(
|
|||
roomserverAPI.KindNew,
|
||||
respState,
|
||||
event.Headered(respMakeJoin.RoomVersion),
|
||||
serverName,
|
||||
nil,
|
||||
); err != nil {
|
||||
logrus.WithFields(logrus.Fields{
|
||||
|
@ -430,6 +431,7 @@ func (r *FederationInternalAPI) performOutboundPeekUsingServer(
|
|||
roomserverAPI.KindNew,
|
||||
&respState,
|
||||
respPeek.LatestEvent.Headered(respPeek.RoomVersion),
|
||||
serverName,
|
||||
nil,
|
||||
); err != nil {
|
||||
return fmt.Errorf("r.producer.SendEventWithState: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue