mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Move GMSL client types to Dendrite (#3045)
GMSL is intended for Federation only. Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/357
This commit is contained in:
parent
985298cfc4
commit
3691423626
58 changed files with 692 additions and 234 deletions
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/syncapi/storage"
|
||||
"github.com/matrix-org/dendrite/syncapi/synctypes"
|
||||
"github.com/matrix-org/dendrite/syncapi/types"
|
||||
"github.com/matrix-org/dendrite/userapi/api"
|
||||
)
|
||||
|
@ -278,7 +279,7 @@ func leftRooms(res *types.Response) []string {
|
|||
return roomIDs
|
||||
}
|
||||
|
||||
func membershipEventPresent(events []gomatrixserverlib.ClientEvent, userID string) bool {
|
||||
func membershipEventPresent(events []synctypes.ClientEvent, userID string) bool {
|
||||
for _, ev := range events {
|
||||
// it's enough to know that we have our member event here, don't need to check membership content
|
||||
// as it's implied by being in the respective section of the sync response.
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/matrix-org/util"
|
||||
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/syncapi/synctypes"
|
||||
"github.com/matrix-org/dendrite/syncapi/types"
|
||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
||||
)
|
||||
|
@ -159,7 +160,7 @@ func assertCatchup(t *testing.T, hasNew bool, syncResponse *types.Response, want
|
|||
|
||||
func joinResponseWithRooms(syncResponse *types.Response, userID string, roomIDs []string) *types.Response {
|
||||
for _, roomID := range roomIDs {
|
||||
roomEvents := []gomatrixserverlib.ClientEvent{
|
||||
roomEvents := []synctypes.ClientEvent{
|
||||
{
|
||||
Type: "m.room.member",
|
||||
StateKey: &userID,
|
||||
|
@ -182,7 +183,7 @@ func joinResponseWithRooms(syncResponse *types.Response, userID string, roomIDs
|
|||
|
||||
func leaveResponseWithRooms(syncResponse *types.Response, userID string, roomIDs []string) *types.Response {
|
||||
for _, roomID := range roomIDs {
|
||||
roomEvents := []gomatrixserverlib.ClientEvent{
|
||||
roomEvents := []synctypes.ClientEvent{
|
||||
{
|
||||
Type: "m.room.member",
|
||||
StateKey: &userID,
|
||||
|
@ -299,7 +300,7 @@ func TestKeyChangeCatchupNoNewJoinsButMessages(t *testing.T) {
|
|||
roomID := "!TestKeyChangeCatchupNoNewJoinsButMessages:bar"
|
||||
syncResponse := types.NewResponse()
|
||||
empty := ""
|
||||
roomStateEvents := []gomatrixserverlib.ClientEvent{
|
||||
roomStateEvents := []synctypes.ClientEvent{
|
||||
{
|
||||
Type: "m.room.name",
|
||||
StateKey: &empty,
|
||||
|
@ -309,7 +310,7 @@ func TestKeyChangeCatchupNoNewJoinsButMessages(t *testing.T) {
|
|||
Content: []byte(`{"name":"The Room Name"}`),
|
||||
},
|
||||
}
|
||||
roomTimelineEvents := []gomatrixserverlib.ClientEvent{
|
||||
roomTimelineEvents := []synctypes.ClientEvent{
|
||||
{
|
||||
Type: "m.room.message",
|
||||
EventID: "$something1:here",
|
||||
|
@ -402,7 +403,7 @@ func TestKeyChangeCatchupChangeAndLeftSameRoom(t *testing.T) {
|
|||
newShareUser2 := "@bobby:localhost"
|
||||
roomID := "!join:bar"
|
||||
syncResponse := types.NewResponse()
|
||||
roomEvents := []gomatrixserverlib.ClientEvent{
|
||||
roomEvents := []synctypes.ClientEvent{
|
||||
{
|
||||
Type: "m.room.member",
|
||||
StateKey: &syncingUser,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue