alqindiirsyam 3 rokov pred
rodič
commit
5483135c93

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

@@ -35,9 +35,6 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         
         self.navigationController?.navigationBar.topItem?.title = "Settings".localized();
         
-        makeMenu()
-        tableView.reloadData()
-        
         switchVibrateMode.tintColor = .gray
         switchSaveToGallery.tintColor = .gray
         switchAutoDownload.tintColor = .gray
@@ -241,6 +238,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
         navigationController?.navigationBar.shadowImage = UIImage()
         navigationController?.navigationBar.isTranslucent = true
+        makeMenu()
+        tableView.reloadData()
     }
     
     // MARK: - Table view data source
@@ -384,7 +383,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                 let selectedIndex = pickerView.selectedRow(inComponent: 0)
                 let lang = self.language[selectedIndex].values.first
                 UserDefaults.standard.set(lang, forKey: "i18n_language")
-                self.viewDidLoad()
+                self.makeMenu()
+                self.tableView.reloadData()
                 FirstTabViewController.forceRefresh = true
                 ThirdTabViewController.forceRefresh = true
             }))

+ 115 - 83
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -12,11 +12,6 @@ import Speech
 
 class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGestureRecognizerDelegate {
     
-    deinit {
-        print(#function, ">>>> TADAA")
-        NotificationCenter.default.removeObserver(self)
-    }
-    
     var isChooser: ((String, String) -> ())?
     
     var isAdmin: Bool = false
@@ -32,24 +27,24 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     var voiceItem = UIBarButtonItem()
     
     var childrenMenu = [UIAction]()
+    
+    var groupMap: [String:Int] = [:]
 
     lazy var searchController: UISearchController = {
         var searchController = UISearchController(searchResultsController: nil)
         searchController.delegate = self
         searchController.searchResultsUpdater = self
-//        searchController.searchBar.showsBookmarkButton = true
         searchController.searchBar.autocapitalizationType = .none
         searchController.searchBar.delegate = self
-        searchController.searchBar.placeholder = "Search chats & messages".localized()
         searchController.searchBar.barTintColor = .secondaryColor
         searchController.searchBar.searchTextField.backgroundColor = .secondaryColor
         searchController.obscuresBackgroundDuringPresentation = false
+        
         return searchController
     }()
     
     lazy var segment: UISegmentedControl = {
-        print("Chat".localized())
-        var segment = UISegmentedControl(items: ["Chat".localized(), "Group".localized()])
+        var segment = UISegmentedControl(items: ["Chats".localized(), "Groups".localized()])
         segment.sizeToFit()
         segment.selectedSegmentIndex = 0
         segment.addTarget(self, action: #selector(segmentChanged(sender:)), for: .valueChanged)
@@ -118,46 +113,10 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             }
         })
         
-//        navigationController?.title = "Start Conversation"
+        cancelSearchButton = UIBarButtonItem(title: "Cancel".localized(), style: .plain, target: self, action: #selector(cancel(sender:)))
         
-        //        navigationController?.navigationBar.prefersLargeTitles = true
+        var childrenMenu : [UIAction] = []
         
-        cancelSearchButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancel(sender:)))
-        
-        var childrenMenu : [UIAction] = [
-//            UIAction(title: "Create Group", image: UIImage(systemName: "person.and.person"), handler: {[weak self](_) in
-//                let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "createGroupNav") as! UINavigationController
-//                let vc = controller.topViewController as! GroupCreateViewController
-//                vc.isDismiss = { id in
-//                    let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "groupDetailView") as! GroupDetailViewController
-//                    controller.data = id
-//                    self?.navigationController?.show(controller, sender: nil)
-//                }
-//                self?.navigationController?.present(controller, animated: true, completion: nil)
-//            }),
-//            UIAction(title: "Add Friends", image: UIImage(systemName: "person.badge.plus"), handler: {[weak self](_) in
-//                let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "addFriendNav") as! UINavigationController
-//                if let vc = controller.viewControllers.first as? AddFriendTableViewController {
-//                    vc.isDismiss = {
-//                        self?.getContacts {
-//                            DispatchQueue.main.async {
-//                                self?.tableView.reloadData()
-//                            }
-//                        }
-//                    }
-//                }
-//                self?.navigationController?.present(controller, animated: true, completion: nil)
-//            }),
-//            UIAction(title: "Configure Email", image: UIImage(systemName: "mail"), handler: {[weak self](_) in
-//
-//            }),
-//            UIAction(title: "Favorite Messages", image: UIImage(systemName: "star"), handler: {[weak self](_) in
-//                let editorStaredVC = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "staredVC") as! EditorStarMessages
-//                self?.navigationController?.show(editorStaredVC, sender: nil)
-//            }),
-        ]
-        //debug only
-//        isAdmin = true
         if(isAdmin){
             childrenMenu.append(UIAction(title: "Broadcast Message", image: UIImage(systemName: "envelope.open"), handler: {[weak self](_) in
                 let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "broadcastNav")
@@ -165,16 +124,12 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             }))
         }
         
-//        let menu = UIMenu(title: "", children: childrenMenu)
         menuItem = UIBarButtonItem(image: UIImage(systemName: "square.and.pencil"), style: .plain, target: self, action: #selector(startConversation))
         voiceItem = UIBarButtonItem(image: UIImage(systemName: "mic.fill"), style: .plain, target: self, action: #selector(recordAudio))
         
-//        tabBarController?.navigationItem.leftBarButtonItem = cancelSearchButton
         tabBarController?.navigationItem.leftBarButtonItem = voiceItem
         tabBarController?.navigationItem.rightBarButtonItem = menuItem
         tabBarController?.navigationItem.searchController = searchController
-//        navigationItem.searchController = searchController
-//        navigationItem.hidesSearchBarWhenScrolling = true
         
         definesPresentationContext = true
         
@@ -300,6 +255,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     override func viewWillAppear(_ animated: Bool) {
 //        tabBarController?.navigationItem.leftBarButtonItem = cancelSearchButton
         self.navigationController?.navigationBar.topItem?.title = Bundle.main.displayName
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
         let cpaasMode = PrefsUtil.getCpaasMode()
         let isBurger = cpaasMode == PrefsUtil.CPAAS_MODE_BURGER
         navigationController?.navigationBar.backgroundColor = .clear
@@ -311,9 +267,15 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         tabBarController?.navigationItem.leftBarButtonItem = voiceItem
         tabBarController?.navigationItem.searchController = searchController
         tabBarController?.navigationItem.rightBarButtonItem = menuItem
-        let randomInt = Int.random(in: 1..<2)
+        let randomInt = Int.random(in: 1..<10)
         backgroundImage.image = UIImage(named: "pb_lbackground_\(randomInt)")
         getData()
+        searchController.searchBar.placeholder = "Search chats & messages".localized()
+        searchController.searchBar.setValue("Cancel".localized(), forKey: "cancelButtonText")
+        if segment.numberOfSegments == 2 {
+            segment.setTitle("Chats".localized(), forSegmentAt: 0)
+            segment.setTitle("Groups".localized(), forSegmentAt: 1)
+        }
     }
     
     override func viewWillDisappear(_ animated: Bool) {
@@ -394,18 +356,22 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         getChats {
             self.getContacts {
                 self.getGroups { g1 in
-                    self.getOpenGroups(listGroups: g1, completion: { g in
-                        self.groups.removeAll()
-                        self.groups.append(contentsOf: g1)
-                        for og in g {
-                            if self.groups.first(where: { $0.id == og.id }) == nil {
-                                self.groups.append(og)
+                    DispatchQueue.global().async {
+                        self.getOpenGroups(listGroups: g1, completion: { g in
+                            DispatchQueue.main.async {
+                                self.groups.removeAll()
+                                self.groups.append(contentsOf: g1)
+                                for og in g {
+                                    if self.groups.first(where: { $0.id == og.id }) == nil {
+                                        self.groups.append(og)
+                                    }
+                                }
+                                DispatchQueue.main.async {
+                                    self.tableView.reloadData()
+                                }
                             }
-                        }
-                        DispatchQueue.main.async {
-                            self.tableView.reloadData()
-                        }
-                    })
+                        })
+                    }
                 }
             }
         }
@@ -500,9 +466,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
                     if group.official == "1" {
                         let idMe = UserDefaults.standard.string(forKey: "me") as String?
                         if let cursorUser = Database.shared.getRecords(fmdb: fmdb, query: "SELECT user_type FROM BUDDY where f_pin='\(idMe!)'"), cursorUser.next() {
-                            if cursorUser.string(forColumnIndex: 0) == "23" || cursorUser.string(forColumnIndex: 0) == "24" {
-                                group.childs.append(contentsOf: getGroupRecursive(fmdb: fmdb, parent: group.id))
-                            }
+                            group.childs.append(contentsOf: getGroupRecursive(fmdb: fmdb, parent: group.id))
                             cursorUser.close()
                         }
                     } else if group.official != "1"{
@@ -641,6 +605,52 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 }
             }
             group.isSelected = !group.isSelected
+            if !group.isSelected{
+                var sects = 0
+                var sect = indexPath.section
+                var id = group.id
+                if let e = groupMap[id] {
+                    var loooop = true
+                    repeat {
+                        let c = sect + 1
+                        if isFilltering {
+                            if let o = self.fillteredData[c] as? Group {
+                                if o.parent == id {
+                                    sects = sects + 1
+                                    sect = c
+                                    id = o.id
+                                    (self.fillteredData[c] as! Group).isSelected = false
+                                    self.groupMap.removeValue(forKey: (self.fillteredData[c] as! Group).id)
+                                }
+                                else {
+                                    loooop = false
+                                }
+                            }
+                        }
+                        else {
+                            if self.groups[c].parent == id {
+                                sects = sects + 1
+                                sect = c
+                                id = self.groups[c].id
+                                self.groups[c].isSelected = false
+                                self.groupMap.removeValue(forKey: self.groups[c].id)
+                            }
+                            else {
+                                loooop = false
+                            }
+                        }
+                    } while(loooop)
+                }
+                for i in stride(from: sects, to: 0, by: -1){
+                    if isFilltering {
+                        self.fillteredData.remove(at: indexPath.section + i)
+                    }
+                    else {
+                        self.groups.remove(at: indexPath.section + i)
+                    }
+                }
+                groupMap.removeValue(forKey: group.id)
+            }
             if group.groupType == "NOTJOINED" {
                 let alert = UIAlertController(title: "Do you want to join this group?".localized(), message: "Groups : \(group.name)\nMembers: \(group.by)".localized(), preferredStyle: .alert)
                 alert.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel, handler: nil))
@@ -648,6 +658,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     self.joinOpenGroup(groupId: group.id, completion: { result in
                         if result {
                             DispatchQueue.main.async {
+                                self.groupMap.removeAll()
                                 let editorGroupVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorGroupVC") as! EditorGroup
                                 editorGroupVC.hidesBottomBarWhenPushed = true
                                 editorGroupVC.unique_l_pin = group.id
@@ -666,6 +677,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     dismiss(animated: true, completion: nil)
                     return
                 }
+                self.groupMap.removeAll()
                 let editorGroupVC = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorGroupVC") as! EditorGroup
                 editorGroupVC.hidesBottomBarWhenPushed = true
                 editorGroupVC.unique_l_pin = groupId
@@ -676,13 +688,21 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 } else {
                     getGroups(id: group.id) { g in
                         DispatchQueue.main.async {
+                            print("index path section: \(indexPath.section)")
+                            print("index path row: \(indexPath.row)")
+//                            print("index path item: \(indexPath.item)")
                             if self.isFilltering {
-                                self.fillteredData.remove(at: indexPath.section)
-                                self.fillteredData.insert(contentsOf: g, at: indexPath.section)
+//                                self.fillteredData.remove(at: indexPath.section)
+                                if self.fillteredData[indexPath.section] is Group {
+                                    self.groupMap[(self.fillteredData[indexPath.section] as! Group).id] = 1
+                                    self.fillteredData.insert(contentsOf: g, at: indexPath.section + 1)
+                                }
                             } else {
-                                self.groups.remove(at: indexPath.section)
-                                self.groups.insert(contentsOf: g, at: indexPath.section)
+//                                self.groups.remove(at: indexPath.section)
+                                self.groupMap[self.groups[indexPath.section].id] = 1
+                                self.groups.insert(contentsOf: g, at: indexPath.section + 1)
                             }
+                            print("groupMap: \(self.groupMap)")
                             tableView.reloadData()
                         }
                     }
@@ -714,14 +734,18 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         var value = 0
         if isFilltering {
-            if segment.selectedSegmentIndex == 1, let groups = fillteredData as? [Group] {
+            if segment.selectedSegmentIndex == 2, let groups = fillteredData as? [Group] {
                 let group = groups[section]
                 if group.isSelected {
-                    value = group.childs.count + 1
+                    if let g = groupMap[group.id] {
+                        value = 1
+                    }
+                    else {
+                        value = group.childs.count + 1
+                    }
                 } else {
                     value = 1
                 }
-                return value
             }
             return fillteredData.count
         }
@@ -731,7 +755,12 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
         case 1:
             let group = groups[section]
             if group.isSelected {
-                value = group.childs.count + 1
+                if let g = groupMap[group.id] {
+                    value = 1
+                }
+                else {
+                    value = group.childs.count + 1
+                }
             } else {
                 value = 1
             }
@@ -775,14 +804,8 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_ball" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, completion: { result, isDownloaded, image in
+                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
                     imageView.image = image
-                    if !result {
-                        imageView.tintColor = .mainColor
-                    }
-                    if isDownloaded {
-                        tableView.reloadRows(at: [indexPath], with: .none)
-                    }
                 })
             }
             let titleView = UILabel()
@@ -883,10 +906,19 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
             } else {
                 content.text = group.name
             }
+            if group.childs.count > 0 {
+                let iconName = (group.isSelected) ? "chevron.up.circle" : "chevron.down.circle"
+                let imageView = UIImageView(image: UIImage(systemName: iconName))
+                imageView.tintColor = .black
+                cell.accessoryView = imageView
+            }
+            else {
+                cell.accessoryView = nil
+                cell.accessoryType = .none
+            }
             content.imageProperties.maximumSize = CGSize(width: 40, height: 40)
-            getImage(name: group.profile, placeholderImage: UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true) { result, isDownloaded, image in
+            getImage(name: group.profile, placeholderImage: UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath) { result, isDownloaded, image in
                 content.image = image
-                tableView.reloadRows(at: [indexPath], with: .none)
             }
             cell.contentConfiguration = content
         default:

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

@@ -105,7 +105,18 @@
 "Select Language" = "Pilih Bahasa";
 "You must change your name to use this feature" = "Anda harus mengubah nama anda agar dapat meggunakan fitur ini";
 "Create Group" = "Buat Grup";
-"Add Friend" = "Tambah Teman";
+"Add Friends" = "Tambah Teman";
 "Favorite Messages" = "Pesan Favorit";
 "Broadcast Message" = "Pesan Siaran";
 "Live Streaming" = "Siaran Langsung";
+"Save" = "Simpan";
+"Name" = "Nama";
+"Block" = "Blokir";
+"Unblock" = "Buka Blokir";
+"You blocked this user" = "Anda memblokir pengguna ini";
+"You have been blocked by this user" = "Anda telah diblokir oleh pengguna ini";
+"For Me" = "untuk saya";
+"For Everyone" = "untuk semua orang";
+"You were deleted this message" = "Anda telah menghapus pesan ini";
+"This message was deleted" = "Pesan ini telah dihapus";
+"Are you sure to unfriend" = "Apakah Anda yakin membatalkan pertemanan dengan";

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -2391,7 +2391,7 @@ extension Nexilis: MessageDelegate {
                     floating.transparency = 0.9
                     
                     if threadIdentifier == "-999" {
-                        profileImage.image = UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                        profileImage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                     } else if profile != "" {
                         profileImage.circle()
                         do {

+ 10 - 16
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -67,13 +67,10 @@ public class EditorGroup: UIViewController {
         }
     }
     
-    deinit {
-        UserDefaults.standard.removeObject(forKey: "inEditorGroup")
-        NotificationCenter.default.removeObserver(self)
-        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshView"), object: nil, userInfo: nil)
-    }
-    
     public override func viewDidAppear(_ animated: Bool) {
+        navigationController?.navigationBar.isTranslucent = false
+        navigationController?.navigationBar.barTintColor = UIColor.mainColor
+        navigationController?.navigationBar.tintColor = .white
         if self.navigationController?.isNavigationBarHidden ?? false {
             self.navigationController?.setNavigationBarHidden(false, animated: false)
         }
@@ -83,10 +80,6 @@ public class EditorGroup: UIViewController {
         super.viewDidLoad()
         
         updateProfile()
-        
-        navigationController?.navigationBar.isTranslucent = false
-        navigationController?.navigationBar.barTintColor = UIColor.mainColor
-        navigationController?.navigationBar.tintColor = .white
 //        navigationController?.navigationBar.topItem?.title = ""
         
         viewButton.layer.shadowColor = UIColor.gray.cgColor
@@ -187,7 +180,7 @@ public class EditorGroup: UIViewController {
             }),
         ])
         if !isHistoryCC {
-            let moreIcon = UIBarButtonItem(image: UIImage(systemName: "ellipsis"), menu: menu)
+            let moreIcon = UIBarButtonItem(image: UIImage(systemName: "ellipsis", withConfiguration: UIImage.SymbolConfiguration(pointSize: 18, weight: .regular, scale: .default)), menu: menu)
             navigationItem.rightBarButtonItem = moreIcon
         }
     }
@@ -927,6 +920,7 @@ public class EditorGroup: UIViewController {
     @objc func didTapExit() {
         UserDefaults.standard.removeObject(forKey: "inEditorGroup")
         NotificationCenter.default.removeObserver(self)
+        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshView"), object: nil, userInfo: nil)
         self.dismiss(animated: true, completion: nil)
     }
     
@@ -1980,9 +1974,9 @@ extension EditorGroup: UIContextMenuInteractionDelegate {
             children = [star, reply ,delete]
         }
         else if self.removed {
-            children = [star, forward, copy ,delete]
+            children = [copy]
             if !(dataMessages[indexPath!.row]["image_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["video_id"] as! String).isEmpty {
-                children = [star, forward ,delete]
+                children = []
             }
         }
         else if !(dataMessages[indexPath!.row]["image_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["video_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["file_id"] as! String).isEmpty || dataMessages[indexPath!.row]["attachment_flag"] as! String == "11" {
@@ -2669,7 +2663,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
             
             let pictureImage = dataProfile["image_id"]
             if dataMessages[indexPath.row]["f_pin"] as? String == "-999" {
-                profileMessage.image = UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 profileMessage.contentMode = .scaleAspectFill
             }
             else if (pictureImage != "" && pictureImage != nil) {
@@ -2799,9 +2793,9 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
         var textChat = (dataMessages[indexPath.row]["message_text"])! as? String
         if (dataMessages[indexPath.row]["lock"] != nil && (dataMessages[indexPath.row]["lock"])! as? String == "1") {
             if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
-                textChat = "🚫 _You were deleted this message_"
+                textChat = "🚫 _"+"You were deleted this message".localized()+"_"
             } else {
-                textChat = "🚫 _This message was deleted_"
+                textChat = "🚫 _"+"This message was deleted".localized()+"_"
             }
         }
         

+ 13 - 18
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -80,15 +80,10 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate {
         }
     }
     
-    deinit {
-        print("MASUK DEINIT EDITOR PERSONAL")
-        self.timeoutCC.invalidate()
-        UserDefaults.standard.removeObject(forKey: "inEditorPersonal")
-        NotificationCenter.default.removeObserver(self)
-        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshView"), object: nil, userInfo: nil)
-    }
-    
     public override func viewDidAppear(_ animated: Bool) {
+        navigationController?.navigationBar.isTranslucent = false
+        navigationController?.navigationBar.barTintColor = UIColor.mainColor
+        navigationController?.navigationBar.tintColor = .white
         if self.navigationController?.isNavigationBarHidden ?? false {
             self.navigationController?.setNavigationBarHidden(false, animated: false)
         }
@@ -98,10 +93,6 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate {
         super.viewDidLoad()
         
         updateProfile()
-        
-        navigationController?.navigationBar.isTranslucent = false
-        navigationController?.navigationBar.barTintColor = UIColor.mainColor
-        navigationController?.navigationBar.tintColor = .white
 //        navigationController?.navigationBar.topItem?.title = ""
         
         viewButton.layer.shadowColor = UIColor.gray.cgColor
@@ -395,7 +386,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate {
             changeAppBar()
         }
         
-        let moreIcon = UIBarButtonItem(image: UIImage(systemName: "ellipsis"), menu: menu)
+        let moreIcon = UIBarButtonItem(image: UIImage(systemName: "ellipsis", withConfiguration: UIImage.SymbolConfiguration(pointSize: 18, weight: .regular, scale: .default)), menu: menu)
         let buttonAudioCall = UIBarButtonItem(image: UIImage(systemName: "phone", withConfiguration: UIImage.SymbolConfiguration(pointSize: 18, weight: .regular, scale: .default)), style: .plain, target: self, action: #selector(audioVideoCall(sender:)))
         buttonAudioCall.tag = 0
         let buttonVideoCall = UIBarButtonItem(image: UIImage(systemName: "video", withConfiguration: UIImage.SymbolConfiguration(pointSize: 18, weight: .regular, scale: .default)), style: .plain, target: self, action: #selector(audioVideoCall(sender:)))
@@ -581,7 +572,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate {
             }
         } else if dataPerson["f_pin"]!! == "-999" {
             viewAppBar.addSubview(imageProfile)
-            imageProfile.image = UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+            imageProfile.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
             imageProfile.contentMode = .scaleAspectFit
         }
         else if (pictureImage != "" && pictureImage != nil) {
@@ -1525,6 +1516,10 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate {
     
     @objc func didTapExit() {
         if complaintId.isEmpty {
+            self.timeoutCC.invalidate()
+            UserDefaults.standard.removeObject(forKey: "inEditorPersonal")
+            NotificationCenter.default.removeObserver(self)
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshView"), object: nil, userInfo: nil)
             self.dismiss(animated: true, completion: nil)
         } else if !complaintId.isEmpty {
             let alert = UIAlertController(title: "Interaction with Call Center is in progress".localized(), message: "Are you sure you want to end the Call Center?".localized(), preferredStyle: .alert)
@@ -2788,9 +2783,9 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
         } else if (dataMessages[indexPath!.row]["lock"] != nil && dataMessages[indexPath!.row]["lock"] as! String == "1") || dataMessages[indexPath!.row]["message_scope_id"] as! String == "18" || dataPerson["f_pin"] == "-999" {
             children = [delete]
         } else if self.removed || blocking == "1" || blocking == "-1" {
-            children = [star, forward, copy ,delete]
+            children = [copy]
             if !(dataMessages[indexPath!.row]["image_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["video_id"] as! String).isEmpty {
-                children = [star, forward ,delete]
+                children = []
             }
         }
         else if !(dataMessages[indexPath!.row]["image_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["video_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["file_id"] as! String).isEmpty || dataMessages[indexPath!.row]["attachment_flag"] as! String == "11" {
@@ -3799,9 +3794,9 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
         var textChat = (dataMessages[indexPath.row]["message_text"] as? String) ?? ""
         if (dataMessages[indexPath.row]["lock"] != nil && (dataMessages[indexPath.row]["lock"])! as? String == "1") {
             if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
-                textChat = "🚫 _You were deleted this message_"
+                textChat = "🚫 _"+"You were deleted this message".localized()+"_"
             } else {
-                textChat = "🚫 _This message was deleted_"
+                textChat = "🚫 _"+"This message was deleted".localized()+"_"
             }
         }
         

+ 3 - 3
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorStarMessages.swift

@@ -267,7 +267,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
             
             let pictureImage = dataProfile["image_id"]
             if dataMessages[indexPath.row]["f_pin"] as! String == "-999" {
-                profileMessage.image = UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 profileMessage.contentMode = .scaleAspectFit
             }
             if (pictureImage != "" && pictureImage != nil) {
@@ -350,9 +350,9 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
         var textChat = (dataMessages[indexPath.row]["message_text"])! as? String
         if (dataMessages[indexPath.row]["lock"] != nil && (dataMessages[indexPath.row]["lock"])! as? String == "1") {
             if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
-                textChat = "🚫 _You were deleted this message_"
+                textChat = "🚫 _"+"You were deleted this message".localized()+"_"
             } else {
-                textChat = "🚫 _This message was deleted_"
+                textChat = "🚫 _"+"This message was deleted".localized()+"_"
             }
         }
         if let attachmentFlag = dataMessages[indexPath.row]["attachment_flag"], let attachmentFlag = attachmentFlag as? String {

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Contact/ContactCallViewController.swift

@@ -62,7 +62,7 @@ class ContactCallViewController: UIViewController {
                     }
                     self.navigationController?.present(controller, animated: true, completion: nil)
                 }),
-                UIAction(title: "Add Friends", image: UIImage(systemName: "person.badge.plus"), handler: {(_) in
+                UIAction(title: "Add Friends".localized(), image: UIImage(systemName: "person.badge.plus"), handler: {(_) in
                     let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "addFriendNav") as! UINavigationController
                     if let vc = controller.viewControllers.first as? AddFriendTableViewController {
                         vc.isDismiss = {

+ 4 - 40
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -84,7 +84,7 @@ class ContactChatViewController: UITableViewController {
                 }
                 self?.navigationController?.present(controller, animated: true, completion: nil)
             }),
-            UIAction(title: "Add Friends", image: UIImage(systemName: "person.badge.plus"), handler: {[weak self](_) in
+            UIAction(title: "Add Friends".localized(), image: UIImage(systemName: "person.badge.plus"), handler: {[weak self](_) in
                 let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "addFriendNav") as! UINavigationController
                 if let vc = controller.viewControllers.first as? AddFriendTableViewController {
                     vc.isDismiss = {
@@ -178,44 +178,8 @@ class ContactChatViewController: UITableViewController {
     }
     
     @objc func onReceiveMessage(notification: NSNotification) {
-        let data:[AnyHashable : Any] = notification.userInfo!
-        guard let dataMessage = data["message"] as? TMessage else {
-            return
-        }
-        let isUser = User.getData(pin: dataMessage.getBody(key: CoreMessage_TMessageKey.L_PIN)) != nil
-        let chatId = dataMessage.getBody(key: CoreMessage_TMessageKey.CHAT_ID, default_value: "").isEmpty ? dataMessage.getBody(key: CoreMessage_TMessageKey.L_PIN) : dataMessage.getBody(key: CoreMessage_TMessageKey.CHAT_ID, default_value: "")
-        let pin = isUser ? dataMessage.getBody(key: CoreMessage_TMessageKey.F_PIN) : chatId
-        let messageId = dataMessage.getBody(key: CoreMessage_TMessageKey.MESSAGE_ID)
-        if let index = chats.firstIndex(of: Chat(pin: pin)) {
-            guard let chat = Chat.getData(messageId: messageId).first else {
-                return
-            }
-            DispatchQueue.main.async {
-                if self.segment.selectedSegmentIndex == 0 {
-                    self.tableView.beginUpdates()
-                    self.chats.remove(at: index)
-                    self.tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .none)
-                }
-                self.chats.insert(chat, at: 0)
-                if self.segment.selectedSegmentIndex == 0 {
-                    self.tableView.insertRows(at: [IndexPath(row: 0, section: 0)], with: .none)
-                    self.tableView.endUpdates()
-                }
-            }
-        } else {
-            guard let chat = Chat.getData(messageId: messageId).first else {
-                return
-            }
-            DispatchQueue.main.async {
-                if self.segment.selectedSegmentIndex == 0 {
-                    self.tableView.beginUpdates()
-                }
-                self.chats.insert(chat, at: 0)
-                if self.segment.selectedSegmentIndex == 0 {
-                    self.tableView.insertRows(at: [IndexPath(row: 0, section: 0)], with: .none)
-                    self.tableView.endUpdates()
-                }
-            }
+        DispatchQueue.main.async {
+            self.getData()
         }
     }
     
@@ -716,7 +680,7 @@ extension ContactChatViewController {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_ball" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
                     imageView.image = image
                 })
             }

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

@@ -141,7 +141,7 @@ class HistoryBroadcastViewController: UIViewController, UITableViewDelegate, UIT
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_ball" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
                     imageView.image = image
                     if !result {
                         imageView.tintColor = .mainColor

+ 12 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ProfileViewController.swift

@@ -142,6 +142,16 @@ public class ProfileViewController: UITableViewController {
         }
     }
     
+    public override func viewWillAppear(_ animated: Bool) {
+        if navigationController?.navigationBar.barTintColor == .mainColor {
+            navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
+        }
+    }
+    
+    public override func viewDidDisappear(_ animated: Bool) {
+        navigationController?.navigationBar.titleTextAttributes = nil
+    }
+    
     public override func viewDidLoad() {
         super.viewDidLoad()
         
@@ -197,6 +207,7 @@ public class ProfileViewController: UITableViewController {
                 message.isEnabled = false
                 buttonGroup.removeFromSuperview()
             }
+            navigationController?.navigationBar.topItem?.backButtonTitle = "Back".localized()
             myViewGroup.removeFromSuperview()
             reload()
         }
@@ -450,7 +461,7 @@ public class ProfileViewController: UITableViewController {
     }
     
     @objc func didTapUnfriend(sender: Any) {
-        let alert = UIAlertController(title: "", message: "Are you sure to unfriend \"\(self.user!.fullName)\"?".localized(), preferredStyle: .alert)
+        let alert = UIAlertController(title: "", message: "Are you sure to unfriend".localized() + " \(self.user!.fullName)", preferredStyle: .alert)
         alert.addAction(UIAlertAction(title: "Cancel".localized(), style: UIAlertAction.Style.default, handler: nil))
         alert.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: {(_) in
             self.unFriend { result in

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

@@ -112,7 +112,7 @@ public class SettingTableViewController: UITableViewController {
                     } else if cursorUser.string(forColumnIndex: 0) != "23" && cursorUser.string(forColumnIndex: 0) != "24" {
                         Item.menus["Personal"]?.insert(Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Sign In Admin / Internal".localized()), at: 1)
                     }
-//                    Item.menus["Personal"]?.insert(Item(icon: UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), title: "Change Image FB Become Photo Profile".localized()), at: 2)
+//                    Item.menus["Personal"]?.insert(Item(icon: UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), title: "Change Image FB Become Photo Profile".localized()), at: 2)
                     let image = cursorUser.string(forColumnIndex: 1)
                     if image != nil {
                         if !image!.isEmpty {