mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Redacting is now displayed for moderators in groups (#1324)
* basic implementation * sdk update * format * changelog
This commit is contained in:
@@ -55,6 +55,10 @@ class RoomProxy: RoomProxyProtocol {
|
||||
innerTimelineProvider
|
||||
}
|
||||
|
||||
var ownUserID: String {
|
||||
room.ownUserId()
|
||||
}
|
||||
|
||||
deinit {
|
||||
roomTimelineObservationToken?.cancel()
|
||||
backPaginationStateObservationToken?.cancel()
|
||||
@@ -647,6 +651,15 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func canUserRedact(userID: String) async -> Result<Bool, RoomProxyError> {
|
||||
do {
|
||||
return try await .success(room.canUserRedact(userId: userID))
|
||||
} catch {
|
||||
MXLog.error("Failed checking if the user can redact with error: \(error)")
|
||||
return .failure(.failedCheckingPermission)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// Force the timeline to load member details so it can populate sender profiles whenever we add a timeline listener
|
||||
|
||||
@@ -41,6 +41,7 @@ enum RoomProxyError: Error, Equatable {
|
||||
case failedSettingRoomTopic
|
||||
case failedRemovingAvatar
|
||||
case failedUploadingAvatar
|
||||
case failedCheckingPermission
|
||||
}
|
||||
|
||||
// sourcery: AutoMockable
|
||||
@@ -54,6 +55,7 @@ protocol RoomProxyProtocol {
|
||||
var canonicalAlias: String? { get }
|
||||
var alternativeAliases: [String] { get }
|
||||
var hasUnreadNotifications: Bool { get }
|
||||
var ownUserID: String { get }
|
||||
|
||||
var name: String? { get }
|
||||
var displayName: String? { get }
|
||||
@@ -159,6 +161,8 @@ protocol RoomProxyProtocol {
|
||||
func removeAvatar() async -> Result<Void, RoomProxyError>
|
||||
|
||||
func uploadAvatar(media: MediaInfo) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func canUserRedact(userID: String) async -> Result<Bool, RoomProxyError>
|
||||
}
|
||||
|
||||
extension RoomProxyProtocol {
|
||||
|
||||
Reference in New Issue
Block a user