Przeglądaj źródła

change message metadata -> ocId

marinofaggiana 4 lat temu
rodzic
commit
e1e0fbc593

+ 8 - 8
iOSClient/CCGlobal.h

@@ -331,14 +331,14 @@
 
 #define k_notificationCenter_progressTask               @"progressTask"                     // userInfo: account, ocId, serverUrl, status, progress, totalBytes, totalBytesExpected
 
-#define k_notificationCenter_createFolder               @"createFolder"                     // userInfo: metadata
-#define k_notificationCenter_deleteFile                 @"deleteFile"                       // userInfo: metadata, onlyLocal
-#define k_notificationCenter_renameFile                 @"renameFile"                       // userInfo: metadata, errorCode, errorDescription
-#define k_notificationCenter_moveFile                   @"moveFile"                         // userInfo: metadata, metadataNew
-#define k_notificationCenter_copyFile                   @"copyFile"                         // userInfo: metadata, serverUrlTo
-#define k_notificationCenter_favoriteFile               @"favoriteFile"                     // userInfo: metadata
+#define k_notificationCenter_createFolder               @"createFolder"                     // userInfo: ocId
+#define k_notificationCenter_deleteFile                 @"deleteFile"                       // userInfo: ocId, onlyLocal
+#define k_notificationCenter_renameFile                 @"renameFile"                       // userInfo: ocId, errorCode, errorDescription
+#define k_notificationCenter_moveFile                   @"moveFile"                         // userInfo: ocId, metadataNew
+#define k_notificationCenter_copyFile                   @"copyFile"                         // userInfo: ocId, serverUrlTo
+#define k_notificationCenter_favoriteFile               @"favoriteFile"                     // userInfo: ocId
 
 #define k_notificationCenter_menuSearchTextPDF          @"menuSearchTextPDF"
-#define k_notificationCenter_menuDownloadImage          @"menuDownloadImage"                // userInfo: metadata
-#define k_notificationCenter_menuSaveLivePhoto          @"menuSaveLivePhoto"                // userInfo: metadata, metadataMov
+#define k_notificationCenter_menuDownloadImage          @"menuDownloadImage"                // userInfo: ocId
+#define k_notificationCenter_menuSaveLivePhoto          @"menuSaveLivePhoto"                // userInfo: ocId, metadataMov
 #define k_notificationCenter_menuDetailClose            @"menuDetailClose"

+ 47 - 43
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -279,20 +279,21 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let onlyLocal = userInfo["onlyLocal"] as? Bool {
-                
-                if onlyLocal {
-                    reloadDataSource()
-                } else if metadata.fileNameView.lowercased() == k_fileNameRichWorkspace.lowercased() {
-                    reloadDataSourceNetwork(forced: true)
-                } else {
-                    if let row = dataSource.deleteMetadata(ocId: metadata.ocId) {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.performBatchUpdates({
-                            collectionView?.deleteItems(at: [indexPath])
-                        }, completion: { (_) in
-                            self.collectionView?.reloadData()
-                        })
+            if let ocId = userInfo["ocId"] as? String, let onlyLocal = userInfo["onlyLocal"] as? Bool {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if onlyLocal {
+                        reloadDataSource()
+                    } else if metadata.fileNameView.lowercased() == k_fileNameRichWorkspace.lowercased() {
+                        reloadDataSourceNetwork(forced: true)
+                    } else {
+                        if let row = dataSource.deleteMetadata(ocId: metadata.ocId) {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.performBatchUpdates({
+                                collectionView?.deleteItems(at: [indexPath])
+                            }, completion: { (_) in
+                                self.collectionView?.reloadData()
+                            })
+                        }
                     }
                 }
             }
@@ -303,25 +304,26 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let metadataNew = userInfo["metadataNew"] as? tableMetadata {
-                
-                if metadata.serverUrl == serverUrl && metadata.account == appDelegate.account {
-                    if let row = dataSource.deleteMetadata(ocId: metadata.ocId) {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.performBatchUpdates({
-                            collectionView?.deleteItems(at: [indexPath])
-                        }, completion: { (_) in
-                            self.collectionView?.reloadData()
-                        })
-                    }
-                } else if metadataNew.serverUrl == serverUrl && metadata.account == appDelegate.account {
-                    if let row = dataSource.addMetadata(metadataNew) {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.performBatchUpdates({
-                            collectionView?.insertItems(at: [indexPath])
-                        }, completion: { (_) in
-                            self.collectionView?.reloadData()
-                        })
+            if let ocId = userInfo["ocId"] as? String, let ocIdNew = userInfo["ocIdNew"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId), let metadataNew = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocIdNew) {
+                    if metadata.serverUrl == serverUrl && metadata.account == appDelegate.account {
+                        if let row = dataSource.deleteMetadata(ocId: metadata.ocId) {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.performBatchUpdates({
+                                collectionView?.deleteItems(at: [indexPath])
+                            }, completion: { (_) in
+                                self.collectionView?.reloadData()
+                            })
+                        }
+                    } else if metadataNew.serverUrl == serverUrl && metadata.account == appDelegate.account {
+                        if let row = dataSource.addMetadata(metadataNew) {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.performBatchUpdates({
+                                collectionView?.insertItems(at: [indexPath])
+                            }, completion: { (_) in
+                                self.collectionView?.reloadData()
+                            })
+                        }
                     }
                 }
             }
@@ -350,15 +352,17 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.serverUrl == serverUrl && metadata.account == appDelegate.account {
-                    if let row = dataSource.addMetadata(metadata) {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.performBatchUpdates({
-                            collectionView?.insertItems(at: [indexPath])
-                        }, completion: { (_) in
-                            self.collectionView?.reloadData()
-                        })
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.serverUrl == serverUrl && metadata.account == appDelegate.account {
+                        if let row = dataSource.addMetadata(metadata) {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.performBatchUpdates({
+                                collectionView?.insertItems(at: [indexPath])
+                            }, completion: { (_) in
+                                self.collectionView?.reloadData()
+                            })
+                        }
                     }
                 }
             }
@@ -371,7 +375,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
+            if let ocId = userInfo["ocId"] as? String, let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
                 if dataSource.getIndexMetadata(ocId: metadata.ocId) != nil {
                     reloadDataSource()
                 }

+ 2 - 2
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -271,7 +271,7 @@ extension NCDetailNavigationController {
                     NCMenuAction(title: NSLocalizedString("_download_image_max_", comment: ""),
                         icon: CCGraphics.changeThemingColorImage(UIImage(named: "downloadImageFullRes"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                         action: { menuAction in
-                            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuDownloadImage, userInfo: ["metadata": metadata])
+                            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuDownloadImage, userInfo: ["ocId": metadata.ocId])
                         }
                     )
                 )
@@ -285,7 +285,7 @@ extension NCDetailNavigationController {
                         NCMenuAction(title: NSLocalizedString("_livephoto_save_", comment: ""),
                             icon: CCGraphics.changeThemingColorImage(UIImage(named: "livePhoto"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                             action: { menuAction in
-                                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuSaveLivePhoto, userInfo: ["metadata": metadata, "metadataMov": metadataLive])
+                                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuSaveLivePhoto, userInfo: ["ocId": metadata.ocId, "ocIdMov": metadataLive.ocId])
                             }
                         )
                     )

+ 61 - 55
iOSClient/Main/NCDetailViewController.swift

@@ -201,27 +201,29 @@ class NCDetailViewController: UIViewController {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let metadataNew = userInfo["metadataNew"] as? tableMetadata {
-                if metadata.account != self.metadata?.account { return }
-                
-                // IMAGE
-                if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
-                    
-                    viewImage()
-                }
-                
-                // OTHER
-                if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadataNew.ocId == self.metadata?.ocId {
+            if let ocId = userInfo["ocId"] as? String, let ocIdNew = userInfo["ocIdNew"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId), let metadataNew = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocIdNew) {
+                    if metadata.account != self.metadata?.account { return }
                     
-                    self.metadata = metadataNew
+                    // IMAGE
+                    if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
+                        
+                        viewImage()
+                    }
                     
-                    // update subview
-                    for view in backgroundView.subviews {
-                        if view is NCViewerNextcloudText {
-                            (view as! NCViewerNextcloudText).metadata = self.metadata
-                        }
-                        else if view is NCViewerRichdocument {
-                            (view as! NCViewerRichdocument).metadata = self.metadata
+                    // OTHER
+                    if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadataNew.ocId == self.metadata?.ocId {
+                        
+                        self.metadata = metadataNew
+                        
+                        // update subview
+                        for view in backgroundView.subviews {
+                            if view is NCViewerNextcloudText {
+                                (view as! NCViewerNextcloudText).metadata = self.metadata
+                            }
+                            else if view is NCViewerRichdocument {
+                                (view as! NCViewerRichdocument).metadata = self.metadata
+                            }
                         }
                     }
                 }
@@ -233,29 +235,31 @@ class NCDetailViewController: UIViewController {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.account != self.metadata?.account || metadata.serverUrl != self.metadata?.serverUrl { return }
-                                    
-                // IMAGE
-                if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
-                
-                    let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
-                    if metadatas.count > 0 {
-                        if self.metadata?.ocId == metadata.ocId {
-                            var index = viewerImageViewController!.index - 1
-                            if index < 0 { index = 0}
-                            self.metadata = metadatas[index]
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.account != self.metadata?.account || metadata.serverUrl != self.metadata?.serverUrl { return }
+                                        
+                    // IMAGE
+                    if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
+                    
+                        let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
+                        if metadatas.count > 0 {
+                            if self.metadata?.ocId == metadata.ocId {
+                                var index = viewerImageViewController!.index - 1
+                                if index < 0 { index = 0}
+                                self.metadata = metadatas[index]
+                            }
+                            viewImage()
+                        } else {
+                            viewUnload()
                         }
-                        viewImage()
-                    } else {
+                    }
+                    
+                    // OTHER
+                    if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadata.ocId == self.metadata?.ocId {
                         viewUnload()
                     }
                 }
-                
-                // OTHER
-                if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadata.ocId == self.metadata?.ocId {
-                    viewUnload()
-                }
             }
         }
     }
@@ -264,23 +268,25 @@ class NCDetailViewController: UIViewController {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.account != self.metadata?.account || metadata.serverUrl != self.metadata?.serverUrl { return }
-                
-                // IMAGE
-                if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.account != self.metadata?.account || metadata.serverUrl != self.metadata?.serverUrl { return }
                     
-                    viewImage()
-                }
-                
-                // OTHER
-                if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadata.ocId == self.metadata?.ocId {
+                    // IMAGE
+                    if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
+                        
+                        viewImage()
+                    }
                     
-                    if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadata.ocId) {
-                        self.metadata = metadata
-                        self.navigationController?.navigationBar.topItem?.title = metadata.fileNameView
-                    } else {
-                        viewUnload()
+                    // OTHER
+                    if (metadata.typeFile == k_metadataTypeFile_document || metadata.typeFile == k_metadataTypeFile_unknown) && metadata.ocId == self.metadata?.ocId {
+                        
+                        if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadata.ocId) {
+                            self.metadata = metadata
+                            self.navigationController?.navigationBar.topItem?.title = metadata.fileNameView
+                        } else {
+                            viewUnload()
+                        }
                     }
                 }
             }
@@ -324,7 +330,7 @@ class NCDetailViewController: UIViewController {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
+            if let ocId = userInfo["ocId"] as? String, let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
 
                 NCNetworking.shared.download(metadata: metadata, selector: "") { (_) in }
 
@@ -339,7 +345,7 @@ class NCDetailViewController: UIViewController {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let metadataMov = userInfo["metadataMov"] as? tableMetadata {
+            if let ocId = userInfo["ocId"] as? String, let ocIdMov = userInfo["ocIdMov"] as? String, let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId), let metadataMov = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocIdMov) {
                 let fileNameImage = URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!)
                 let fileNameMov = URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadataMov.ocId, fileNameView: metadataMov.fileNameView)!)
                 

+ 37 - 31
iOSClient/Media/NCMedia.swift

@@ -397,21 +397,23 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.account == appDelegate.account {
-                    
-                    let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
-                    let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
-                    self.metadatas = metadatas
-                    
-                    if self.metadatas.count == 0 {
-                        collectionView?.reloadData()
-                    } else if let row = indexes.first {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.deleteItems(at: [indexPath])
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.account == appDelegate.account {
+                        
+                        let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
+                        let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
+                        self.metadatas = metadatas
+                        
+                        if self.metadatas.count == 0 {
+                            collectionView?.reloadData()
+                        } else if let row = indexes.first {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.deleteItems(at: [indexPath])
+                        }
+                        
+                        self.updateMediaControlVisibility()
                     }
-                    
-                    self.updateMediaControlVisibility()
                 }
             }
         }
@@ -421,21 +423,23 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.account == appDelegate.account {
-                    
-                    let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
-                    let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
-                    self.metadatas = metadatas
-                    
-                    if self.metadatas.count == 0 {
-                        collectionView?.reloadData()
-                    } else if let row = indexes.first {
-                        let indexPath = IndexPath(row: row, section: 0)
-                        collectionView?.deleteItems(at: [indexPath])
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.account == appDelegate.account {
+                        
+                        let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
+                        let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
+                        self.metadatas = metadatas
+                        
+                        if self.metadatas.count == 0 {
+                            collectionView?.reloadData()
+                        } else if let row = indexes.first {
+                            let indexPath = IndexPath(row: row, section: 0)
+                            collectionView?.deleteItems(at: [indexPath])
+                        }
+                        
+                        self.updateMediaControlVisibility()
                     }
-                    
-                    self.updateMediaControlVisibility()
                 }
             }
         }
@@ -445,9 +449,11 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata {
-                if metadata.account == appDelegate.account {
-                    self.reloadDataSource()
+            if let ocId = userInfo["ocId"] as? String {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
+                    if metadata.account == appDelegate.account {
+                        self.reloadDataSource()
+                    }
                 }
             }
         }

+ 7 - 7
iOSClient/Networking/NCNetworking.swift

@@ -850,7 +850,7 @@ import Queuer
                         }
                         
                         if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadataFolder?.ocId) {
-                            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_createFolder, userInfo: ["metadata": metadata])
+                            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_createFolder, userInfo: ["ocId": metadata.ocId])
                         }
                     }
                     
@@ -913,7 +913,7 @@ import Queuer
                 NCUtilityFileSystem.shared.deleteFile(filePath: CCUtility.getDirectoryProviderStorageOcId(metadataLivePhoto.ocId))
             }
             
-            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_deleteFile, userInfo: ["metadata": metadata, "onlyLocal": true])
+            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_deleteFile, userInfo: ["ocId": metadata.ocId, "onlyLocal": true])
             completion(0, "")
             
             return
@@ -977,7 +977,7 @@ import Queuer
                     NCManageDatabase.sharedInstance.deleteDirectoryAndSubDirectory(serverUrl: CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName), account: metadata.account)
                 }
                 
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_deleteFile, userInfo: ["metadata": metadata, "onlyLocal": false])
+                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_deleteFile, userInfo: ["ocId": metadata.ocId, "onlyLocal": false])
             }
             
             completion(errorCode, errorDescription)
@@ -1022,7 +1022,7 @@ import Queuer
                 }
                 #endif
                 
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_favoriteFile, userInfo: ["metadata": metadata])
+                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_favoriteFile, userInfo: ["ocId": metadata.ocId])
             }
             
             completion(errorCode, errorDescription)
@@ -1133,7 +1133,7 @@ import Queuer
                 }
                 
                 if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
-                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata])
+                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_renameFile, userInfo: ["ocId": metadata.ocId])
                 }
             }
                     
@@ -1180,7 +1180,7 @@ import Queuer
                 NCManageDatabase.sharedInstance.moveMetadata(ocId: metadata.ocId, serverUrlTo: serverUrlTo)
                 guard let metadataNew = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadata.ocId) else { return }
 
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_moveFile, userInfo: ["metadata": metadata, "metadataNew": metadataNew])
+                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_moveFile, userInfo: ["ocId": metadata.ocId, "ocIdNew": metadataNew.ocId])
                 
             }
             
@@ -1220,7 +1220,7 @@ import Queuer
                    
             if errorCode == 0 {
                 
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_copyFile, userInfo: ["metadata": metadata, "serverUrlTo": serverUrlTo])
+                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_copyFile, userInfo: ["ocId": metadata.ocId, "serverUrlTo": serverUrlTo])
             }
             
             completion(errorCode, errorDescription)

+ 1 - 1
iOSClient/Networking/NCNetworkingE2EE.swift

@@ -179,7 +179,7 @@ import Alamofire
                         try FileManager.default.moveItem(atPath: atPath, toPath: toPath)
                     } catch { }
                     
-                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata])
+                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_renameFile, userInfo: ["ocId": metadata.ocId])
                 }
                 
                 // unlock

+ 1 - 1
iOSClient/Viewer/NCViewerImage/NCViewerImageCommon.swift

@@ -111,7 +111,7 @@ class NCViewerImageCommon: NSObject {
             // AUTOMATIC DOWNLOAD FOR GIF
             
             if (ext == "GIF" || ext == "SVG")  && metadata.session == "" {
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuDownloadImage, userInfo: ["metadata": metadata])
+                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_menuDownloadImage, userInfo: ["ocId": metadata.ocId])
             }
         }