mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fixes #2291 - Wrong notification placeholder avatar orientation on 17.2.1
This commit is contained in:
@@ -180,7 +180,7 @@ extension UNMutableNotificationContent {
|
|||||||
private func getPlaceholderAvatarImageData(name: String, id: String) async -> Data? {
|
private func getPlaceholderAvatarImageData(name: String, id: String) async -> Data? {
|
||||||
// The version value is used in case the design of the placeholder is updated to force a replacement
|
// The version value is used in case the design of the placeholder is updated to force a replacement
|
||||||
let shouldFlipAvatar = shouldFlipAvatar()
|
let shouldFlipAvatar = shouldFlipAvatar()
|
||||||
let prefix = "notification_placeholder\(shouldFlipAvatar ? "V5" : "V4")"
|
let prefix = "notification_placeholder\(shouldFlipAvatar ? "V7" : "V6")"
|
||||||
let fileName = "\(prefix)_\(name)_\(id).png"
|
let fileName = "\(prefix)_\(name)_\(id).png"
|
||||||
if let data = try? Data(contentsOf: URL.temporaryDirectory.appendingPathComponent(fileName)) {
|
if let data = try? Data(contentsOf: URL.temporaryDirectory.appendingPathComponent(fileName)) {
|
||||||
MXLog.info("Found existing notification icon placeholder")
|
MXLog.info("Found existing notification icon placeholder")
|
||||||
@@ -224,7 +224,8 @@ extension UNMutableNotificationContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// On simulators and macOS the image is rendered correctly
|
/// On simulators and macOS the image is rendered correctly
|
||||||
/// On devices before iOS 17 and after iOS 17.2 it's rendered upside down and needs to be flipped
|
/// On devices before iOS 17 and iOS 17.2.0 it's rendered upside down and needs to be flipped
|
||||||
|
/// On all other versions it's rendered correctly and **doesn't** need to be flipped
|
||||||
private func shouldFlipAvatar() -> Bool {
|
private func shouldFlipAvatar() -> Bool {
|
||||||
#if targetEnvironment(simulator)
|
#if targetEnvironment(simulator)
|
||||||
return false
|
return false
|
||||||
@@ -237,11 +238,15 @@ extension UNMutableNotificationContent {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if version >= Version(17, 0, 0), version < Version(17, 2, 0) {
|
if version < Version(17, 0, 0) {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
if version == Version(17, 2, 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix wrong notification placeholder avatar orientation on 17.2.1
|
||||||
Reference in New Issue
Block a user