mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Fix log path [nocache]
This commit is contained in:
parent
732f0e6bea
commit
1ef233719c
@ -414,7 +414,12 @@ func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState:
|
||||
let logsPath = callLogsPath(account: context.account)
|
||||
let logPath = logsPath + "/" + logName
|
||||
let start = logName.index(logName.startIndex, offsetBy: "\(id)".count + 1)
|
||||
let end = logName.index(logName.endIndex, offsetBy: -4 - 5)
|
||||
let end: String.Index
|
||||
if logName.hasSuffix(".log.json") {
|
||||
end = logName.index(logName.endIndex, offsetBy: -4 - 5)
|
||||
} else {
|
||||
end = logName.index(logName.endIndex, offsetBy: -4)
|
||||
}
|
||||
let accessHash = logName[start..<end]
|
||||
if let accessHash = Int64(accessHash) {
|
||||
callId = CallId(id: id, accessHash: accessHash)
|
||||
|
@ -42,6 +42,9 @@ public func callLogNameForId(id: Int64, account: Account) -> String? {
|
||||
for url in enumerator {
|
||||
if let url = url as? URL {
|
||||
if url.lastPathComponent.hasPrefix(namePrefix) {
|
||||
if url.lastPathComponent.hasSuffix(".log.json") {
|
||||
continue
|
||||
}
|
||||
return url.lastPathComponent
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user