mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Handle media previews and invite avatars through the account data (#4142)
* added account data media display policy handling to NSE * pr suggestions * update compound * code improvement
This commit is contained in:
@@ -18,6 +18,28 @@ final class NSEUserSession {
|
||||
imageCache: .onlyOnDisk,
|
||||
networkMonitor: nil)
|
||||
private let delegateHandle: TaskHandle?
|
||||
|
||||
var mediaPreviewVisibility: MediaPreviews {
|
||||
get async {
|
||||
do {
|
||||
return try await baseClient.getMediaPreviewDisplayPolicy() ?? .on
|
||||
} catch {
|
||||
MXLog.error("Failed to get media preview visibility, defaulting to on. Error: \(error)")
|
||||
return .on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var inviteAvatarsVisibility: InviteAvatars {
|
||||
get async {
|
||||
do {
|
||||
return try await baseClient.getInviteAvatarsDisplayPolicy() ?? .on
|
||||
} catch {
|
||||
MXLog.error("Failed to get invite avatars visibility, defaulting to on. Error: \(error)")
|
||||
return .on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init(credentials: KeychainCredentials,
|
||||
roomID: String,
|
||||
|
||||
Reference in New Issue
Block a user