mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Periphery cleanup (#5893)
This commit is contained in:
@@ -18,7 +18,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
private let analyticsService: AnalyticsServiceProtocol
|
||||
private let eventStringBuilder: RoomEventStringBuilder
|
||||
|
||||
// periphery:ignore - required for instance retention in the rust codebase
|
||||
private var roomInfoObservationToken: TaskHandle?
|
||||
// periphery:ignore - required for instance retention in the rust codebase
|
||||
private var typingNotificationObservationToken: TaskHandle?
|
||||
@@ -43,12 +42,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
/// The predecessor is set on room creation and never changes, so we lazily store it.
|
||||
lazy var predecessorRoom = room.predecessorRoom()
|
||||
|
||||
/// The successor may change over time, so we access it dynamically.
|
||||
/// It's suggested to observe it through the `infoPublisher`
|
||||
var successorRoom: SuccessorRoom? {
|
||||
room.successorRoom()
|
||||
}
|
||||
|
||||
let timeline: TimelineProxyProtocol
|
||||
|
||||
private let infoSubject: CurrentValueSubject<RoomInfoProxyProtocol, Never>
|
||||
@@ -301,16 +294,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
try await room.redact(eventId: eventID, reason: nil)
|
||||
return .success(())
|
||||
} catch {
|
||||
MXLog.error("Failed redacting eventID: \(eventID) with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func reportContent(_ eventID: String, reason: String?) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
try await room.reportContent(eventId: eventID, reason: reason)
|
||||
@@ -442,16 +425,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func edit(eventID: String, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
try await room.edit(eventId: eventID, newContent: newContent)
|
||||
return .success(())
|
||||
} catch {
|
||||
MXLog.error("Failed editing event id \(eventID), in room \(id) with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func sendTypingNotification(isTyping: Bool) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
try await room.typingNotice(isTyping: isTyping)
|
||||
@@ -581,15 +554,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
|
||||
// MARK: - Power Levels
|
||||
|
||||
func powerLevels() async -> Result<RoomPowerLevelsProxyProtocol?, RoomProxyError> {
|
||||
do {
|
||||
return try await .success(RoomPowerLevelsProxy(room.getPowerLevels()))
|
||||
} catch {
|
||||
MXLog.error("Failed building the current power level settings: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func applyPowerLevelChanges(_ changes: RoomPowerLevelChanges) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
return try await .success(room.applyPowerLevelChanges(changes: changes))
|
||||
@@ -609,15 +573,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func suggestedRole(for userID: String) async -> Result<RoomMemberRole, RoomProxyError> {
|
||||
do {
|
||||
return try await .success(room.suggestedRoleForUser(userId: userID))
|
||||
} catch {
|
||||
MXLog.error("Failed getting a user's role: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func updatePowerLevelsForUsers(_ updates: [(userID: String, powerLevel: Int64)]) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
let updates = updates.map { UserPowerLevelUpdate(userId: $0.userID, powerLevel: $0.powerLevel) }
|
||||
|
||||
Reference in New Issue
Block a user