mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
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:
@@ -32,4 +32,14 @@ final class RoomPreviewProxy: RoomPreviewProxyProtocol {
|
||||
senderRoomMember: senderRoomMember)
|
||||
}
|
||||
}
|
||||
|
||||
func forgetRoom() async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
try await roomPreview.forget()
|
||||
return .success(())
|
||||
} catch {
|
||||
MXLog.error("Failed forgetting the room with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,7 @@ import Foundation
|
||||
protocol RoomPreviewProxyProtocol {
|
||||
var info: RoomPreviewInfoProxy { get }
|
||||
var ownMembershipDetails: RoomMembershipDetailsProxyProtocol? { get async }
|
||||
|
||||
/// Use this function to forget the room, should only be used if the current user membership is `banned`
|
||||
func forgetRoom() async -> Result<Void, RoomProxyError>
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ enum RoomProxyType {
|
||||
case joined(JoinedRoomProxyProtocol)
|
||||
case invited(InvitedRoomProxyProtocol)
|
||||
case knocked(KnockedRoomProxyProtocol)
|
||||
case left
|
||||
case banned
|
||||
case left
|
||||
}
|
||||
|
||||
// sourcery: AutoMockable
|
||||
|
||||
Reference in New Issue
Block a user