alqindiirsyam 4 mesi fa
parent
commit
934ed58406

+ 11 - 11
NexilisLite/NexilisLite/Source/View/Call/CallLogVC.swift

@@ -44,17 +44,17 @@ public class CallLogVC: UIViewController, UITableViewDataSource, UITableViewDele
         navigationController?.navigationBar.standardAppearance = appearance
         navigationController?.navigationBar.scrollEdgeAppearance = appearance
         
-        let leftButton = UIButton(type: .system)
-        let imageLeft = UIImage(systemName: "ellipsis", withConfiguration: UIImage.SymbolConfiguration(pointSize: 12, weight: .bold))
-        leftButton.setImage(imageLeft, for: .normal)
-        leftButton.tintColor = .black
-        leftButton.backgroundColor = UIColor(white: 0.95, alpha: 1.0)
-        leftButton.layer.cornerRadius = 15
-        leftButton.clipsToBounds = true
-        leftButton.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
-        leftButton.addTarget(self, action: #selector(leftBarButtonTapped), for: .touchUpInside)
-        let leftBarButtonItem = UIBarButtonItem(customView: leftButton)
-        tabBarController?.navigationItem.leftBarButtonItem = leftBarButtonItem
+//        let leftButton = UIButton(type: .system)
+//        let imageLeft = UIImage(systemName: "ellipsis", withConfiguration: UIImage.SymbolConfiguration(pointSize: 12, weight: .bold))
+//        leftButton.setImage(imageLeft, for: .normal)
+//        leftButton.tintColor = .black
+//        leftButton.backgroundColor = UIColor(white: 0.95, alpha: 1.0)
+//        leftButton.layer.cornerRadius = 15
+//        leftButton.clipsToBounds = true
+//        leftButton.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
+//        leftButton.addTarget(self, action: #selector(leftBarButtonTapped), for: .touchUpInside)
+//        let leftBarButtonItem = UIBarButtonItem(customView: leftButton)
+//        tabBarController?.navigationItem.leftBarButtonItem = leftBarButtonItem
         
         let rightButton = UIButton(type: .system)
         let imageRight = UIImage(systemName: "plus", withConfiguration: UIImage.SymbolConfiguration(pointSize: 12, weight: .bold))

+ 3 - 3
NexilisLite/NexilisLite/Source/View/Chat/ChatGPTBotView.swift

@@ -1741,9 +1741,9 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
         topAnchor = dateView.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 10.0)
         NSLayoutConstraint.activate([
             topAnchor,
-            dateView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: -20.0),
+            dateView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: -10.0),
             dateView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor),
-            dateView.heightAnchor.constraint(equalToConstant: 30),
+//            dateView.heightAnchor.constraint(equalToConstant: 30),
             dateView.widthAnchor.constraint(greaterThanOrEqualToConstant: 60)
         ])
         dateView.backgroundColor = .orangeColor
@@ -1773,7 +1773,7 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
     }
     
     public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 80
+        return 50
     }
     
     public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

+ 2 - 0
NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -3854,6 +3854,8 @@ extension EditorGroup: UIContextMenuInteractionDelegate {
             contactChatNav.navigationBar.isTranslucent = false
             let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
             contactChatNav.navigationBar.titleTextAttributes = textAttributes
+            let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
+            UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
             contactChatNav.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
             if let controller = contactChatNav.viewControllers.first as? ContactChatViewController {
                 controller.isChooser = { [weak self] scope, pin in

+ 5 - 2
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -4587,7 +4587,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             else {
                 children = [reply, copy]
             }
-        } 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" || dataMessages[indexPath!.row]["credential"]  as? String ?? "" == "1" {
+        } else if (dataMessages[indexPath!.row]["lock"] != nil && dataMessages[indexPath!.row]["lock"] as? String == "1") || dataMessages[indexPath!.row]["message_scope_id"] as? String == MessageScope.FORM || dataPerson["f_pin"] == "-999" || dataMessages[indexPath!.row]["credential"]  as? String == "1" || dataMessages[indexPath!.row]["message_scope_id"] as? String == MessageScope.CALL || dataMessages[indexPath!.row]["message_scope_id"] as? String == MessageScope.MISSED_CALL {
             children = [delete]
         } else if (groupImages[dataMessages[indexPath!.row]["message_id"]  as? String ?? ""] != nil) {
             forward.title = "Forward All".localized()
@@ -5015,6 +5015,8 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             contactChatNav.navigationBar.isTranslucent = false
             let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
             contactChatNav.navigationBar.titleTextAttributes = textAttributes
+            let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
+            UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
             contactChatNav.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
             if let controller = contactChatNav.viewControllers.first as? ContactChatViewController {
                 controller.isChooser = { [weak self] scope, pin in
@@ -5051,9 +5053,10 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             let idMe = User.getMyPin() as String?
             let dataFilterFpin = dataMessages.filter({ $0["l_pin"] as? String == idMe})
             let dataFilterLock = dataMessages.filter({ $0["lock"] as? String == "1" || $0["lock"] as? String == "2" })
+            let dataFilterCall = dataMessages.filter({ $0[TypeDataMessage.message_scope_id] as? String == MessageScope.CALL || $0[TypeDataMessage.message_scope_id] as? String == MessageScope.MISSED_CALL })
 //            let statusDataRead = dataMessages.filter({ Int($0["status"]  as? String ?? "")! >= 4})
             let statusFailed = dataMessages.filter({ Int($0["status"]  as? String ?? "")! == 0})
-            if dataFilterFpin.count == 0 && dataFilterLock.count == 0 && statusFailed.count == 0 {
+            if dataFilterFpin.count == 0 && dataFilterLock.count == 0 && statusFailed.count == 0 && dataFilterCall.count == 0 {
                 if let action = self.actionDelete(for: "everyone", title: "Delete".localized() + " \(countSelected) " + "For Everyone".localized(), dataMessages: dataMessages) {
                     alertController.addAction(action)
                 }

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

@@ -222,7 +222,7 @@ extension ContactCallViewController: UITableViewDelegate {
         if startWhiteBoard && startSS {
             return
         } else if (isAddParticipantVideo) {
-            self.dismiss(animated: true, completion: {
+            UIApplication.shared.visibleViewController?.dismiss(animated: true, completion: {
                 self.isDismiss?(self.dataPerson[indexPath.row] as [String: String?])
             })
         } else if startWhiteBoard {

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

@@ -432,6 +432,9 @@ class ContactChatViewController: UITableViewController {
                     tempChats.append(singleChat)
                 }
             }
+            if self.isChooser != nil {
+                tempChats.removeAll(where: { $0.pin == "-997" })
+            }
             self.chats = tempChats
             completion()
         }
@@ -439,13 +442,15 @@ class ContactChatViewController: UITableViewController {
     
     private func getContacts(completion: @escaping ()->()) {
         self.contacts.removeAll()
-        let gptUser = User(pin: "-997",
-                        firstName: "GPT SmartBot",
-                        lastName: "",
-                        thumb: "",
-                        userType: "0",
-                        official: "1")
-        contacts.append(gptUser)
+        if self.isChooser == nil {
+            let gptUser = User(pin: "-997",
+                            firstName: "GPT SmartBot",
+                            lastName: "",
+                            thumb: "",
+                            userType: "0",
+                            official: "1")
+            contacts.append(gptUser)
+        }
         DispatchQueue.global().async {
             Database.shared.database?.inTransaction({ (fmdb, rollback) in
                 do {