Knocking feature polishing part 2 (#3738)

* improved implementation of the unknown state

* forget button in the banned state

* error handling for forbidden access

* added the forget function

fixed DMs, and updated preview tests

* removed banned room proxy

* code polishing and test improvement
This commit is contained in:
Mauro
2025-02-05 14:48:24 +01:00
committed by GitHub
parent cfaa1b455a
commit 3839025caa
28 changed files with 466 additions and 101 deletions
@@ -13,13 +13,14 @@ extension RoomPreviewProxyMock {
var roomID = "1"
var canonicalAlias = "#3🌞problem:matrix.org"
var name = "The Three-Body Problem - 三体"
var topic = "“Science and technology were the only keys to opening the door to the future, and people approached science with the faith and sincerity of elementary school students.”"
var topic: String? = "“Science and technology were the only keys to opening the door to the future, and people approached science with the faith and sincerity of elementary school students.”"
var avatarURL = URL.mockMXCAvatar.absoluteString
var numJoinedMembers = UInt64(100)
var numActiveMembers = UInt64(100)
var roomType = RoomType.room
var membership: Membership?
var joinRule: JoinRule
var isDirect = false
}
static var joinable: RoomPreviewProxyMock {
@@ -42,6 +43,14 @@ extension RoomPreviewProxyMock {
return .init(.init(membership: .invited, joinRule: .invite))
}
static func inviteDM(roomID: String? = nil) -> RoomPreviewProxyMock {
if let roomID {
return .init(.init(roomID: roomID, topic: nil, numJoinedMembers: 1, membership: .invited, joinRule: .invite, isDirect: true))
}
return .init(.init(topic: nil, numJoinedMembers: 1, membership: .invited, joinRule: .invite, isDirect: true))
}
static var knockable: RoomPreviewProxyMock {
.init(.init(membership: nil, joinRule: .knock))
}
@@ -71,7 +80,7 @@ extension RoomPreviewProxyMock {
isHistoryWorldReadable: nil,
membership: configuration.membership,
joinRule: configuration.joinRule,
isDirect: nil,
isDirect: configuration.isDirect,
heroes: nil))
let roomMembershipDetails = RoomMembershipDetailsProxyMock()