alqindiirsyam 2 éve
szülő
commit
d80c50cfbb

+ 1 - 1
appbuilder-ios/AppBuilder/AppBuilder/AppDelegate.swift

@@ -167,7 +167,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
             }
         }
         let tabBarAppearance: UITabBarAppearance = UITabBarAppearance()
-        tabBarAppearance.configureWithOpaqueBackground()
+        tabBarAppearance.configureWithTransparentBackground()
         if Bundle.main.displayName == "DigiNetS" {
             tabBarAppearance.backgroundColor = .black.withAlphaComponent(0.7)
         } else {

+ 9 - 10
appbuilder-ios/AppBuilder/AppBuilder/FirstTabViewController.swift

@@ -27,13 +27,10 @@ class FirstTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
     
     var dateRefresh: Date?
     public static var forceRefresh = false
+    public static var atFirstPage = true
     
     override func viewDidLoad() {
         super.viewDidLoad()
-        let cpaasMode = PrefsUtil.getCpaasMode()
-        let isBurger = cpaasMode == PrefsUtil.CPAAS_MODE_BURGER
-//        navigationController?.navigationBar.backgroundColor = .white
-        navigationController?.setNavigationBarHidden(!isBurger, animated: false)
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(collapseDocked))
         tapGesture.cancelsTouchesInView = false
         tapGesture.delegate = self
@@ -104,7 +101,7 @@ class FirstTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
             }
         }
         if let u = myURL {
-            if dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || FirstTabViewController.forceRefresh {
+            if (dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || FirstTabViewController.forceRefresh) && FirstTabViewController.atFirstPage {
                 let myRequest = URLRequest(url: u)
                 webView.load(myRequest)
             }
@@ -236,10 +233,8 @@ class FirstTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
                   let param1 = dict["param1"] as? Bool else {
                 return
             }
-            if param1 {
-                
-            } else {
-                
+            if !param1 {
+                self.webView.evaluateJavaScript("closeModal(true);")
             }
         } else if message.name == "toggleVoiceSearch" {
             if !isAllowSpeech {
@@ -476,9 +471,13 @@ extension FirstTabViewController: WKUIDelegate, WKNavigationDelegate {
             if let urlStr = navigationAction.request.url?.absoluteString {
                 print("url: \(urlStr)")
                 collapseDocked()
-                if urlStr.contains("nexilis/pages/tab1-main-only") || urlStr.contains("nexilis/pages/tab3-main-only") || urlStr.contains("nexilis/pages/tab1-main") || urlStr.contains("nexilis/pages/tab3-commerce") {
+                if urlStr.contains("nexilis/pages/tab1-main-only") || urlStr.contains("nexilis/pages/tab3-main-only") || urlStr.contains("nexilis/pages/tab1-main") || urlStr.contains("nexilis/pages/tab3-commerce") || urlStr.contains("nexilis/pages/tab1-video") {
                     ViewController.alwaysHideButton = false
                     showTabBar()
+                } else {
+                    ViewController.alwaysHideButton = true
+                    hideTabBar()
+                    FirstTabViewController.atFirstPage = false
                 }
             }
 

+ 14 - 4
appbuilder-ios/AppBuilder/AppBuilder/FourthTabViewController.swift

@@ -86,8 +86,18 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
             if ViewController.middleButton.isHidden {
                 ViewController.isExpandButton = false
                 if let viewController = viewController as? ViewController {
-                    viewController.tabBar.isHidden = false
-                    ViewController.middleButton.isHidden = false
+                    if viewController.tabBar.isHidden {
+                        viewController.tabBar.isHidden = false
+                        ViewController.middleButton.isHidden = false
+                    }
+                }
+            } else if PrefsUtil.getCpaasMode() != PrefsUtil.CPAAS_MODE_DOCKED {
+                DispatchQueue.main.async {
+                    if let viewController = viewController as? ViewController {
+                        if viewController.tabBar.isHidden {
+                            viewController.tabBar.isHidden = false
+                        }
+                    }
                 }
             }
         })
@@ -233,8 +243,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         })
         
         Item.menus["Call"] = [
-            Item(icon: UIImage(systemName: "message"), title: "Incoming Message(s)".localized()),
-            Item(icon: UIImage(systemName: "phone"), title: "Incoming Call(s)".localized()),
+//            Item(icon: UIImage(systemName: "message"), title: "Incoming Message(s)".localized()),
+//            Item(icon: UIImage(systemName: "phone"), title: "Incoming Call(s)".localized()),
             Item(icon: UIImage(systemName: "iphone.homebutton.radiowaves.left.and.right"), title: "Vibrate Mode".localized()),
             Item(icon: UIImage(systemName: "photo.on.rectangle.angled"), title: "Save to Gallery".localized()),
             Item(icon: UIImage(systemName: "arrow.down.square"), title: "Auto Download".localized()),

+ 37 - 12
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -117,6 +117,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         
         
         tableView.tableHeaderView = segment
+        tableView.tableFooterView = UIView()
         
         pullBuddy()
         let cpaasMode = PrefsUtil.getCpaasMode()
@@ -278,8 +279,18 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             if ViewController.middleButton.isHidden {
                 ViewController.isExpandButton = false
                 if let viewController = viewController as? ViewController {
-                    viewController.tabBar.isHidden = false
-                    ViewController.middleButton.isHidden = false
+                    if viewController.tabBar.isHidden {
+                        viewController.tabBar.isHidden = false
+                        ViewController.middleButton.isHidden = false
+                    }
+                }
+            } else if PrefsUtil.getCpaasMode() != PrefsUtil.CPAAS_MODE_DOCKED {
+                DispatchQueue.main.async {
+                    if let viewController = viewController as? ViewController {
+                        if viewController.tabBar.isHidden {
+                            viewController.tabBar.isHidden = false
+                        }
+                    }
                 }
             }
         })
@@ -323,10 +334,15 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             segment.setTitle("Groups".localized(), forSegmentAt: 1)
         }
         searchController.searchBar.placeholder = "Search chats & messages".localized()
-        groupMap.removeAll()
+        removeAllData()
+        getData()
+    }
+    
+    func removeAllData() {
         groups.removeAll()
+        groupMap.removeAll()
+        chats.removeAll()
         tableView.reloadData()
-        getData()
     }
     
     override func viewWillDisappear(_ animated: Bool) {
@@ -365,6 +381,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         getChats {
             self.getContacts {
                 self.getGroups { g1 in
+                    self.groupMap.removeAll()
                     self.groups.removeAll()
                     self.groups.append(contentsOf: g1)
                     DispatchQueue.main.async {
@@ -584,8 +601,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 dismiss(animated: true, completion: nil)
                 return
             }
-            let user = User.getData(pin: data.pin)
-            if user != nil || data.pin == "-999" {
+            if data.messageScope == "3" {
                 let editorPersonalVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
                 editorPersonalVC.hidesBottomBarWhenPushed = true
                 editorPersonalVC.unique_l_pin = data.pin
@@ -602,7 +618,11 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 if indexPath.row == 0 {
                     group = fillteredData[indexPath.section] as! Group
                 } else {
-                    group = (fillteredData[indexPath.section] as! Group).childs[indexPath.row - 1]
+                    if (fillteredData[indexPath.section] as! Group).childs.count > 0 {
+                        group = (fillteredData[indexPath.section] as! Group).childs[indexPath.row - 1]
+                    } else {
+                        return
+                    }
                 }
             } else {
                 if indexPath.row == 0 {
@@ -741,7 +761,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         var value = 0
         if isFilltering {
-            if segment.selectedSegmentIndex == 2, let groups = fillteredData as? [Group] {
+            if segment.selectedSegmentIndex == 1, let groups = fillteredData as? [Group] {
                 let group = groups[section]
                 if group.isSelected {
                     if let _ = groupMap[group.id] {
@@ -754,7 +774,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     value = 1
                 }
             }
-            return fillteredData.count
+            return value
         }
         switch segment.selectedSegmentIndex {
         case 0:
@@ -807,8 +827,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 imageView.heightAnchor.constraint(equalToConstant: 40.0)
             ])
             if data.profile.isEmpty && data.pin != "-999" {
-                let user = User.getData(pin: data.pin)
-                if user != nil {
+                if data.messageScope == "3" {
                     imageView.image = UIImage(named: "Profile---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 } else {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
@@ -938,9 +957,15 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
             let group: Group
             if isFilltering {
                 if indexPath.row == 0 {
+                    print("DATA GROUP1 \((fillteredData[indexPath.section] as! Group).name)")
                     group = fillteredData[indexPath.section] as! Group
                 } else {
-                    group = (fillteredData[indexPath.section] as! Group).childs[indexPath.row - 1]
+                    if (fillteredData[indexPath.section] as! Group).childs.count > 0 {
+                        print("DATA GROUP2 \((fillteredData[indexPath.section] as! Group).name)")
+                        group = (fillteredData[indexPath.section] as! Group).childs[indexPath.row - 1]
+                    } else {
+                        return cell
+                    }
                 }
             } else {
                 if indexPath.row == 0 {

+ 13 - 2
appbuilder-ios/AppBuilder/AppBuilder/ThirdTabViewController.swift

@@ -27,6 +27,8 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
     
     var dateRefresh: Date?
     public static var forceRefresh = false
+    public static var inView = false
+    public static var atFirstPage = true
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -63,6 +65,10 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
     }
     
     override func viewWillAppear(_ animated: Bool) {
+        if ThirdTabViewController.inView {
+           return
+        }
+        ThirdTabViewController.inView = true
         let me = UserDefaults.standard.string(forKey: "me")
         
         var myURL : URL?
@@ -102,7 +108,7 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
         }
         print(address)
         if let u = myURL{
-            if dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || ThirdTabViewController.forceRefresh {
+            if (dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || ThirdTabViewController.forceRefresh) && ThirdTabViewController.atFirstPage {
                 let myRequest = URLRequest(url: u)
                 webView.load(myRequest)
             }
@@ -127,6 +133,7 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
         self.webView.evaluateJavaScript("{if(pauseAll){pauseAll();}}")
         view.endEditing(true)
         resignFirstResponder()
+        ThirdTabViewController.inView = false
     }
     
     func scrollViewDidScroll(_ scrollView: UIScrollView) {
@@ -480,9 +487,13 @@ extension ThirdTabViewController: WKUIDelegate {
             if let urlStr = navigationAction.request.url?.absoluteString {
                 print("kacau \(urlStr)")
                 collapseDocked()
-                if urlStr.contains("nexilis/pages/tab1-main-only") || urlStr.contains("nexilis/pages/tab3-main-only") || urlStr.contains("nexilis/pages/tab1-main") || urlStr.contains("nexilis/pages/tab3-commerce") {
+                if urlStr.contains("nexilis/pages/tab1-main-only") || urlStr.contains("nexilis/pages/tab3-main-only") || urlStr.contains("nexilis/pages/tab1-main") || urlStr.contains("nexilis/pages/tab3-commerce") || urlStr.contains("nexilis/pages/tab1-video") {
                     ViewController.alwaysHideButton = false
                     showTabBar()
+                } else {
+                    ViewController.alwaysHideButton = true
+                    hideTabBar()
+                    ThirdTabViewController.atFirstPage = false
                 }
             }
 

+ 5 - 14
appbuilder-ios/AppBuilder/AppBuilder/ViewController.swift

@@ -455,16 +455,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
             if PrefsUtil.getCpaasMode() == PrefsUtil.CPAAS_MODE_DOCKED {
                 ViewController.pullActionButton()
             }
-            let customTab = PrefsUtil.getCustomTab().split(separator: ",")
-            if customTab[0] == "1" {
-                firstTab?.viewWillAppear(false)
-            } else if customTab[0] == "2" {
-                secondTab?.viewWillAppear(false)
-            } else if customTab[0] == "3" {
-                thirdTab?.viewWillAppear(false)
-            } else if customTab[0] == "4" {
-                fourthTab?.viewWillAppear(false)
-            }
+            self.selectedViewController?.viewWillAppear(false)
         } else {
             self.selectedViewController?.viewWillAppear(false)
         }
@@ -633,7 +624,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                     }
                 }
             } else {
-                Nexilis.buttonClicked(index: 1)
+                Nexilis.buttonClicked(index: 9)
             }
         }
     }
@@ -668,7 +659,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                     }
                 }
             } else {
-                Nexilis.buttonClicked(index: 4)
+                Nexilis.buttonClicked(index: 8)
             }
         }
     }
@@ -703,7 +694,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                     }
                 }
             } else {
-                Nexilis.buttonClicked(index: 3)
+                Nexilis.buttonClicked(index: 7)
             }
         }
     }
@@ -738,7 +729,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                     }
                 }
             } else {
-                Nexilis.buttonClicked(index: 2)
+                Nexilis.buttonClicked(index: 6)
             }
         }
     }

+ 1 - 0
appbuilder-ios/NexilisLite/NexilisLite/Resource/id.lproj/Localizable.strings

@@ -185,3 +185,4 @@
 "Please check your email and enter the code sent" = "Harap periksa email anda dan masukkan kode yang tertera";
 "Expired OTP" = "OTP telah kadaluarsa";
 "Invalid OTP" = "OTP tidak valid";
+"Successfully add friend" = "Berhasil menambahkan teman";

+ 6 - 3
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -862,9 +862,12 @@ public class Nexilis: NSObject {
         }
         message.mBodies[CoreMessage_TMessageKey.PACKET_ID] = packetId
         if let _ = waitQueue[message.getStatus()] {
-            waitQueue[message.getStatus()] = message
-            groupWait.leave()
-            return
+            print("MESSAGE \(message.toLogString())")
+            if message.mBodies.keys.contains(CoreMessage_TMessageKey.ERRCOD) {
+                waitQueue[message.getStatus()] = message
+                groupWait.leave()
+                return
+            }
         }
         IncomingThread.default.addQueue(message: message)
     }

+ 11 - 14
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -92,10 +92,10 @@ public class EditorGroup: UIViewController {
         viewButton.layer.shadowRadius = 3
         
 //        buttonVoice.setImage(resizeImage(image: UIImage(named: "Voice-Record", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)), for: .normal)
-        buttonSendImage.setImage(resizeImage(image: UIImage(named: "Send-Image", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendPhoto.setImage(resizeImage(image: UIImage(named: "Camera", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendSticker.setImage(resizeImage(image: UIImage(named: "Sticker---Emoji", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendFile.setImage(resizeImage(image: UIImage(named: "File---Documents", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
+        buttonSendImage.setImage(resizeImage(image: UIImage(named: "Send-Image", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendPhoto.setImage(resizeImage(image: UIImage(named: "Camera", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendSticker.setImage(resizeImage(image: UIImage(named: "Sticker---Emoji", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendFile.setImage(resizeImage(image: UIImage(named: "File---Documents", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
         
         buttonSendChat.setImage(resizeImage(image: UIImage(named: "Send-(White)", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withRenderingMode(.alwaysOriginal), for: .normal)
         
@@ -165,16 +165,13 @@ public class EditorGroup: UIViewController {
                 alert.addAction(UIAlertAction(title: "Cancel".localized(), style: UIAlertAction.Style.default, handler: nil))
                 alert.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: {(_) in
                     var l_pin = self.dataGroup["group_id"] as! String
-                    DispatchQueue.global().async {
-                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                            if (self.dataTopic["chat_id"] as! String != "") {
-                                l_pin = self.dataTopic["chat_id"] as! String
-                            }
-                            _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(l_pin)'")
-                            _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE", _where: "(l_pin='\(self.dataGroup["group_id"]!!)' and chat_id='\(self.dataTopic["chat_id"]!!)') and message_scope_id='4'")
-                        })
-                        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "reloadTabChats"), object: nil, userInfo: nil)
-                    }
+                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                        if (self.dataTopic["chat_id"] as! String != "") {
+                            l_pin = self.dataTopic["chat_id"] as! String
+                        }
+                        _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(l_pin)'")
+                        _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE", _where: "(l_pin='\(self.dataGroup["group_id"]!!)' and chat_id='\(self.dataTopic["chat_id"]!!)') and message_scope_id='4'")
+                    })
                     if self.fromNotification {
                         self.didTapExit()
                     } else {

+ 8 - 11
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -110,10 +110,10 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
         viewButton.layer.shadowRadius = 3
         
 //        buttonVoice.setImage(resizeImage(image: UIImage(named: "Voice-Record", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)), for: .normal)
-        buttonSendImage.setImage(resizeImage(image: UIImage(named: "Send-Image", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendPhoto.setImage(resizeImage(image: UIImage(named: "Camera", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendSticker.setImage(resizeImage(image: UIImage(named: "Sticker---Emoji", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
-        buttonSendFile.setImage(resizeImage(image: UIImage(named: "File---Documents", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.red), for: .normal)
+        buttonSendImage.setImage(resizeImage(image: UIImage(named: "Send-Image", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendPhoto.setImage(resizeImage(image: UIImage(named: "Camera", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendSticker.setImage(resizeImage(image: UIImage(named: "Sticker---Emoji", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
+        buttonSendFile.setImage(resizeImage(image: UIImage(named: "File---Documents", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(.black), for: .normal)
         
         buttonSendChat.setImage(resizeImage(image: UIImage(named: "Send-(White)", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withRenderingMode(.alwaysOriginal), for: .normal)
         
@@ -221,13 +221,10 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                     let alert = UIAlertController(title: "", message: "Are you sure to delete all message in this conversation?".localized(), preferredStyle: .alert)
                     alert.addAction(UIAlertAction(title: "Cancel".localized(), style: UIAlertAction.Style.default, handler: nil))
                     alert.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: {(_) in
-                        DispatchQueue.global().async {
-                            Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                                _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(self.dataPerson["f_pin"]!!)'")
-                                _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE", _where: "(f_pin='\(self.dataPerson["f_pin"]!!)' or l_pin='\(self.dataPerson["f_pin"]!!)') and (message_scope_id='3' or message_scope_id='18') and is_call_center = 0")
-                            })
-                            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "reloadTabChats"), object: nil, userInfo: nil)
-                        }
+                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                            _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(self.dataPerson["f_pin"]!!)'")
+                            _ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE", _where: "(f_pin='\(self.dataPerson["f_pin"]!!)' or l_pin='\(self.dataPerson["f_pin"]!!)') and (message_scope_id='3' or message_scope_id='18') and is_call_center = 0")
+                        })
                         if self.fromNotification {
                             self.didTapExit()
                         } else {

+ 1 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/AddFriendTableViewController.swift

@@ -64,6 +64,7 @@ class AddFriendTableViewController: UITableViewController {
         
         tableView.tableFooterView = UIView()
         
+        self.data.removeAll()
         getData { d in
             self.data = d
             DispatchQueue.main.async {

+ 12 - 7
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -165,10 +165,15 @@ class ContactChatViewController: UITableViewController {
     }
     
     override func viewWillAppear(_ animated: Bool) {
-        groupMap.removeAll()
+        removeAllData()
+        getData()
+    }
+    
+    func removeAllData() {
         groups.removeAll()
+        groupMap.removeAll()
+        chats.removeAll()
         tableView.reloadData()
-        getData()
     }
     
     @objc func onReload(notification: NSNotification) {
@@ -227,6 +232,7 @@ class ContactChatViewController: UITableViewController {
         getChats {
             self.getContacts {
                 self.getGroups { g1 in
+                    self.groupMap.removeAll()
                     self.groups.removeAll()
                     self.groups.append(contentsOf: g1)
                     DispatchQueue.main.async {
@@ -453,8 +459,7 @@ extension ContactChatViewController {
                 dismiss(animated: true, completion: nil)
                 return
             }
-            let user = User.getData(pin: data.pin)
-            if user != nil || data.pin == "-999" {
+            if data.messageScope == "3" {
                 let editorPersonalVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
                 editorPersonalVC.hidesBottomBarWhenPushed = true
                 editorPersonalVC.unique_l_pin = data.pin
@@ -654,7 +659,7 @@ extension ContactChatViewController {
                     value = 1
                 }
             }
-            return fillteredData.count
+            return value
         }
         switch segment.selectedSegmentIndex {
         case 0:
@@ -696,6 +701,7 @@ extension ContactChatViewController {
             if isFilltering {
                 data = fillteredData[indexPath.row] as! Chat
             } else {
+                print("DATA CHATS \(chats)")
                 data = chats[indexPath.row]
             }
             let imageView = UIImageView()
@@ -709,8 +715,7 @@ extension ContactChatViewController {
                 imageView.heightAnchor.constraint(equalToConstant: 40.0)
             ])
             if data.profile.isEmpty && data.pin != "-999" {
-                let user = User.getData(pin: data.pin)
-                if user != nil {
+                if data.messageScope == "3" {
                     imageView.image = UIImage(named: "Profile---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 } else {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)

+ 13 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/GroupDetailViewController.swift

@@ -290,11 +290,21 @@ class GroupDetailViewController: UITableViewController {
                 } else {
                     currentAccess = "0"
                 }
+                Nexilis.showLoader()
                 self.changeOpenGroup(open: currentAccess) { result in
                     if result {
                         DispatchQueue.main.async {
                             g.isOpen = currentAccess
                             tableView.reloadRows(at: [indexPath], with: .none)
+                            Nexilis.hideLoader()
+                        }
+                    } else {
+                        DispatchQueue.main.async {
+                            Nexilis.hideLoader()
+                            let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
+                            imageView.tintColor = .white
+                            let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
+                            banner.show()
                         }
                     }
                 }
@@ -647,7 +657,9 @@ class GroupDetailViewController: UITableViewController {
         DispatchQueue.global().async {
             var result: Bool = false
             if let g = self.group, let response = Nexilis.writeAndWait(message: CoreMessage_TMessageBank.getChangeGroupInfo(p_group_id: g.id, p_open: open)), response.isOk() {
-                result = true
+                    result = true
+            } else {
+                result = false
             }
             completion(result)
         }

+ 4 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ProfileViewController.swift

@@ -453,6 +453,10 @@ public class ProfileViewController: UITableViewController {
         addFriend { result in
             DispatchQueue.main.async {
                 if result {
+                    let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
+                    imageView.tintColor = .white
+                    let banner = FloatingNotificationBanner(title: "Successfully add friend".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
+                    banner.show()
                     self.isDismiss?()
                     self.navigationController?.popViewController(animated: true)
                 } else {