Remove LatestState
This commit is contained in:
parent
254d535789
commit
1e73175e27
2
go.mod
2
go.mod
|
@ -22,7 +22,7 @@ require (
|
|||
github.com/matrix-org/dugong v0.0.0-20210921133753-66e6b1c67e2e
|
||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91
|
||||
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230525131408-9e1377a918b6
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230530160030-2640a7efaaaa
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a
|
||||
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66
|
||||
github.com/mattn/go-sqlite3 v1.14.16
|
||||
|
|
2
go.sum
2
go.sum
|
@ -325,6 +325,8 @@ github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 h1:kHKxCOLcHH8
|
|||
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230525131408-9e1377a918b6 h1:GZJdDQt/IJynQyWpHsYYWQUyCu9Y+asAdwfL7pJNQHU=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230525131408-9e1377a918b6/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230530160030-2640a7efaaaa h1:m0wWaq2qvMJdYrj5p/mLXV11gbFEKNd6o7C16poSlW0=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230530160030-2640a7efaaaa/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU=
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a h1:awrPDf9LEFySxTLKYBMCiObelNx/cBuv/wzllvCCH3A=
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a/go.mod h1:HchJX9oKMXaT2xYFs0Ha/6Zs06mxLU8k6F1ODnrGkeQ=
|
||||
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y=
|
||||
|
|
|
@ -197,7 +197,6 @@ type UserRoomserverAPI interface {
|
|||
}
|
||||
|
||||
type FederationRoomserverAPI interface {
|
||||
gomatrixserverlib.LatestStateQuerier
|
||||
InputRoomEventsAPI
|
||||
QueryLatestEventsAndStateAPI
|
||||
QueryBulkStateContentAPI
|
||||
|
|
|
@ -55,30 +55,6 @@ func (r *Queryer) QueryLatestEventsAndState(
|
|||
return helpers.QueryLatestEventsAndState(ctx, r.DB, request, response)
|
||||
}
|
||||
|
||||
func (r *Queryer) LatestState(
|
||||
ctx context.Context, roomID spec.RoomID, userID spec.UserID,
|
||||
) ([]gomatrixserverlib.PDU, error) {
|
||||
request := &api.QueryLatestEventsAndStateRequest{
|
||||
RoomID: roomID.String(),
|
||||
StateToFetch: []gomatrixserverlib.StateKeyTuple{
|
||||
{
|
||||
EventType: spec.MRoomMember,
|
||||
StateKey: userID.String(),
|
||||
},
|
||||
},
|
||||
}
|
||||
response := &api.QueryLatestEventsAndStateResponse{}
|
||||
err := helpers.QueryLatestEventsAndState(ctx, r.DB, request, response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res := make([]gomatrixserverlib.PDU, 0, len(response.StateEvents))
|
||||
for _, ev := range response.StateEvents {
|
||||
res = append(res, ev.PDU)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// QueryStateAfterEvents implements api.RoomserverInternalAPI
|
||||
func (r *Queryer) QueryStateAfterEvents(
|
||||
ctx context.Context,
|
||||
|
|
Loading…
Reference in a new issue