diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index 2466374495..3ca84785e2 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -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.. 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 } }