alqindiirsyam vor 2 Jahren
Ursprung
Commit
7dab53da0e

+ 4 - 2
appbuilder-ios/AppBuilder/AppBuilder.xcodeproj/project.pbxproj

@@ -439,12 +439,13 @@
 					"$(PROJECT_DIR)/Frameworks",
 				);
 				INFOPLIST_FILE = AppBuilder/Info.plist;
+				INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
 				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 2.2.5;
+				MARKETING_VERSION = 2.2.6;
 				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -469,12 +470,13 @@
 					"$(PROJECT_DIR)/Frameworks",
 				);
 				INFOPLIST_FILE = AppBuilder/Info.plist;
+				INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
 				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 2.2.5;
+				MARKETING_VERSION = 2.2.6;
 				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 26 - 60
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -18,8 +18,6 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     
     var chats: [Chat] = []
     
-    var contacts: [User] = []
-    
     var groups: [Group] = []
     
     var cancelSearchButton = UIBarButtonItem()
@@ -380,16 +378,16 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         } else {
             searchController.searchBar.placeholder = "Search groups name".localized()
         }
-        removeAllData()
+//        removeAllData()
         getData()
     }
     
-    func removeAllData() {
-        groups.removeAll()
-        groupMap.removeAll()
-        chats.removeAll()
-        tableView.reloadData()
-    }
+//    func removeAllData() {
+//        groups.removeAll()
+//        groupMap.removeAll()
+//        chats.removeAll()
+//        tableView.reloadData()
+//    }
     
     override func viewWillDisappear(_ animated: Bool) {
         tabBarController?.navigationItem.leftBarButtonItem = nil
@@ -436,28 +434,25 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     
     func getData() {
         getChats {
-            self.getContacts {
-                self.getGroups { g1 in
-                    self.groupMap.removeAll()
-                    self.groups.removeAll()
-                    self.groups.append(contentsOf: g1)
-                    DispatchQueue.main.async {
-                        self.tableView.reloadData()
-                    }
-                    DispatchQueue.global().async {
-                        self.getOpenGroups(listGroups: g1, completion: { g in
-                            DispatchQueue.main.async {
-                                for og in g {
-                                    if self.groups.first(where: { $0.id == og.id }) == nil {
-                                        self.groups.append(og)
-                                    }
-                                }
-                                DispatchQueue.main.async {
-                                    self.tableView.reloadData()
+            self.getGroups { g1 in
+                self.groupMap.removeAll()
+                self.groups = g1
+                DispatchQueue.main.async {
+                    self.tableView.reloadData()
+                }
+                DispatchQueue.global().async {
+                    self.getOpenGroups(listGroups: g1, completion: { g in
+                        DispatchQueue.main.async {
+                            for og in g {
+                                if self.groups.first(where: { $0.id == og.id }) == nil {
+                                    self.groups.append(og)
                                 }
                             }
-                        })
-                    }
+                            DispatchQueue.main.async {
+                                self.tableView.reloadData()
+                            }
+                        }
+                    })
                 }
             }
         }
@@ -465,36 +460,11 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     
     func getChats(completion: @escaping ()->()) {
         DispatchQueue.global().async {
-            self.chats.removeAll()
-            self.chats.append(contentsOf: Chat.getData())
+            self.chats = Chat.getData()
             completion()
         }
     }
     
-    private func getContacts(completion: @escaping ()->()) {
-        DispatchQueue.global().async {
-            self.contacts.removeAll()
-            Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT f_pin, first_name, last_name, image_id, official_account, user_type FROM BUDDY where f_pin <> '\(UserDefaults.standard.string(forKey: "me")!)' order by 5 desc, 2 collate nocase asc") {
-                    while cursorData.next() {
-                        let user = User(pin: cursorData.string(forColumnIndex: 0) ?? "",
-                                        firstName: cursorData.string(forColumnIndex: 1) ?? "",
-                                        lastName: cursorData.string(forColumnIndex: 2) ?? "",
-                                        thumb: cursorData.string(forColumnIndex: 3) ?? "",
-                                        userType: cursorData.string(forColumnIndex: 5) ?? "")
-                        if (user.firstName + " " + user.lastName).trimmingCharacters(in: .whitespaces) == "USR\(user.pin)" {
-                            continue
-                        }
-                        user.official = cursorData.string(forColumnIndex: 4) ?? ""
-                        self.contacts.append(user)
-                    }
-                    cursorData.close()
-                }
-                completion()
-            })
-        }
-    }
-    
     private func getGroupRecursive(fmdb: FMDatabase, id: String = "", parent: String = "") -> [Group] {
         var data: [Group] = []
         var query = "select g.group_id, g.f_name, g.image_id, g.quote, g.created_by, g.created_date, g.parent, g.group_type, g.is_open, g.official, g.is_education, g.level from GROUPZ g where "
@@ -680,11 +650,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
         case 1:
             expandCollapseGroup(tableView: tableView, indexPath: indexPath)
         default:
-            let data = contacts[indexPath.row]
-            let editorPersonalVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
-            editorPersonalVC.hidesBottomBarWhenPushed = true
-            editorPersonalVC.unique_l_pin = data.pin
-            navigationController?.show(editorPersonalVC, sender: nil)
+            expandCollapseGroup(tableView: tableView, indexPath: indexPath)
         }
     }
     

+ 10 - 15
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -130,7 +130,7 @@ class ContactChatViewController: UITableViewController {
 //        }
         
         let menu = UIMenu(title: "", children: childrenMenu)
-        navigationItem.rightBarButtonItem = UIBarButtonItem(systemItem: .add, primaryAction: .none, menu: menu)
+        navigationItem.rightBarButtonItem = UIBarButtonItem(title: nil, image: UIImage(systemName: "ellipsis"), primaryAction: .none, menu: menu)
         
         searchController = UISearchController(searchResultsController: nil)
         searchController.delegate = self
@@ -176,7 +176,7 @@ class ContactChatViewController: UITableViewController {
         navBarAppearance.titleTextAttributes = attributes
         navigationController?.navigationBar.standardAppearance = navBarAppearance
         navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
-        removeAllData()
+//        removeAllData()
         getData()
     }
     
@@ -190,12 +190,12 @@ class ContactChatViewController: UITableViewController {
         }
     }
     
-    func removeAllData() {
-        groups.removeAll()
-        groupMap.removeAll()
-        chats.removeAll()
-        tableView.reloadData()
-    }
+//    func removeAllData() {
+//        groups.removeAll()
+//        groupMap.removeAll()
+//        chats.removeAll()
+//        tableView.reloadData()
+//    }
     
     @objc func onReload(notification: NSNotification) {
         let data:[AnyHashable : Any] = notification.userInfo!
@@ -254,8 +254,7 @@ class ContactChatViewController: UITableViewController {
             self.getContacts {
                 self.getGroups { g1 in
                     self.groupMap.removeAll()
-                    self.groups.removeAll()
-                    self.groups.append(contentsOf: g1)
+                    self.groups = g1
                     DispatchQueue.main.async {
                         self.tableView.reloadData()
                     }
@@ -277,12 +276,8 @@ class ContactChatViewController: UITableViewController {
     }
     
     func getChats(completion: @escaping ()->()) {
-        self.chats.removeAll()
         DispatchQueue.global().async {
-            let chatData = Chat.getData()
-            if !self.chats.contains(where: {$0.messageId == chatData.first?.messageId ?? ""}) {
-                self.chats.append(contentsOf: chatData)
-            }
+            self.chats = Chat.getData()
             completion()
         }
     }