@@ -117,11 +117,11 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
117
117
})
118
118
119
119
t .Run ("Knocking on a room with join rule 'knock' should succeed" , func (t * testing.T ) {
120
- MustKnockOnRoomSynced (t , knockingUser , roomID , testKnockReason , []string {"hs1" })
120
+ mustKnockOnRoomSynced (t , knockingUser , roomID , testKnockReason , []string {"hs1" })
121
121
})
122
122
123
123
t .Run ("A user that has already knocked is allowed to knock again on the same room" , func (t * testing.T ) {
124
- MustKnockOnRoomSynced (t , knockingUser , roomID , "I really like knock knock jokes" , []string {"hs1" })
124
+ mustKnockOnRoomSynced (t , knockingUser , roomID , "I really like knock knock jokes" , []string {"hs1" })
125
125
})
126
126
127
127
t .Run ("Users in the room see a user's membership update when they knock" , func (t * testing.T ) {
@@ -183,7 +183,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
183
183
})
184
184
185
185
// Knock again to return us to the knocked state
186
- MustKnockOnRoomSynced (t , knockingUser , roomID , "Let me in... again?" , []string {"hs1" })
186
+ mustKnockOnRoomSynced (t , knockingUser , roomID , "Let me in... again?" , []string {"hs1" })
187
187
})
188
188
}
189
189
@@ -211,7 +211,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
211
211
}))
212
212
213
213
// Knock again
214
- MustKnockOnRoomSynced (t , knockingUser , roomID , "Pleeease let me in?" , []string {"hs1" })
214
+ mustKnockOnRoomSynced (t , knockingUser , roomID , "Pleeease let me in?" , []string {"hs1" })
215
215
})
216
216
217
217
t .Run ("A user can knock on a room without a reason" , func (t * testing.T ) {
@@ -227,7 +227,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
227
227
)
228
228
229
229
// Knock again, this time without a reason
230
- MustKnockOnRoomSynced (t , knockingUser , roomID , "" , []string {"hs1" })
230
+ mustKnockOnRoomSynced (t , knockingUser , roomID , "" , []string {"hs1" })
231
231
})
232
232
233
233
t .Run ("A user in the room can accept a knock" , func (t * testing.T ) {
@@ -279,7 +279,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
279
279
})
280
280
}
281
281
282
- func SyncKnockedOn (userID , roomID string ) client.SyncCheckOpt {
282
+ func syncKnockedOn (userID , roomID string ) client.SyncCheckOpt {
283
283
return func (clientUserID string , topLevelSyncJSON gjson.Result ) error {
284
284
// two forms which depend on what the client user is:
285
285
// - passively viewing a membership for a room you're joined in
@@ -301,14 +301,14 @@ func SyncKnockedOn(userID, roomID string) client.SyncCheckOpt {
301
301
}
302
302
}
303
303
304
- // MustKnockOnRoomSynced will knock on a given room on the behalf of a user, and block until the knock has persisted.
304
+ // mustKnockOnRoomSynced will knock on a given room on the behalf of a user, and block until the knock has persisted.
305
305
// serverNames should be populated if knocking on a room that the user's homeserver isn't currently a part of.
306
306
// Fails the test if the knock response does not return a 200 status code.
307
- func MustKnockOnRoomSynced (t * testing.T , c * client.CSAPI , roomID , reason string , serverNames []string ) {
307
+ func mustKnockOnRoomSynced (t * testing.T , c * client.CSAPI , roomID , reason string , serverNames []string ) {
308
308
knockOnRoomWithStatus (t , c , roomID , reason , serverNames , 200 )
309
309
310
310
// The knock should have succeeded. Block until we see the knock appear down sync
311
- c .MustSyncUntil (t , client.SyncReq {}, SyncKnockedOn (c .UserID , roomID ))
311
+ c .MustSyncUntil (t , client.SyncReq {}, syncKnockedOn (c .UserID , roomID ))
312
312
}
313
313
314
314
// knockOnRoomWithStatus will knock on a given room on the behalf of a user.
0 commit comments