mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-03 12:13:09 -06:00
Remove now un-needed API call
This commit is contained in:
parent
cbf2b47722
commit
f7c4ec7862
|
|
@ -3,7 +3,6 @@ package syncapi
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -24,22 +23,6 @@ type syncRoomserverAPI struct {
|
||||||
rooms []*test.Room
|
rooms []*test.Room
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *syncRoomserverAPI) QueryEventsByID(ctx context.Context, req *rsapi.QueryEventsByIDRequest, res *rsapi.QueryEventsByIDResponse) error {
|
|
||||||
NextEvent:
|
|
||||||
for _, eventID := range req.EventIDs {
|
|
||||||
for _, r := range s.rooms {
|
|
||||||
for _, ev := range r.Events() {
|
|
||||||
if ev.EventID() == eventID {
|
|
||||||
res.Events = append(res.Events, ev)
|
|
||||||
continue NextEvent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fmt.Println("QueryEventsByID", req.EventIDs, " returning ", len(res.Events))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *syncRoomserverAPI) QueryLatestEventsAndState(ctx context.Context, req *rsapi.QueryLatestEventsAndStateRequest, res *rsapi.QueryLatestEventsAndStateResponse) error {
|
func (s *syncRoomserverAPI) QueryLatestEventsAndState(ctx context.Context, req *rsapi.QueryLatestEventsAndStateRequest, res *rsapi.QueryLatestEventsAndStateResponse) error {
|
||||||
var room *test.Room
|
var room *test.Room
|
||||||
for _, r := range s.rooms {
|
for _, r := range s.rooms {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue