Kaynağa Gözat

Revert unrelated changes

- probably cause by rebase conflicts..?
+ fix file header

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 yıl önce
ebeveyn
işleme
5d8b9abb67

+ 16 - 1
iOSClient/Activity/NCActivityCommentView.swift

@@ -3,7 +3,22 @@
 //  Nextcloud
 //
 //  Created by Henrik Storch on 04.01.22.
-//  Copyright © 2022 Marino Faggiana. All rights reserved.
+//  Copyright © 2021 Henrik Storch. All rights reserved.
+//
+//  Author Henrik Storch <henrik.storch@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 import UIKit

+ 16 - 24
iOSClient/Menu/NCShare+Menu.swift

@@ -3,7 +3,22 @@
 //  Nextcloud
 //
 //  Created by Henrik Storch on 16.03.22.
-//  Copyright © 2022 Marino Faggiana. All rights reserved.
+//  Copyright © 2022 Henrik Storch. All rights reserved.
+//
+//  Author Henrik Storch <henrik.storch@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 import Foundation
@@ -24,17 +39,6 @@ extension NCShare {
                 )
             )
         }
-//        if !folder {
-//            actions.append(
-//                NCMenuAction(
-//                    title: NSLocalizedString("_open_in_", comment: ""),
-//                    icon: NCUtility.shared.loadImage(named: "viewInFolder").imageColor(NCBrandColor.shared.brandElement),
-//                    action: { menuAction in
-//                        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterShareViewIn)
-//                    }
-//                )
-//            )
-//        }
 
         actions.append(
             NCMenuAction(
@@ -52,18 +56,6 @@ extension NCShare {
             )
         )
 
-//        if sendMail {
-//            actions.append(
-//                NCMenuAction(
-//                    title: NSLocalizedString("_send_new_email_", comment: ""),
-//                    icon: NCUtility.shared.loadImage(named: "email").imageColor(NCBrandColor.shared.brandElement),
-//                    action: { menuAction in
-//                        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterShareSendEmail)
-//                    }
-//                )
-//            )
-//        }
-
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_share_unshare_", comment: ""),

+ 2 - 2
iOSClient/Menu/NCTrash+Menu.swift

@@ -109,7 +109,7 @@ extension NCTrash {
             iconHeader = icon
         } else {
             if tableTrash.directory {
-                iconHeader = UIImage(named: "folder")?.image(color: NCBrandColor.shared.gray, size: 50)
+                iconHeader = UIImage(named: "folder")!.image(color: NCBrandColor.shared.gray, size: 50)
             } else {
                 iconHeader = UIImage(named: tableTrash.iconName)
             }
@@ -126,7 +126,7 @@ extension NCTrash {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_restore_", comment: ""),
-                icon: NCUtility.shared.loadImage(named: "restore", color: NCBrandColor.shared.gray),
+                icon: UIImage(named: "restore")!.image(color: NCBrandColor.shared.gray, size: 50),
                 action: { _ in
                     self.restoreItem(with: objectId)
                 }

+ 7 - 7
iOSClient/RichWorkspace/NCViewerRichWorkspaceWebView.swift

@@ -41,8 +41,8 @@ class NCViewerRichWorkspaceWebView: UIViewController, WKNavigationDelegate, WKSc
 
         NotificationCenter.default.addObserver(self, selector: #selector(keyboardDidShow), name: UIResponder.keyboardDidShowNotification, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
-        guard let url = URL(string: url) else { return }
-        var request = URLRequest(url: url)
+
+        var request = URLRequest(url: URL(string: url)!)
         request.addValue("true", forHTTPHeaderField: "OCS-APIRequest")
         let language = NSLocale.preferredLanguages[0] as String
         request.addValue(language, forHTTPHeaderField: "Accept-Language")
@@ -54,7 +54,7 @@ class NCViewerRichWorkspaceWebView: UIViewController, WKNavigationDelegate, WKSc
     }
 
     @objc func keyboardDidShow(notification: Notification) {
-        let safeAreaInsetsBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
+        let safeAreaInsetsBottom = UIApplication.shared.keyWindow!.safeAreaInsets.bottom
         guard let info = notification.userInfo else { return }
         guard let frameInfo = info[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else { return }
         let keyboardFrame = frameInfo.cgRectValue
@@ -73,8 +73,8 @@ class NCViewerRichWorkspaceWebView: UIViewController, WKNavigationDelegate, WKSc
 
             if message.body as? String == "close" {
 
-                if #available(iOS 13.0, *), let presentationController = self.presentationController {
-                    self.presentationController?.delegate?.presentationControllerWillDismiss?(presentationController)
+                if #available(iOS 13.0, *) {
+                    self.presentationController?.delegate?.presentationControllerWillDismiss?(self.presentationController!)
                 }
 
                 dismiss(animated: true) {
@@ -83,8 +83,8 @@ class NCViewerRichWorkspaceWebView: UIViewController, WKNavigationDelegate, WKSc
             }
 
             if message.body as? String == "share" {
-                if let metadata = metadata {
-                    NCFunctionCenter.shared.openShare(viewController: self, metadata: metadata, indexPage: .sharing)
+                if metadata != nil {
+                    NCFunctionCenter.shared.openShare(viewController: self, metadata: metadata!, indexPage: .sharing)
                 }
             }
 

+ 1 - 1
iOSClient/Share/Advanced/NCShareCells.swift

@@ -1,5 +1,5 @@
 //
-//  ShareCells.swift
+//  NCShareCells.swift
 //  Nextcloud
 //
 //  Created by Henrik Storch on 18.03.22.

+ 2 - 0
iOSClient/Share/NCShareNetworking.swift

@@ -67,6 +67,8 @@ class NCShareNetworking: NSObject {
         // NOTE: Permissions don't work for file drop!
         // https://github.com/nextcloud/server/issues/17504
 
+        // NOTE: Can't save label, expirationDate, and note, until library update
+        // https://github.com/nextcloud/ios-communication-library/pull/104
         NCUtility.shared.startActivityIndicator(backgroundView: view, blurEffect: false)
         let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase, account: metadata.account)!
         let permission = max(1, metadata.sharePermissionsCollaborationServices & option.permissions)

+ 16 - 1
iOSClient/Utility/NCUtility+Image.swift

@@ -3,7 +3,22 @@
 //  Nextcloud
 //
 //  Created by Henrik Storch on 17.03.22.
-//  Copyright © 2022 Marino Faggiana. All rights reserved.
+//  Copyright © 2022 Henrik Storch. All rights reserved.
+//
+//  Author Henrik Storch <henrik.storch@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 import UIKit