Skip to content

Commit 566dad5

Browse files
Version 6.1.7 (#3221)
1 parent 84f7922 commit 566dad5

File tree

167 files changed

+689
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+689
-558
lines changed

Brand/Database.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ import Foundation
2626
// Database Realm
2727
//
2828
let databaseName = "nextcloud.realm"
29-
let databaseSchemaVersion: UInt64 = 366
29+
let databaseSchemaVersion: UInt64 = 367

Brand/Intro/NCIntroCollectionViewCell.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,4 @@ class NCIntroCollectionViewCell: UICollectionViewCell {
3131
@IBOutlet weak var imageView: UIImageView!
3232

3333
var indexPath = IndexPath()
34-
35-
override func awakeFromNib() {
36-
super.awakeFromNib()
37-
}
38-
3934
}

Brand/NCBrand.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ let userAgent: String = {
7272
var disable_show_more_nextcloud_apps_in_settings: Bool = false
7373
var doNotAskPasscodeAtStartup: Bool = false
7474
var disable_source_code_in_settings: Bool = false
75+
var enforce_passcode_lock = false
7576

7677
// (name: "Name 1", url: "https://cloud.nextcloud.com"),(name: "Name 2", url: "https://cloud.nextcloud.com")
7778
var enforce_servers: [(name: String, url: String)] = []
7879

7980
// Internal option behaviour
80-
var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
81+
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
8182

8283
// Max download/upload concurrent
8384
let maxConcurrentOperationDownload: Int = 5
@@ -95,7 +96,6 @@ let userAgent: String = {
9596
override init() {
9697
// wrapper AppConfig
9798
if let configurationManaged = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"), use_AppConfig {
98-
9999
if let str = configurationManaged[NCGlobal.shared.configuration_brand] as? String {
100100
brand = str
101101
}
@@ -117,6 +117,9 @@ let userAgent: String = {
117117
if let str = configurationManaged[NCGlobal.shared.configuration_disable_openin_file] as? String {
118118
disable_openin_file = (str as NSString).boolValue
119119
}
120+
if let str = configurationManaged[NCGlobal.shared.configuration_enforce_passcode_lock] as? String {
121+
enforce_passcode_lock = (str as NSString).boolValue
122+
}
120123
}
121124
}
122125

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 33 additions & 20 deletions
Large diffs are not rendered by default.

Notification Service Extension/NotificationService.swift

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ import UIKit
2323
import UserNotifications
2424

2525
class NotificationService: UNNotificationServiceExtension {
26-
2726
var contentHandler: ((UNNotificationContent) -> Void)?
2827
var bestAttemptContent: UNMutableNotificationContent?
28+
var request: UNNotificationRequest?
2929

3030
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
3131
self.contentHandler = contentHandler
32+
self.request = request
3233
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
3334

3435
if let bestAttemptContent = bestAttemptContent {
@@ -37,11 +38,19 @@ class NotificationService: UNNotificationServiceExtension {
3738
do {
3839
if let message = bestAttemptContent.userInfo["subject"] as? String {
3940
for tableAccount in NCManageDatabase.shared.getAllTableAccount() {
40-
guard let privateKey = NCKeychain().getPushNotificationPrivateKey(account: tableAccount.account),
41-
let decryptedMessage = NCPushNotificationEncryption.shared().decryptPushNotification(message, withDevicePrivateKey: privateKey),
42-
let data = decryptedMessage.data(using: .utf8) else {
41+
guard let privateKey = NCKeychain().getPushNotificationPrivateKey(account: tableAccount.account) else {
42+
bestAttemptContent.body = "Error retrieving private key for \(tableAccount.account)"
43+
continue
44+
}
45+
guard let decryptedMessage = NCPushNotificationEncryption.shared().decryptPushNotification(message, withDevicePrivateKey: privateKey) else {
46+
bestAttemptContent.body = "Error decryption for \(tableAccount.account)"
47+
continue
48+
}
49+
guard let data = decryptedMessage.data(using: .utf8) else {
50+
bestAttemptContent.body = "Error decryption data utf8 for \(tableAccount.account)"
4351
continue
4452
}
53+
4554
if var json = try JSONSerialization.jsonObject(with: data) as? [String: AnyObject],
4655
let subject = json["subject"] as? String {
4756
bestAttemptContent.body = subject
@@ -50,7 +59,10 @@ class NotificationService: UNNotificationServiceExtension {
5059
pref.set(json, forKey: "NOTIFICATION_DATA")
5160
pref.synchronize()
5261
}
62+
} else {
63+
bestAttemptContent.body = "Error JSON Serialization for \(tableAccount.account)"
5364
}
65+
break
5466
}
5567
}
5668
} catch let error as NSError {
@@ -66,9 +78,8 @@ class NotificationService: UNNotificationServiceExtension {
6678
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
6779
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
6880
bestAttemptContent.title = ""
69-
bestAttemptContent.body = "Nextcloud notification"
81+
bestAttemptContent.body = "Nextcloud Notification Time Will Expire"
7082
contentHandler(bestAttemptContent)
7183
}
7284
}
73-
7485
}

Share/NCShareExtension+NCAccountRequestDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ extension NCShareExtension: NCCreateFormUploadConflictDelegate {
106106
}
107107

108108
self.uploadMetadata.append(contentsOf: metadatas)
109+
uploadStarted = true
109110
self.upload()
110111
}
111112
}

Share/NCShareExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ extension NCShareExtension {
338338
metadataForUpload.size = utilityFileSystem.getFileSize(filePath: toPath)
339339
metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
340340
metadataForUpload.sessionDate = Date()
341-
if self.database.getMetadataConflict(account: session.account, serverUrl: serverUrl, fileNameView: fileName) != nil {
341+
if self.database.getMetadataConflict(account: session.account, serverUrl: serverUrl, fileNameView: fileName, nativeFormat: metadataForUpload.nativeFormat) != nil {
342342
conflicts.append(metadataForUpload)
343343
} else {
344344
uploadMetadata.append(metadataForUpload)

Widget/Dashboard/DashboardData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
225225
if FileManager().fileExists(atPath: fileNamePath), let image = UIImage(contentsOfFile: fileNamePath) {
226226
icon = image
227227
} else {
228-
let (_, data, error) = await NCNetworking.shared.downloadPreview(url: url, account: activeTableAccount.account)
228+
let (_, _, error) = await NCNetworking.shared.downloadPreview(url: url, account: activeTableAccount.account)
229229
if error == .success,
230230
let data = responseData?.data,
231231
let image = convertDataToImage(data: data, size: NCGlobal.shared.size256, fileNameToWrite: fileName) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"13zjVT" = "Account";
2+
3+
"CAIVXf" = "Applications";
4+
5+
"DN8Bxl" = "Account";
6+
7+
"LIw8E9" = "Widget";
8+
9+
"NO1rJU" = "Dashboard";
10+
11+
"V3exc2" = "Account";
12+
13+
"VfbA9C" = "Account";
14+
15+
"ZgvlYN" = "Dashboard Widget";
16+
17+
"tAlZ1R" = "Accounts";
18+

0 commit comments

Comments
 (0)