Browse Source

fix get user data

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 3 years ago
parent
commit
12f5468166

+ 1 - 1
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -132,7 +132,7 @@
         "repositoryURL": "https://github.com/nextcloud/ios-communication-library/",
         "state": {
           "branch": "develop",
-          "revision": "87d509a05a5cbd5db3f22fefbce86b8d20b7cce4",
+          "revision": "8afdc5016ccaeb648fcd3baa4091a01b088506a8",
           "version": null
         }
       },

+ 2 - 2
iOSClient/Data/NCDatabase.swift

@@ -52,7 +52,6 @@ class tableAccount: Object, NCUserBaseUrl {
     @objc dynamic var businessSize: String = ""
     @objc dynamic var businessType = ""
     @objc dynamic var city = ""
-    @objc dynamic var company = ""
     @objc dynamic var country = ""
     @objc dynamic var displayName = ""
     @objc dynamic var email = ""
@@ -62,6 +61,7 @@ class tableAccount: Object, NCUserBaseUrl {
     @objc dynamic var lastLogin: Int64 = 0
     @objc dynamic var locale = ""
     @objc dynamic var mediaPath = ""
+    @objc dynamic var organisation = ""
     @objc dynamic var password = ""
     @objc dynamic var phone = ""
     @objc dynamic var quota: Int64 = 0
@@ -83,7 +83,7 @@ class tableAccount: Object, NCUserBaseUrl {
     @objc dynamic var userStatusMessageIsPredefined: Bool = false
     @objc dynamic var userStatusStatus: String?
     @objc dynamic var userStatusStatusIsUserDefined: Bool = false
-    @objc dynamic var webpage = ""
+    @objc dynamic var website = ""
     @objc dynamic var zip = ""
 
     // COLOR Files

+ 4 - 3
iOSClient/Data/NCManageDatabase+Account.swift

@@ -302,6 +302,7 @@ extension NCManageDatabase {
                 result.language = userProfile.language
                 result.lastLogin = userProfile.lastLogin
                 result.locale = userProfile.locale
+                result.organisation = userProfile.organisation
                 result.phone = userProfile.phone
                 result.quota = userProfile.quota
                 result.quotaFree = userProfile.quotaFree
@@ -312,7 +313,7 @@ extension NCManageDatabase {
                 result.subadmin = userProfile.subadmin.joined(separator: ",")
                 result.twitter = userProfile.twitter
                 result.userId = userProfile.userId
-                result.webpage = userProfile.webpage
+                result.website = userProfile.website
 
                 returnAccount = result
             }
@@ -323,7 +324,7 @@ extension NCManageDatabase {
         return tableAccount.init(value: returnAccount)
     }
 
-    @objc func setAccountUserProfileHC(businessSize: String, businessType: String, city: String, company: String, country: String, role: String, zip: String) -> tableAccount? {
+    @objc func setAccountUserProfileHC(businessSize: String, businessType: String, city: String, organisation: String, country: String, role: String, zip: String) -> tableAccount? {
 
         let realm = try! Realm()
 
@@ -343,7 +344,7 @@ extension NCManageDatabase {
                 result.businessSize = businessSize
                 result.businessType = businessType
                 result.city = city
-                result.company = company
+                result.organisation =  organisation
                 result.country = country
                 result.role = role
                 result.zip = zip

+ 3 - 3
iOSClient/Settings/CCManageAccount.m

@@ -235,14 +235,14 @@
     }
     
     // Web
-    if ([activeAccount.webpage length] > 0) {
+    if ([activeAccount.website length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"userweb" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_web_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"network"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
-        row.value = activeAccount.webpage;
+        row.value = activeAccount.website;
         [section addFormRow:row];
     }
     
@@ -305,7 +305,7 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"company"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
-        row.value = activeAccount.company;
+        row.value = activeAccount.organisation;
         [section addFormRow:row];
     
         if (activeAccount.hcIsTrial) {