Skip to content

Commit 775af0c

Browse files
Version 5.5.3 (#3015)
1 parent 9e4e7af commit 775af0c

File tree

186 files changed

+440
-423
lines changed

Some content is hidden

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

186 files changed

+440
-423
lines changed

File Provider Extension/FileProviderEnumerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
160160
let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@", fileProviderData.shared.account, serverUrl)
161161

162162
if pageNumber == 1 {
163-
NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: NCKeychain().showHiddenFiles) { _, files, _, error in
163+
NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: NCKeychain().showHiddenFiles, account: fileProviderData.shared.account) { _, files, _, error in
164164
if error == .success {
165165
NCManageDatabase.shared.convertFilesToMetadatas(files, useFirstAsMetadataFolder: true) { metadataFolder, metadatas in
166166
/// FOLDER

File Provider Extension/FileProviderExtension+Actions.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extension FileProviderExtension {
3333
let directoryName = utilityFileSystem.createFileName(directoryName, serverUrl: tableDirectory.serverUrl, account: fileProviderData.shared.account)
3434
let serverUrlFileName = tableDirectory.serverUrl + "/" + directoryName
3535

36-
NextcloudKit.shared.createFolder(serverUrlFileName: serverUrlFileName) { _, ocId, _, error in
36+
NextcloudKit.shared.createFolder(serverUrlFileName: serverUrlFileName, account: fileProviderData.shared.account) { _, ocId, _, error in
3737
if error == .success {
38-
NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: NCKeychain().showHiddenFiles) { _, files, _, error in
38+
NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: NCKeychain().showHiddenFiles, account: fileProviderData.shared.account) { _, files, _, error in
3939
if error == .success, let file = files.first {
4040
let isDirectoryEncrypted = self.utilityFileSystem.isDirectoryE2EE(file: file)
4141
let metadata = NCManageDatabase.shared.convertFileToMetadata(file, isDirectoryE2EE: isDirectoryEncrypted)
@@ -69,7 +69,7 @@ extension FileProviderExtension {
6969
let serverUrl = metadata.serverUrl
7070
let fileName = metadata.fileName
7171

72-
NextcloudKit.shared.deleteFileOrFolder(serverUrlFileName: serverUrlFileName) { account, error in
72+
NextcloudKit.shared.deleteFileOrFolder(serverUrlFileName: serverUrlFileName, account: metadata.account) { account, error in
7373
if error == .success { // || error == kOCErrorServerPathNotFound {
7474
let fileNamePath = self.utilityFileSystem.getDirectoryProviderStorageOcId(itemIdentifier.rawValue)
7575

@@ -107,7 +107,7 @@ extension FileProviderExtension {
107107
let serverUrlTo = tableDirectoryTo.serverUrl
108108
let fileNameTo = serverUrlTo + "/" + itemFrom.filename
109109

110-
NextcloudKit.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: false) { account, error in
110+
NextcloudKit.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: false, account: metadataFrom.account) { account, error in
111111
if error == .success {
112112
if metadataFrom.directory {
113113
NCManageDatabase.shared.deleteDirectoryAndSubDirectory(serverUrl: serverUrlFrom, account: account)
@@ -138,7 +138,7 @@ extension FileProviderExtension {
138138
let fileNamePathTo = metadata.serverUrl + "/" + itemName
139139
let ocId = metadata.ocId
140140

141-
NextcloudKit.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePathFrom, serverUrlFileNameDestination: fileNamePathTo, overwrite: false) { account, error in
141+
NextcloudKit.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePathFrom, serverUrlFileNameDestination: fileNamePathTo, overwrite: false, account: metadata.account) { account, error in
142142
if error == .success {
143143
// Rename metadata
144144
NCManageDatabase.shared.renameMetadata(fileNameTo: itemName, ocId: ocId)
@@ -185,7 +185,7 @@ extension FileProviderExtension {
185185

186186
if (favorite == true && metadata.favorite == false) || (favorite == false && metadata.favorite == true) {
187187
let fileNamePath = utilityFileSystem.getFileNamePath(metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, userId: metadata.userId)
188-
NextcloudKit.shared.setFavorite(fileName: fileNamePath, favorite: favorite) { _, error in
188+
NextcloudKit.shared.setFavorite(fileName: fileNamePath, favorite: favorite, account: metadata.account) { _, error in
189189
if error == .success {
190190
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else {
191191
return completionHandler(nil, NSFileProviderError(.noSuchItem))

File Provider Extension/FileProviderExtension+Thumbnail.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension FileProviderExtension {
3838
}
3939
let fileNameIconLocalPath = utilityFileSystem.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)
4040

41-
NextcloudKit.shared.downloadPreview(fileId: metadata.fileId, widthPreview: Int(size.width), heightPreview: Int(size.height), etag: metadata.etag) { _ in
41+
NextcloudKit.shared.downloadPreview(fileId: metadata.fileId, widthPreview: Int(size.width), heightPreview: Int(size.height), etag: metadata.etag, account: metadata.account) { _ in
4242
} completion: { _, data, error in
4343
if error == .success, let data {
4444
do {

File Provider Extension/FileProviderExtension.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class FileProviderExtension: NSFileProviderExtension {
195195
/// SIGNAL
196196
fileProviderData.shared.signalEnumerator(ocId: metadata.ocId, type: .update)
197197

198-
NextcloudKit.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, requestHandler: { _ in
198+
NextcloudKit.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, account: metadata.account, requestHandler: { _ in
199199
}, taskHandler: { task in
200200
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId,
201201
taskIdentifier: task.taskIdentifier)
@@ -254,7 +254,7 @@ class FileProviderExtension: NSFileProviderExtension {
254254
sessionError: "",
255255
selector: "",
256256
status: NCGlobal.shared.metadataStatusUploading)
257-
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: url.path, dateCreationFile: nil, dateModificationFile: nil, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {
257+
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: url.path, dateCreationFile: nil, dateModificationFile: nil, account: metadata.account, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {
258258
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId,
259259
status: NCGlobal.shared.metadataStatusUploading,
260260
taskIdentifier: task.taskIdentifier)
@@ -318,7 +318,7 @@ class FileProviderExtension: NSFileProviderExtension {
318318
let serverUrlFileName = tableDirectory.serverUrl + "/" + fileName
319319
let fileNameLocalPath = self.utilityFileSystem.getDirectoryProviderStorageOcId(ocIdTemp, fileNameView: fileName)
320320

321-
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {
321+
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, account: metadata.account, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {
322322
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId,
323323
status: NCGlobal.shared.metadataStatusUploading,
324324
taskIdentifier: task.taskIdentifier)

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5414,7 +5414,7 @@
54145414
CLANG_WARN_UNREACHABLE_CODE = YES;
54155415
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
54165416
COPY_PHASE_STRIP = NO;
5417-
CURRENT_PROJECT_VERSION = 2;
5417+
CURRENT_PROJECT_VERSION = 13;
54185418
DEBUG_INFORMATION_FORMAT = dwarf;
54195419
DEVELOPMENT_TEAM = NKUJUXUJ3B;
54205420
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5441,7 +5441,7 @@
54415441
"@executable_path/Frameworks",
54425442
"@executable_path/../../Frameworks",
54435443
);
5444-
MARKETING_VERSION = 5.5.2;
5444+
MARKETING_VERSION = 5.5.3;
54455445
ONLY_ACTIVE_ARCH = YES;
54465446
OTHER_CFLAGS = "-v";
54475447
OTHER_LDFLAGS = "";
@@ -5480,7 +5480,7 @@
54805480
CLANG_WARN_UNREACHABLE_CODE = YES;
54815481
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
54825482
COPY_PHASE_STRIP = NO;
5483-
CURRENT_PROJECT_VERSION = 2;
5483+
CURRENT_PROJECT_VERSION = 13;
54845484
DEVELOPMENT_TEAM = NKUJUXUJ3B;
54855485
ENABLE_STRICT_OBJC_MSGSEND = YES;
54865486
ENABLE_TESTABILITY = YES;
@@ -5504,7 +5504,7 @@
55045504
"@executable_path/Frameworks",
55055505
"@executable_path/../../Frameworks",
55065506
);
5507-
MARKETING_VERSION = 5.5.2;
5507+
MARKETING_VERSION = 5.5.3;
55085508
ONLY_ACTIVE_ARCH = YES;
55095509
OTHER_CFLAGS = "-v";
55105510
OTHER_LDFLAGS = "";
@@ -5779,7 +5779,7 @@
57795779
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
57805780
requirement = {
57815781
kind = exactVersion;
5782-
version = 4.0.3;
5782+
version = 4.0.4;
57835783
};
57845784
};
57855785
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {

Share/NCShareExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class NCShareExtension: UIViewController {
278278
}
279279

280280
@objc func actionCreateFolder() {
281-
let alertController = UIAlertController.createFolder(serverUrl: serverUrl, urlBase: activeAccount) { error in
281+
let alertController = UIAlertController.createFolder(serverUrl: serverUrl, userBaseUrl: activeAccount) { error in
282282
guard error != .success else { return }
283283
self.showAlert(title: "_error_createsubfolders_upload_", description: error.errorDescription)
284284
}

Widget/Dashboard/DashboardData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
168168
let titleImage = imagetmp
169169

170170
let options = NKRequestOptions(timeout: 90, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
171-
NextcloudKit.shared.getDashboardWidgetsApplication(id, options: options) { _, results, data, error in
171+
NextcloudKit.shared.getDashboardWidgetsApplication(id, account: account.account, options: options) { _, results, data, error in
172172
Task {
173173
var datas = [DashboardData]()
174174
var numberItems = 0
@@ -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)
228+
let (_, data, error) = await NCNetworking.shared.downloadPreview(url: url, account: account.account)
229229
if error == .success,
230230
let image = convertDataToImage(data: data, size: CGSize(width: 256, height: 256), fileNameToWrite: fileName) {
231231
icon = image

Widget/Files/FilesData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
190190
}
191191

192192
let options = NKRequestOptions(timeout: 30, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
193-
NextcloudKit.shared.searchBodyRequest(serverUrl: account.urlBase, requestBody: requestBody, showHiddenFiles: NCKeychain().showHiddenFiles, options: options) { _, files, data, error in
193+
NextcloudKit.shared.searchBodyRequest(serverUrl: account.urlBase, requestBody: requestBody, showHiddenFiles: NCKeychain().showHiddenFiles, account: account.account, options: options) { _, files, data, error in
194194
Task {
195195
var datas: [FilesData] = []
196196
let title = getTitleFilesWidget(account: account)
@@ -223,7 +223,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
223223
}
224224
if image == nil, file.hasPreview {
225225
let sizePreview = NCUtility().getSizePreview(width: Int(file.width), height: Int(file.height))
226-
let (_, _, imageIcon, _, _, _) = await NCNetworking.shared.downloadPreview(fileId: file.fileId, fileNamePreviewLocalPath: fileNamePreviewLocalPath, fileNameIconLocalPath: fileNameIconLocalPath, widthPreview: Int(sizePreview.width), heightPreview: Int(sizePreview.height), sizeIcon: NCGlobal.shared.sizeIcon, options: options)
226+
let (_, _, imageIcon, _, _, _) = await NCNetworking.shared.downloadPreview(fileId: file.fileId, fileNamePreviewLocalPath: fileNamePreviewLocalPath, fileNameIconLocalPath: fileNameIconLocalPath, widthPreview: Int(sizePreview.width), heightPreview: Int(sizePreview.height), sizeIcon: NCGlobal.shared.sizeIcon, account: account.account, options: options)
227227
image = imageIcon
228228
}
229229
if image == nil {

Widget/Lockscreen/LockscreenData.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
5252
account = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", accountIdentifier))
5353
}
5454

55-
guard let account = account else {
55+
guard let account else {
5656
return completion(LockscreenData(date: Date(), isPlaceholder: true, activity: "", link: URL(string: "https://")!, quotaRelative: 0, quotaUsed: "", quotaTotal: "", error: false))
5757
}
5858

@@ -78,7 +78,7 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
7878
let options = NKRequestOptions(timeout: 90, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
7979
if #available(iOSApplicationExtension 16.0, *) {
8080
if family == .accessoryCircular {
81-
NextcloudKit.shared.getUserProfile(options: options) { _, userProfile, _, error in
81+
NextcloudKit.shared.getUserProfile(account: account.account, options: options) { _, userProfile, _, error in
8282
if error == .success, let userProfile = userProfile {
8383
if userProfile.quotaRelative > 0 {
8484
quotaRelative = Float(userProfile.quotaRelative) / 100
@@ -102,7 +102,7 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
102102
}
103103
}
104104
} else if family == .accessoryRectangular {
105-
NextcloudKit.shared.getDashboardWidgetsApplication("activity", options: options) { _, results, _, error in
105+
NextcloudKit.shared.getDashboardWidgetsApplication("activity", account: account.account, options: options) { _, results, _, error in
106106
var activity: String = NSLocalizedString("_no_data_available_", comment: "")
107107
var link = URL(string: "https://")!
108108
if error == .success, let result = results?.first {

iOSClient/Activity/NCActivity.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class NCActivity: UIViewController, NCSharePagingContent {
8282
commentView = Bundle.main.loadNibNamed("NCActivityCommentView", owner: self, options: nil)?.first as? NCActivityCommentView
8383
commentView?.setup(urlBase: appDelegate, account: activeAccount) { newComment in
8484
guard let newComment = newComment, !newComment.isEmpty, let metadata = self.metadata else { return }
85-
NextcloudKit.shared.putComments(fileId: metadata.fileId, message: newComment) { _, error in
85+
NextcloudKit.shared.putComments(fileId: metadata.fileId, message: newComment, account: self.appDelegate.account) { _, error in
8686
if error == .success {
8787
self.commentView?.newCommentField.text?.removeAll()
8888
self.loadComments()
@@ -264,7 +264,7 @@ extension NCActivity: UITableViewDataSource {
264264
cell.icon.image = image.withTintColor(NCBrandColor.shared.textColor, renderingMode: .alwaysOriginal)
265265
}
266266
} else {
267-
NextcloudKit.shared.downloadContent(serverUrl: activity.icon) { _, data, error in
267+
NextcloudKit.shared.downloadContent(serverUrl: activity.icon, account: appDelegate.account) { _, data, error in
268268
if error == .success {
269269
do {
270270
try data!.write(to: NSURL(fileURLWithPath: fileNameLocalPath) as URL, options: .atomic)
@@ -393,7 +393,7 @@ extension NCActivity {
393393
guard showComments, let metadata = metadata else { return }
394394
disptachGroup?.enter()
395395

396-
NextcloudKit.shared.getComments(fileId: metadata.fileId) { _, comments, _, error in
396+
NextcloudKit.shared.getComments(fileId: metadata.fileId, account: metadata.account) { _, comments, _, error in
397397
if error == .success, let comments = comments {
398398
NCManageDatabase.shared.addComments(comments, account: metadata.account, objectId: metadata.fileId)
399399
} else if error.errorCode != NCGlobal.shared.errorResourceNotFound {
@@ -422,7 +422,8 @@ extension NCActivity {
422422
limit: 1,
423423
objectId: nil,
424424
objectType: objectType,
425-
previews: true) { task in
425+
previews: true,
426+
account: appDelegate.account) { task in
426427
self.dataSourceTask = task
427428
} completion: { account, _, activityFirstKnown, activityLastGiven, _, error in
428429
defer { disptachGroup.leave() }
@@ -450,7 +451,8 @@ extension NCActivity {
450451
limit: min(limit, 200),
451452
objectId: metadata?.fileId,
452453
objectType: objectType,
453-
previews: true) { task in
454+
previews: true,
455+
account: appDelegate.account) { task in
454456
self.dataSourceTask = task
455457
} completion: { account, activities, activityFirstKnown, activityLastGiven, _, error in
456458
defer { disptachGroup.leave() }
@@ -507,7 +509,7 @@ extension NCActivity: NCShareCommentsCellDelegate {
507509
alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in
508510
guard let message = alert.textFields?.first?.text, !message.isEmpty else { return }
509511

510-
NextcloudKit.shared.updateComments(fileId: metadata.fileId, messageId: tableComments.messageId, message: message) { _, error in
512+
NextcloudKit.shared.updateComments(fileId: metadata.fileId, messageId: tableComments.messageId, message: message, account: self.appDelegate.account) { _, error in
511513
if error == .success {
512514
self.loadComments()
513515
} else {
@@ -529,7 +531,7 @@ extension NCActivity: NCShareCommentsCellDelegate {
529531
action: { _ in
530532
guard let metadata = self.metadata, let tableComments = tableComments else { return }
531533

532-
NextcloudKit.shared.deleteComments(fileId: metadata.fileId, messageId: tableComments.messageId) { _, error in
534+
NextcloudKit.shared.deleteComments(fileId: metadata.fileId, messageId: tableComments.messageId, account: metadata.account) { _, error in
533535
if error == .success {
534536
self.loadComments()
535537
} else {

0 commit comments

Comments
 (0)