func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string) *ServerRoom {
	t.Helper()
	fedClient := s.FederationClient(deployment)
	makeJoinResp, err := fedClient.MakeJoin(context.Background(), remoteServer, roomID, userID, SupportedRoomVersions())
	if err != nil {
		t.Fatalf("MustJoinRoom: make_join failed: %v", err)
	}
	roomVer := makeJoinResp.RoomVersion
	joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), gomatrixserverlib.ServerName(s.ServerName), s.KeyID, s.Priv, roomVer)
	if err != nil {
		t.Fatalf("MustJoinRoom: failed to sign event: %v", err)
	}
	sendJoinResp, err := fedClient.SendJoin(context.Background(), gomatrixserverlib.ServerName(remoteServer), joinEvent, roomVer)
	if err != nil {
		t.Fatalf("MustJoinRoom: send_join failed: %v", err)
	}

	room := newRoom(roomVer, roomID)
	for _, ev := range sendJoinResp.StateEvents {
		room.replaceCurrentState(ev)
	}
	room.AddEvent(joinEvent)
	s.rooms[roomID] = room

	t.Logf("Server.MustJoinRoom joined room ID %s", roomID)

	return room
}
// MustJoinRoom will make the server send a make_join and a send_join to join a room
// It returns the resultant room.
MustJoinRoom will make the server send a make_join and a send_join to join a room
It returns the resultant room.
// MustJoinRoom will make the server send a make_join and a send_join to join a room // It returns the resultant room .
func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string) *ServerRoom {
	t.Helper()
	fedClient := s.FederationClient(deployment)
	makeJoinResp, err := fedClient.MakeJoin(context.Background(), remoteServer, roomID, userID, SupportedRoomVersions())
	if err != nil {
		t.Fatalf("MustJoinRoom: make_join failed: %v", err)
	}
	roomVer := makeJoinResp.RoomVersion
	joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), gomatrixserverlib.ServerName(s.ServerName), s.KeyID, s.Priv, roomVer)
	if err != nil {
		t.Fatalf("MustJoinRoom: failed to sign event: %v", err)
	}
	sendJoinResp, err := fedClient.SendJoin(context.Background(), gomatrixserverlib.ServerName(remoteServer), joinEvent, roomVer)
	if err != nil {
		t.Fatalf("MustJoinRoom: send_join failed: %v", err)
	}
	room := newRoom(roomVer, roomID)
	for _, ev := range sendJoinResp.StateEvents {
		room.replaceCurrentState(ev)
	}
	room.AddEvent(joinEvent)
	s.rooms[roomID] = room
	t.Logf("Server.MustJoinRoom joined room ID %s", roomID)
	return room
}
func ( s * Server ) MustJoinRoom ( t * testing . T , deployment * docker . Deployment , remoteServer gomatrixserverlib . ServerName , roomID string , userID string ) * ServerRoom { t . Helper ( ) fedClient := s . FederationClient ( deployment ) makeJoinResp , err := fedClient . MakeJoin ( context . Background ( ) , remoteServer , roomID , userID , SupportedRoomVersions ( ) ) if err != nil { t . Fatalf ( " " , err ) } roomVer := makeJoinResp . RoomVersion joinEvent , err := makeJoinResp . JoinEvent . Build ( time . Now ( ) , gomatrixserverlib . ServerName ( s . ServerName ) , s . KeyID , s . Priv , roomVer ) if err != nil { t . Fatalf ( " " , err ) } sendJoinResp , err := fedClient . SendJoin ( context . Background ( ) , gomatrixserverlib . ServerName ( remoteServer ) , joinEvent , roomVer ) if err != nil { t . Fatalf ( " " , err ) } room := newRoom ( roomVer , roomID ) for _ , ev := range sendJoinResp . StateEvents { room . replaceCurrentState ( ev ) } room . AddEvent ( joinEvent ) s . rooms [ roomID ] = room t . Logf ( " " , roomID ) return room }
MustJoinRoom will make the server send a make_join and a send_join to join a room
It returns the resultant room.
MustJoinRoom will make the server send a make_join and a send_join to join a room It returns the resultant room .