Periphery cleanup (#5893)

This commit is contained in:
Mauro
2026-07-20 11:16:11 +02:00
committed by GitHub
parent 175aca596e
commit 9093631f8b
275 changed files with 381 additions and 2268 deletions
@@ -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) }