mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 17:05:19 +00:00
Fix image attachment detection
This commit is contained in:
@@ -1573,7 +1573,6 @@ private extension ContentView {
|
|||||||
let standardized = url.standardizedFileURL
|
let standardized = url.standardizedFileURL
|
||||||
let path = standardized.path
|
let path = standardized.path
|
||||||
guard path == basePath || path.hasPrefix(basePath + "/") else { return nil }
|
guard path == basePath || path.hasPrefix(basePath + "/") else { return nil }
|
||||||
guard FileManager.default.fileExists(atPath: path) else { return nil }
|
|
||||||
return standardized
|
return standardized
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2065,8 +2064,10 @@ private extension ContentView {
|
|||||||
|
|
||||||
func applicationFilesDirectory() -> URL? {
|
func applicationFilesDirectory() -> URL? {
|
||||||
do {
|
do {
|
||||||
let base = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
|
let base = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
||||||
return base.appendingPathComponent("files", isDirectory: true)
|
let filesDir = base.appendingPathComponent("files", isDirectory: true)
|
||||||
|
try FileManager.default.createDirectory(at: filesDir, withIntermediateDirectories: true, attributes: nil)
|
||||||
|
return filesDir
|
||||||
} catch {
|
} catch {
|
||||||
SecureLogger.error("Failed to resolve application files directory: \(error)", category: .session)
|
SecureLogger.error("Failed to resolve application files directory: \(error)", category: .session)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user