Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
F72CA05C2F5051DB002E2F06 /* AlertActionBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CA05B2F5051DB002E2F06 /* AlertActionBannerView.swift */; };
F72CD63A25C19EBF00F46F9A /* NCAutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */; };
F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */; };
F72D404923D2082500A97FD0 /* NCViewerDirectEditing.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72D404823D2082500A97FD0 /* NCViewerDirectEditing.swift */; };
F72D7EB7263B1207000B3DFC /* MarkdownKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72D7EB6263B1207000B3DFC /* MarkdownKit */; };
F72DA9B425F53E4E00B87DB1 /* SwiftRichString in Frameworks */ = {isa = PBXBuildFile; productRef = F72DA9B325F53E4E00B87DB1 /* SwiftRichString */; };
F72EA95228B7BA2A00C88F0C /* DashboardWidgetProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72EA95128B7BA2A00C88F0C /* DashboardWidgetProvider.swift */; };
Expand Down Expand Up @@ -339,7 +339,7 @@
F7386E482DA90E0F009A00F6 /* NCAppVersionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7386E452DA90E02009A00F6 /* NCAppVersionManager.swift */; };
F73BC74F2F23811E003170C2 /* WarningBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DF7B3E2F1A2EE400514020 /* WarningBannerView.swift */; };
F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F73CB3B122E072A000AD728E /* NCShareHeaderView.xib */; };
F73D11FA253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D11F9253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard */; };
F73D11FA253C5F4800DF9BEC /* NCViewerDirectEditing.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D11F9253C5F4800DF9BEC /* NCViewerDirectEditing.storyboard */; };
F73EF7A72B0223900087E6E9 /* NCManageDatabase+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73EF7A62B0223900087E6E9 /* NCManageDatabase+Comments.swift */; };
F73EF7A82B0223900087E6E9 /* NCManageDatabase+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73EF7A62B0223900087E6E9 /* NCManageDatabase+Comments.swift */; };
F73EF7A92B0223900087E6E9 /* NCManageDatabase+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73EF7A62B0223900087E6E9 /* NCManageDatabase+Comments.swift */; };
Expand Down Expand Up @@ -430,6 +430,7 @@
F758B45A212C564000515F55 /* NCScan.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F758B457212C564000515F55 /* NCScan.storyboard */; };
F758B45E212C569D00515F55 /* NCScanCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F758B45D212C569C00515F55 /* NCScanCell.swift */; };
F758B460212C56A400515F55 /* NCScan.swift in Sources */ = {isa = PBXBuildFile; fileRef = F758B45F212C56A400515F55 /* NCScan.swift */; };
F75A60552FB4493A00F8247E /* NCDirectEditorAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A60542FB4493A00F8247E /* NCDirectEditorAdapter.swift */; };
F75A9EE623796C6F0044CFCE /* NCNetworking.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A9EE523796C6F0044CFCE /* NCNetworking.swift */; };
F75A9EE723796C6F0044CFCE /* NCNetworking.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A9EE523796C6F0044CFCE /* NCNetworking.swift */; };
F75C0C4823D1FAE300163CC8 /* NCRichWorkspaceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75C0C4723D1FAE300163CC8 /* NCRichWorkspaceCommon.swift */; };
Expand Down Expand Up @@ -1370,7 +1371,7 @@
F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUpload.swift; sourceTree = "<group>"; };
F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCPushNotificationEncryption.m; sourceTree = "<group>"; };
F72D1006210B6882009C96B7 /* NCPushNotificationEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCPushNotificationEncryption.h; sourceTree = "<group>"; };
F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerNextcloudText.swift; sourceTree = "<group>"; };
F72D404823D2082500A97FD0 /* NCViewerDirectEditing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerDirectEditing.swift; sourceTree = "<group>"; };
F72EA95128B7BA2A00C88F0C /* DashboardWidgetProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardWidgetProvider.swift; sourceTree = "<group>"; };
F72EA95328B7BABA00C88F0C /* FilesWidgetProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesWidgetProvider.swift; sourceTree = "<group>"; };
F72EA95728B7BC4F00C88F0C /* FilesData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesData.swift; sourceTree = "<group>"; };
Expand All @@ -1397,7 +1398,7 @@
F7386E452DA90E02009A00F6 /* NCAppVersionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAppVersionManager.swift; sourceTree = "<group>"; };
F73CB3B122E072A000AD728E /* NCShareHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCShareHeaderView.xib; sourceTree = "<group>"; };
F73CB5771ED46807005F2A5A /* NCBridgeSwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCBridgeSwift.h; sourceTree = "<group>"; };
F73D11F9253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerNextcloudText.storyboard; sourceTree = "<group>"; };
F73D11F9253C5F4800DF9BEC /* NCViewerDirectEditing.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerDirectEditing.storyboard; sourceTree = "<group>"; };
F73EF7A62B0223900087E6E9 /* NCManageDatabase+Comments.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Comments.swift"; sourceTree = "<group>"; };
F73EF7B62B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+ExternalSites.swift"; sourceTree = "<group>"; };
F73EF7BE2B02250B0087E6E9 /* NCManageDatabase+GPS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+GPS.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1435,6 +1436,7 @@
F758B457212C564000515F55 /* NCScan.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCScan.storyboard; sourceTree = "<group>"; };
F758B45D212C569C00515F55 /* NCScanCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCScanCell.swift; sourceTree = "<group>"; };
F758B45F212C56A400515F55 /* NCScan.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCScan.swift; sourceTree = "<group>"; };
F75A60542FB4493A00F8247E /* NCDirectEditorAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCDirectEditorAdapter.swift; sourceTree = "<group>"; };
F75A9EE523796C6F0044CFCE /* NCNetworking.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCNetworking.swift; sourceTree = "<group>"; };
F75B91E21ECAE17800199C96 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
F75B91F71ECAE26300199C96 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2421,13 +2423,14 @@
path = Offline;
sourceTree = "<group>";
};
F73D11FF253C5F5400DF9BEC /* NCViewerNextcloudText */ = {
F73D11FF253C5F5400DF9BEC /* NCViewerDirectEditing */ = {
isa = PBXGroup;
children = (
F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */,
F73D11F9253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard */,
F75A60542FB4493A00F8247E /* NCDirectEditorAdapter.swift */,
F72D404823D2082500A97FD0 /* NCViewerDirectEditing.swift */,
F73D11F9253C5F4800DF9BEC /* NCViewerDirectEditing.storyboard */,
);
path = NCViewerNextcloudText;
path = NCViewerDirectEditing;
sourceTree = "<group>";
};
F74D3DB81BAC1941000BAE4B /* Networking */ = {
Expand Down Expand Up @@ -2782,7 +2785,7 @@
F79018B1240962C7007C9B6D /* NCViewerMedia */,
F723986A253C9C0E00257F49 /* NCViewerQuickLook */,
F76D3CEF2428B3DD005DFA87 /* NCViewerPDF */,
F73D11FF253C5F5400DF9BEC /* NCViewerNextcloudText */,
F73D11FF253C5F5400DF9BEC /* NCViewerDirectEditing */,
F7239861253C95D500257F49 /* NCViewerRichdocument */,
);
path = Viewer;
Expand Down Expand Up @@ -3992,7 +3995,7 @@
F704B5E32430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard in Resources */,
F7EDE509262DA9D600414FE6 /* NCSelectCommandViewSelect.xib in Resources */,
F732D23327CF8AED000B0F1B /* NCPlayerToolBar.xib in Resources */,
F73D11FA253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard in Resources */,
F73D11FA253C5F4800DF9BEC /* NCViewerDirectEditing.storyboard in Resources */,
F7EDE51B262DD0C400414FE6 /* NCSelectCommandViewCopyMove.xib in Resources */,
F7FF2CB12842159500EBB7A1 /* NCSectionHeader.xib in Resources */,
F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */,
Expand Down Expand Up @@ -4544,7 +4547,7 @@
F7D60CAF2C941ACB008FBFDD /* NCMediaPinchGesture.swift in Sources */,
F71916142E2901FB00E13E96 /* NCNetworking+Upload.swift in Sources */,
F704B5E92430C0B800632F5F /* NCCreateFormUploadConflictCell.swift in Sources */,
F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */,
F72D404923D2082500A97FD0 /* NCViewerDirectEditing.swift in Sources */,
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */,
F77BB746289984CA0090FC19 /* UIViewController+Extension.swift in Sources */,
F700510522DF6A89003A3356 /* NCShare.swift in Sources */,
Expand Down Expand Up @@ -4784,6 +4787,7 @@
F7D61EA82EBF1694007F865B /* NCManageDatabase+TableCapabilities.swift in Sources */,
F79FFB262A97C24A0055EEA4 /* NCNetworkingE2EEMarkFolder.swift in Sources */,
F70D8D8124A4A9BF000A5756 /* NCNetworkingProcess.swift in Sources */,
F75A60552FB4493A00F8247E /* NCDirectEditorAdapter.swift in Sources */,
F3A0479A2BD2668800658E7B /* NCAssistantTaskDetail.swift in Sources */,
F71D2FB72E09BBD700B751CC /* NCAutoUploadModel.swift in Sources */,
F38F71252B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift in Sources */,
Expand Down Expand Up @@ -6132,8 +6136,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
requirement = {
kind = exactVersion;
version = 7.3.1;
branch = main;
kind = branch;
};
};
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
Expand Down
13 changes: 4 additions & 9 deletions iOSClient/Data/NCManageDatabase+Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,8 @@ extension tableMetadata {
directEditingEditors.isEmpty {
// RichDocument: Collabora
return true
} else if directEditingEditors.contains("nextcloud text") || directEditingEditors.contains("onlyoffice") {
// DirectEditing: Nextcloud Text - OnlyOffice
return true
} else if !directEditingEditors.isEmpty {
return true
}
return false
}
Expand All @@ -282,12 +281,8 @@ extension tableMetadata {
guard (classFile == NKTypeClassFile.document.rawValue) && NextcloudKit.shared.isNetworkReachable() else {
return false
}
let editors = NCUtility().editorsDirectEditing(account: account, contentType: contentType).map { $0.lowercased() }

if editors.contains("nextcloud text") || editors.contains("onlyoffice") {
return true
}
return false
let editors = NCUtility().editorsDirectEditing(account: account, contentType: contentType)
return !editors.isEmpty
}

var isPDF: Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import UIKit
import UniformTypeIdentifiers
import NextcloudKit
import RealmSwift
import LucidBanner
Expand Down Expand Up @@ -70,7 +71,14 @@ extension NCCollectionViewCommon: UIEditMenuInteractionDelegate {
for (index, items) in UIPasteboard.general.items.enumerated() {
for item in items {
let capabilities = await NKCapabilities.shared.getCapabilities(for: session.account)
let results = NKFilePropertyResolver().resolve(inUTI: item.key, capabilities: capabilities)
let identifier = item.key
let resolvedType = UTType(mimeType: identifier) ?? UTType(identifier)
let resolvedMimeType = resolvedType?.preferredMIMEType ?? identifier
let resolvedExtension = resolvedType?.preferredFilenameExtension ?? ""
let results = NKFilePropertyResolver().resolve(mimeType: resolvedMimeType,
fileExtension: resolvedExtension,
typeIdentifier: resolvedType?.identifier ?? identifier,
capabilities: capabilities)
guard let data = UIPasteboard.general.data(forPasteboardType: item.key,
inItemSet: IndexSet([index]))?.first
else {
Expand Down
27 changes: 5 additions & 22 deletions iOSClient/Main/Create/NCCreate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ class NCCreate: NSObject {
var options = NKRequestOptions()
let serverUrl = controller.currentServerUrl()

if let creatorId, editorId == "text" || editorId == "onlyoffice" {
if editorId == "onlyoffice" {
options = NKRequestOptions(customUserAgent: NCUtility().getCustomUserAgentOnlyOffice())
} else if editorId == "text" {
options = NKRequestOptions(customUserAgent: NCUtility().getCustomUserAgentNCText())
}
if let creatorId, let adapter = NCDirectEditorAdapter.resolve(from: [editorId]) {
options = NKRequestOptions(customUserAgent: adapter.userAgent(utility))
let results = await NextcloudKit.shared.textCreateFileAsync(fileNamePath: fileNamePath, editorId: editorId, creatorId: creatorId, templateId: templateId, account: account, options: options) { task in
Task {
let identifier = await NCNetworking.shared.networkingTasks.createIdentifier(account: account,
Expand Down Expand Up @@ -94,13 +90,8 @@ class NCCreate: NSObject {
var selectedTemplate = NKEditorTemplate()
var ext: String = ""

if editorId == "text" || editorId == "onlyoffice" {
var options = NKRequestOptions()
if editorId == "onlyoffice" {
options = NKRequestOptions(customUserAgent: NCUtility().getCustomUserAgentOnlyOffice())
} else if editorId == "text" {
options = NKRequestOptions(customUserAgent: NCUtility().getCustomUserAgentNCText())
}
if let adapter = NCDirectEditorAdapter.resolve(from: [editorId]) {
let options = NKRequestOptions(customUserAgent: adapter.userAgent(NCUtility()))

let results = await NextcloudKit.shared.textGetListOfTemplatesAsync(account: account, options: options) { task in
Task {
Expand Down Expand Up @@ -128,15 +119,7 @@ class NCCreate: NSObject {
if templates.isEmpty {
var temp = NKEditorTemplate()
temp.identifier = ""
if editorId == "text" {
temp.ext = "md"
} else if editorId == "onlyoffice" && templateId == "document" {
temp.ext = "docx"
} else if editorId == "onlyoffice" && templateId == "spreadsheet" {
temp.ext = "xlsx"
} else if editorId == "onlyoffice" && templateId == "presentation" {
temp.ext = "pptx"
}
temp.ext = adapter.defaultExt(templateId)
temp.name = "Empty"
temp.preview = ""
templates.append(temp)
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Main/NCMainNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class NCMainNavigationController: UINavigationController, UINavigationController
!(topViewController is NCViewerMediaPage),
!(topViewController is NCViewerPDF),
!(topViewController is NCViewerRichDocument),
!(topViewController is NCViewerNextcloudText)
!(topViewController is NCViewerDirectEditing)
else {
return
}
Expand Down
Loading
Loading