Merge commit '6b528aa70f228b80dcb1f72961a878f23284d0fb' into star-ref-api

This commit is contained in:
Isaac
2024-11-28 16:13:21 +04:00
79 changed files with 6093 additions and 1224 deletions

View File

@@ -2349,6 +2349,12 @@ public final class WebAppController: ViewController, AttachmentContainable {
guard let controller = self.controller else {
return
}
guard !fileName.contains("/") && fileName.lengthOfBytes(using: .utf8) < 256 && url.lengthOfBytes(using: .utf8) < 32768 else {
self.webView?.sendEvent(name: "file_download_requested", data: "{status: \"cancelled\"}")
return
}
var isMedia = false
var title: String?
let photoExtensions = [".jpg", ".png", ".gif", ".tiff"]