marinofaggiana 5 лет назад
Родитель
Сommit
9ce7b548b5

+ 1 - 1
iOSClient/Brand/File_Provider_Extension.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.24.0</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.24.0</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -63,7 +63,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
 	<true/>
 	<key>Fabric</key>

+ 1 - 1
iOSClient/Main/Cell/NCListCell.swift

@@ -38,7 +38,7 @@ class NCListCell: UICollectionViewCell {
 
     @IBOutlet weak var labelInfo: UILabel!
 
-    @IBOutlet weak var imageShare: UIImageView!
+    @IBOutlet weak var shared: UIImageView!
 
     @IBOutlet weak var imageMore: UIImageView!
     @IBOutlet weak var buttonMore: UIButton!

+ 1 - 1
iOSClient/Main/Cell/NCListCell.xib

@@ -149,11 +149,11 @@
                 <outlet property="imageLocal" destination="H4E-G2-C1H" id="waX-r5-viX"/>
                 <outlet property="imageMore" destination="dgL-g5-Nkc" id="r7x-Ib-4nz"/>
                 <outlet property="imageSelect" destination="AyA-hP-r6w" id="c1t-yz-HBg"/>
-                <outlet property="imageShare" destination="jc6-Vg-TaS" id="uca-x2-wak"/>
                 <outlet property="imageStatus" destination="7Q9-Tv-9yo" id="Qug-Q7-rRZ"/>
                 <outlet property="labelInfo" destination="AXX-71-9Q6" id="krb-tZ-UQ7"/>
                 <outlet property="labelTitle" destination="UtT-L6-mgW" id="Xv6-zM-2v1"/>
                 <outlet property="separator" destination="Egg-cb-EhZ" id="uhq-Nc-z8K"/>
+                <outlet property="shared" destination="jc6-Vg-TaS" id="w28-mv-Bvr"/>
             </connections>
             <point key="canvasLocation" x="97.599999999999994" y="129.53523238380811"/>
         </collectionViewCell>

+ 36 - 16
iOSClient/Main/NCMainCommon.swift

@@ -268,22 +268,24 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
             cell.imageStatus.image = nil
             cell.imageLocal.image = nil
             cell.imageFavorite.image = nil
-            cell.imageShare.image = nil
+            cell.shared.image = nil
             
             if metadata.directory {
                 
                 if metadata.e2eEncrypted {
                     image = UIImage.init(named: "folderEncrypted")
-                } else if metadata.fileName == autoUploadFileName && serverUrl == autoUploadDirectory {
-                    image = UIImage.init(named: "folderAutomaticUpload")
                 } else if isShare {
                     image = UIImage.init(named: "folder_shared_with_me")
-                } else if isMounted {
-                    image = UIImage.init(named: "folder_external")
                 } else if (tableShare != nil && tableShare!.shareType != Int(shareTypeLink.rawValue)) {
                     image = UIImage.init(named: "folder_shared_with_me")
                 } else if (tableShare != nil && tableShare!.shareType == Int(shareTypeLink.rawValue)) {
                     image = UIImage.init(named: "folder_public")
+                } else if metadata.mountType == "group" {
+                    image = UIImage.init(named: "folder_group")
+                } else if isMounted {
+                    image = UIImage.init(named: "folder_external")
+                } else if metadata.fileName == autoUploadFileName && serverUrl == autoUploadDirectory {
+                    image = UIImage.init(named: "folderAutomaticUpload")
                 } else {
                     image = UIImage.init(named: "folder")
                 }
@@ -315,17 +317,6 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
                     if tableLocalFile!.offline { cell.imageLocal.image = UIImage.init(named: "offlineFlag") }
                     else { cell.imageLocal.image = UIImage.init(named: "local") }
                 }
-                
-                // Share
-                if (isShare) {
-                    cell.imageShare.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
-                } else if (isMounted) {
-                    cell.imageShare.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "shareMounted"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
-                } else if (tableShare != nil && tableShare!.shareType == Int(shareTypeLink.rawValue)) {
-                    cell.imageShare.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "sharebylink"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
-                } else if (tableShare != nil && tableShare!.shareType != Int(shareTypeLink.rawValue)) {
-                    cell.imageShare.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
-                }
             }
             
             // image Favorite
@@ -333,6 +324,35 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
                 cell.imageFavorite.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), multiplier: 2, color: NCBrandColor.sharedInstance.yellowFavorite)
             }
             
+            // Share image
+            if (isShare) {
+                cell.shared.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 30, height: 30, color: .black)
+            } else if (tableShare != nil && tableShare!.shareType == Int(shareTypeLink.rawValue)) {
+                cell.shared.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "sharebylink"), width: 30, height: 30, color: .black)
+            } else if (tableShare != nil && tableShare!.shareType != Int(shareTypeLink.rawValue)) {
+                cell.shared.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 30, height: 30, color: .black)
+            } else {
+                cell.shared.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 30, height: 30, color: NCBrandColor.sharedInstance.graySoft)
+            }
+            if metadata.ownerId != appDelegate.activeUserID {
+                // Load avatar
+                let fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.activeUser, activeUrl: appDelegate.activeUrl) + "-" + metadata.ownerId + ".png"
+                if FileManager.default.fileExists(atPath: fileNameLocalPath) {
+                    cell.shared.image = NCUtility.sharedInstance.createAvatar(image: UIImage(contentsOfFile: fileNameLocalPath), size: 30, alpha: 0.75)
+                } else {
+                    let url = appDelegate.activeUrl + k_avatar + metadata.ownerId + "/128"
+                    let encodedString = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
+                    OCNetworking.sharedManager()?.downloadContents(ofUrl: encodedString, completion: { (data, message, errorCode) in
+                        if errorCode == 0 && UIImage(data: data!) != nil {
+                            do {
+                                try data!.write(to: NSURL(fileURLWithPath: fileNameLocalPath) as URL, options: .atomic)
+                                cell.shared.image = NCUtility.sharedInstance.createAvatar(image: UIImage(contentsOfFile: fileNameLocalPath), size: 30, alpha: 0.75)
+                            } catch { return }
+                        }
+                    })
+                }
+            }
+            
             if isEditMode {
                 cell.imageItemLeftConstraint.constant = 45
                 cell.imageSelect.isHidden = false