Skip to content

Commit 494ae68

Browse files
committed
- update SDK to fix an issue arising from Available Offline policies targeting unavailable/detached drives and removes the respective policies
- adapt app code to SDK API changes
1 parent 221fa07 commit 494ae68

File tree

10 files changed

+15
-10
lines changed

10 files changed

+15
-10
lines changed

ios-sdk

Submodule ios-sdk updated 36 files

ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme

+5
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@
482482
value = "false"
483483
isEnabled = "NO">
484484
</EnvironmentVariable>
485+
<EnvironmentVariable
486+
key = "oc:http.traffic-log-format"
487+
value = "string:plain"
488+
isEnabled = "YES">
489+
</EnvironmentVariable>
485490
</EnvironmentVariables>
486491
<AdditionalOptions>
487492
<AdditionalOption

ownCloudAppShared/Client/Actions/Action.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class ActionExtension: OCExtension {
9292

9393
public extension OCItem {
9494
func isSharedWithUser(in context: ClientContext?) -> Bool {
95-
if let context, let core = context.core, core.useDrives, let driveID, let drive = core.drive(withIdentifier: driveID) {
95+
if let context, let core = context.core, core.useDrives, let driveID, let drive = core.drive(withIdentifier: driveID, attachedOnly: true) {
9696
// On drive-based instances, all items shared with the user are located in the Shares Jail
9797
if drive.specialType == .shares {
9898
return true

ownCloudAppShared/Client/Collection Views/Cells/UniversalItemListCell Content Providers/OCItemPolicy+UniversalItemListCellContentProvider.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension OCItemPolicy: UniversalItemListCellContentProvider {
2828
content.icon = isFile ? .file : ((location?.isDriveRoot == true) ? .drive : .folder)
2929

3030
// Title
31-
if location?.isDriveRoot == true, let driveID = location?.driveID, let drive = context?.core?.drive(withIdentifier: driveID), let driveName = drive.name {
31+
if location?.isDriveRoot == true, let driveID = location?.driveID, let drive = context?.core?.drive(withIdentifier: driveID, attachedOnly: false), let driveName = drive.name {
3232
content.title = .drive(name: driveName)
3333
} else if let name = location?.lastPathComponent {
3434
content.title = isFile ? .file(name: name) : .folder(name: name)

ownCloudAppShared/Client/Collection Views/Cells/UniversalItemListCell Content Providers/OCShare+UniversalItemListCellContentProvider.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extension OCShare: UniversalItemListCellContentProvider {
3030

3131
// Title
3232
if !showManagementView {
33-
if itemLocation.isDriveRoot, let driveID = itemLocation.driveID, let drive = context?.core?.drive(withIdentifier: driveID), let driveName = drive.name {
33+
if itemLocation.isDriveRoot, let driveID = itemLocation.driveID, let drive = context?.core?.drive(withIdentifier: driveID, attachedOnly: false), let driveName = drive.name {
3434
content.title = .drive(name: driveName)
3535
} else if let name = itemLocation.lastPathComponent {
3636
content.title = isFile ? .file(name: name) : .folder(name: name)

ownCloudAppShared/Client/Data Item Interactions/OCLocation+Interactions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension OCLocation : DataItemSelectionInteraction {
2525
public func openItem(from viewController: UIViewController?, with context: ClientContext?, animated: Bool, pushViewController: Bool, completion: ((Bool) -> Void)?) -> UIViewController? {
2626
let driveContext = ClientContext(with: context, modifier: { context in
2727
if let driveID = self.driveID, let core = context.core {
28-
context.drive = core.drive(withIdentifier: driveID)
28+
context.drive = core.drive(withIdentifier: driveID, attachedOnly: false)
2929
}
3030
})
3131
let query = OCQuery(for: self)

ownCloudAppShared/Client/View Controllers/ClientItemViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ open class ClientItemViewController: CollectionViewController, SortBarDelegate,
126126

127127
// Set .drive based on location.driveID
128128
if let driveID = location?.driveID, let core = context.core {
129-
context.drive = core.drive(withIdentifier: driveID)
129+
context.drive = core.drive(withIdentifier: driveID, attachedOnly: false)
130130
}
131131

132132
// Use inDataSource as queryDatasource if no query was provided

ownCloudAppShared/Client/View Controllers/Location Breadcrumbs/OCLocation+Breadcrumbs.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public extension OCLocation {
3333
func displayName(in context: ClientContext?) -> String {
3434
switch type {
3535
case .drive:
36-
if let core = context?.core, let driveID, let drive = core.drive(withIdentifier: driveID), let driveName = drive.name {
36+
if let core = context?.core, let driveID, let drive = core.drive(withIdentifier: driveID, attachedOnly: false), let driveName = drive.name {
3737
return driveName
3838
}
3939
return "Space".localized
@@ -62,7 +62,7 @@ public extension OCLocation {
6262
func displayIcon(in context: ClientContext?, forSidebar: Bool = false) -> UIImage? {
6363
switch type {
6464
case .drive:
65-
if let core = context?.core, let driveID, let drive = core.drive(withIdentifier: driveID), let specialType = drive.specialType {
65+
if let core = context?.core, let driveID, let drive = core.drive(withIdentifier: driveID, attachedOnly: false), let specialType = drive.specialType {
6666
switch specialType {
6767
case .personal:
6868
return OCSymbol.icon(forSymbolName: forSidebar ? "person" : "person.fill")

ownCloudAppShared/Client/View Controllers/Location Picker/ClientLocationPicker.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public class ClientLocationPicker : NSObject {
275275

276276
case .drive:
277277
if let driveID = location.driveID {
278-
title = context.core?.drive(withIdentifier: driveID)?.name
278+
title = context.core?.drive(withIdentifier: driveID, attachedOnly: false)?.name
279279
}
280280

281281
case .folder: break

ownCloudAppShared/User Interface/More/MoreViewHeader.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ open class MoreViewHeader: UIView {
181181

182182
if item.isRoot {
183183
if let core, core.useDrives, let driveID = item.driveID {
184-
if let drive = core.drive(withIdentifier: driveID) {
184+
if let drive = core.drive(withIdentifier: driveID, attachedOnly: false) {
185185
itemName = drive.name
186186
}
187187
} else {

0 commit comments

Comments
 (0)