2
2
// +build msc3787
3
3
4
4
// This file contains tests for a join rule which mixes concepts of restricted joins
5
- // and knocking. This is currently experimental and defined by MSC3787, found here:
6
- // https://github.com/matrix-org/matrix-spec-proposals/pull/3787
5
+ // and knocking. This is implemented in room version 10.
7
6
//
8
7
// Generally, this is a combination of knocking_test and restricted_rooms_test.
9
8
@@ -16,26 +15,26 @@ import (
16
15
)
17
16
18
17
var (
19
- msc3787RoomVersion = "org.matrix.msc3787 "
20
- msc3787JoinRule = "knock_restricted"
18
+ roomVersion = "10 "
19
+ joinRule = "knock_restricted"
21
20
)
22
21
23
22
// See TestKnocking
24
23
func TestKnockingInMSC3787Room (t * testing.T ) {
25
- doTestKnocking (t , msc3787RoomVersion , msc3787JoinRule )
24
+ doTestKnocking (t , roomVersion , joinRule )
26
25
}
27
26
28
27
// See TestKnockRoomsInPublicRoomsDirectory
29
28
func TestKnockRoomsInPublicRoomsDirectoryInMSC3787Room (t * testing.T ) {
30
- doTestKnockRoomsInPublicRoomsDirectory (t , msc3787RoomVersion , msc3787JoinRule )
29
+ doTestKnockRoomsInPublicRoomsDirectory (t , roomVersion , joinRule )
31
30
}
32
31
33
32
// See TestCannotSendKnockViaSendKnock
34
33
func TestCannotSendKnockViaSendKnockInMSC3787Room (t * testing.T ) {
35
34
testValidationForSendMembershipEndpoint (t , "/_matrix/federation/v1/send_knock" , "knock" ,
36
35
map [string ]interface {}{
37
36
"preset" : "public_chat" ,
38
- "room_version" : msc3787RoomVersion ,
37
+ "room_version" : roomVersion ,
39
38
},
40
39
)
41
40
}
@@ -46,13 +45,13 @@ func TestRestrictedRoomsLocalJoinInMSC3787Room(t *testing.T) {
46
45
defer deployment .Destroy (t )
47
46
48
47
// Setup the user, allowed room, and restricted room.
49
- alice , allowed_room , room := setupRestrictedRoom (t , deployment , msc3787RoomVersion , msc3787JoinRule )
48
+ alice , allowed_room , room := setupRestrictedRoom (t , deployment , roomVersion , joinRule )
50
49
51
50
// Create a second user on the same homeserver.
52
51
bob := deployment .Client (t , "hs1" , "@bob:hs1" )
53
52
54
53
// Execute the checks.
55
- checkRestrictedRoom (t , alice , bob , allowed_room , room , msc3787JoinRule )
54
+ checkRestrictedRoom (t , alice , bob , allowed_room , room , joinRule )
56
55
}
57
56
58
57
// See TestRestrictedRoomsRemoteJoin
@@ -61,21 +60,21 @@ func TestRestrictedRoomsRemoteJoinInMSC3787Room(t *testing.T) {
61
60
defer deployment .Destroy (t )
62
61
63
62
// Setup the user, allowed room, and restricted room.
64
- alice , allowed_room , room := setupRestrictedRoom (t , deployment , msc3787RoomVersion , msc3787JoinRule )
63
+ alice , allowed_room , room := setupRestrictedRoom (t , deployment , roomVersion , joinRule )
65
64
66
65
// Create a second user on a different homeserver.
67
66
bob := deployment .Client (t , "hs2" , "@bob:hs2" )
68
67
69
68
// Execute the checks.
70
- checkRestrictedRoom (t , alice , bob , allowed_room , room , msc3787JoinRule )
69
+ checkRestrictedRoom (t , alice , bob , allowed_room , room , joinRule )
71
70
}
72
71
73
72
// See TestRestrictedRoomsRemoteJoinLocalUser
74
73
func TestRestrictedRoomsRemoteJoinLocalUserInMSC3787Room (t * testing.T ) {
75
- doTestRestrictedRoomsRemoteJoinLocalUser (t , msc3787RoomVersion , msc3787JoinRule )
74
+ doTestRestrictedRoomsRemoteJoinLocalUser (t , roomVersion , joinRule )
76
75
}
77
76
78
77
// See TestRestrictedRoomsRemoteJoinFailOver
79
78
func TestRestrictedRoomsRemoteJoinFailOverInMSC3787Room (t * testing.T ) {
80
- doTestRestrictedRoomsRemoteJoinFailOver (t , msc3787RoomVersion , msc3787JoinRule )
79
+ doTestRestrictedRoomsRemoteJoinFailOver (t , roomVersion , joinRule )
81
80
}
0 commit comments