@@ -2,6 +2,7 @@ package tests
22
33import (
44 "fmt"
5+ "github.com/matrix-org/gomatrixserverlib/spec"
56 "testing"
67 "time"
78
@@ -30,7 +31,7 @@ func TestAliceBobEncryptionWorks(t *testing.T) {
3031 cc .EncRoomOptions .PresetTrustedPrivateChat (),
3132 cc .EncRoomOptions .Invite ([]string {tc .Bob .UserID }),
3233 )
33- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
34+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
3435
3536 // SDK testing below
3637 // -----------------
@@ -87,7 +88,7 @@ func TestCanDecryptMessagesAfterInviteButBeforeJoin(t *testing.T) {
8788 alice .MustSendMessage (t , roomID , wantMsgBody )
8889
8990 // Bob joins the room (via Complement, but it shouldn't matter)
90- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
91+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
9192
9293 isEncrypted , err = bob .IsRoomEncrypted (t , roomID )
9394 must .NotError (t , "failed to check if room is encrypted" , err )
@@ -131,7 +132,7 @@ func TestBobCanSeeButNotDecryptHistoryInPublicRoom(t *testing.T) {
131132 waiter .Waitf (t , 5 * time .Second , "alice did not see own message" )
132133
133134 // now bob joins the room
134- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
135+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
135136 time .Sleep (time .Second ) // wait for it to appear on the client else rust crashes if it cannot find the room FIXME
136137 waiter = bob .WaitUntilEventInRoom (t , roomID , api .CheckEventHasMembership (bob .UserID (), "join" ))
137138 waiter .Waitf (t , 5 * time .Second , "bob did not see own join" )
@@ -159,7 +160,7 @@ func TestOnRejoinBobCanSeeButNotDecryptHistoryInPublicRoom(t *testing.T) {
159160 tc := Instance ().CreateTestContext (t , clientTypeA , clientTypeB )
160161 // shared history visibility
161162 roomID := tc .CreateNewEncryptedRoom (t , tc .Alice , cc .EncRoomOptions .PresetPublicChat ())
162- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
163+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
163164
164165 // SDK testing below
165166 // -----------------
@@ -184,7 +185,7 @@ func TestOnRejoinBobCanSeeButNotDecryptHistoryInPublicRoom(t *testing.T) {
184185 waiter .Waitf (t , 5 * time .Second , "alice did not see own message" )
185186
186187 // now bob rejoins the room, wait until he sees it.
187- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
188+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
188189 waiter = bob .WaitUntilEventInRoom (t , roomID , api .CheckEventHasMembership (bob .UserID (), "join" ))
189190 waiter .Waitf (t , 5 * time .Second , "bob did not see own join" )
190191 // this is required for some reason else tests fail
@@ -217,7 +218,7 @@ func TestOnNewDeviceBobCanSeeButNotDecryptHistoryInPublicRoom(t *testing.T) {
217218 tc := Instance ().CreateTestContext (t , clientTypeA , clientTypeB )
218219 // shared history visibility
219220 roomID := tc .CreateNewEncryptedRoom (t , tc .Alice , cc .EncRoomOptions .PresetPublicChat ())
220- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
221+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
221222
222223 // SDK testing below
223224 // -----------------
@@ -295,7 +296,7 @@ func TestChangingDeviceAfterInviteReEncrypts(t *testing.T) {
295296 User : csapiBob2 ,
296297 }, func (bob2 api.TestClient ) {
297298 time .Sleep (time .Second ) // let device keys propagate
298- tc .Bob .MustJoinRoom (t , roomID , []string {clientTypeA .HS })
299+ tc .Bob .MustJoinRoom (t , roomID , []spec. ServerName {clientTypeA .HS })
299300
300301 time .Sleep (time .Second ) // let the client load the events
301302 bob2 .MustBackpaginate (t , roomID , 5 )
0 commit comments