Parcourir la source

Update bug fix

kevin il y a 7 mois
Parent
commit
37372d5918

+ 4 - 4
ExampleCode/ExampleCode.xcodeproj/project.pbxproj

@@ -508,7 +508,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = FR2C2CZUYZ;
+				DEVELOPMENT_TEAM = 4R36B4D29V;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -537,7 +537,7 @@
 				MARKETING_VERSION = 1.0;
 				OTHER_CFLAGS = "";
 				"OTHER_CFLAGS[arch=*]" = "-fstack-protector-all";
-				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.ExampleCode;
+				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.ExampleCode420;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
 				SUPPORTS_MACCATALYST = NO;
@@ -557,7 +557,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = FR2C2CZUYZ;
+				DEVELOPMENT_TEAM = 4R36B4D29V;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -585,7 +585,7 @@
 				INFOPLIST_KEY_UIUserInterfaceStyle = Light;
 				MARKETING_VERSION = 1.0;
 				"OTHER_CFLAGS[arch=*]" = "-fstack-protector-all";
-				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.ExampleCode;
+				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.ExampleCode420;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
 				SUPPORTS_MACCATALYST = NO;

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

@@ -376,4 +376,5 @@
 "Failed, unknown user" = "Gagal, pengguna tidak dikenal";
 "Failed, blocked user" = "Gagal, pengguna telah diblokir";
 "Feature disabled.." = "Fitur dinonaktifkan..";
+"Message has expired" = "Pesan telah kadaluarsa";
 

+ 13 - 8
NexilisLite/NexilisLite/Source/Download.swift

@@ -45,11 +45,11 @@ public class Download {
         _ = Nexilis.write(message: CoreMessage_TMessageBank.getImageDownload(p_image_id: forKey))
     }
     
-    public func startHTTP(forKey: String, completion: @escaping (String, Double)->()) {
-        _ = startHTTP(filename: forKey, baseURL: DOWNLOAD_URL, completion: completion)
+    public func startHTTP(forKey: String, isImage: Bool = true, completion: @escaping (String, Double)->()) {
+        _ = startHTTP(filename: forKey, isImage: isImage, baseURL: DOWNLOAD_URL, completion: completion)
     }
     
-    public func startHTTP(filename: String, baseURL: String, completion: @escaping (String, Double)->()) {
+    public func startHTTP(filename: String, isImage: Bool = true, baseURL: String, completion: @escaping (String, Double)->()) {
         let download = Nexilis.getDownload(forKey: filename)
         if download == nil {
             Nexilis.addDownload(forKey: filename, download: self)
@@ -89,12 +89,17 @@ public class Download {
                             let url = documentDir.appendingPathComponent(filename)
                             //print("write file \(url.path)")
                             let dResponse = try FileEncryption.shared.decryptToMemory(successResponse, MasterKeyUtil.shared.getServerKey())
-                            let imageOr = UIImage(data: successResponse)
-                            let imageDec = UIImage(data: dResponse)
-                            if imageDec != nil {
+                            if isImage {
+                                let imageOr = UIImage(data: successResponse)
+                                let imageDec = UIImage(data: dResponse)
+                                if imageDec != nil {
+                                    try dResponse.write(to: url)
+                                } else {
+                                    try successResponse.write(to: url)
+                                }
+                            }
+                            else {
                                 try dResponse.write(to: url)
-                            } else {
-                                try successResponse.write(to: url)
                             }
                             Nexilis.removeDownload(forKey: filename)
                             completion(filename,100)

+ 7 - 1
NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -459,6 +459,12 @@ public class Nexilis: NSObject {
                                         
                                     }
                                 }
+                                if jsonData["chatbot_greetings"]! != nil {
+                                    if let greeting = jsonData["chatbot_greetings"] as? String {
+                                        print("Chatbot greeting: \(greeting)")
+                                        Utils.setChatbotGreetings(value: greeting)
+                                    }
+                                }
                             }
                             if let convertJsonFA = try? JSONSerialization.data(withJSONObject: jsonFA, options: .prettyPrinted) {
                                 if let jsonFAString = String(data: convertJsonFA, encoding: .utf8) {
@@ -2691,7 +2697,7 @@ extension Nexilis: MessageDelegate {
                                         
                                     }
                                 } else {
-                                    Download().startHTTP(forKey: file) { (name, progress) in
+                                    Download().startHTTP(forKey: file, isImage: false) { (name, progress) in
                                         DispatchQueue.main.async {
                                             guard progress == 100 else {
                                                 return

+ 3 - 3
NexilisLite/NexilisLite/Source/View/Call/QmeraVideoViewController.swift

@@ -115,7 +115,7 @@ class QmeraVideoViewController: UIViewController {
         navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
         navigationController?.navigationBar.shadowImage = nil
         navigationController?.navigationBar.isTranslucent = false
-        navigationController?.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
+//        navigationController?.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
         let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
         navigationController?.navigationBar.titleTextAttributes = textAttributes
         navigationController?.navigationBar.topItem?.backBarButtonItem = nil
@@ -128,7 +128,7 @@ class QmeraVideoViewController: UIViewController {
             navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
             navigationController?.navigationBar.shadowImage = nil
             navigationController?.navigationBar.isTranslucent = false
-            navigationController?.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
+//            navigationController?.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
             let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
             navigationController?.navigationBar.titleTextAttributes = textAttributes
             navigationController?.navigationBar.topItem?.backBarButtonItem = nil
@@ -644,7 +644,7 @@ class QmeraVideoViewController: UIViewController {
         let navigationController = CustomNavigationController(rootViewController: editorPersonalVC)
         navigationController.modalPresentationStyle = .overCurrentContext
         navigationController.navigationBar.tintColor = .white
-        navigationController.navigationBar.barTintColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
+//        navigationController.navigationBar.barTintColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
         navigationController.navigationBar.isTranslucent = false
         navigationController.navigationBar.overrideUserInterfaceStyle = .dark
         navigationController.navigationBar.barStyle = .black

+ 1 - 1
NexilisLite/NexilisLite/Source/View/Call/WhiteboardViewController.swift

@@ -335,7 +335,7 @@ class WhiteboardViewController: UIViewController, WhiteboardDelegate {
     
     
     @IBAction func onAlphaChanged(_ sender: UISlider) {
-        let alp = sender.value / 100.0
+        let alp = ((sender.value / (100.0 / 25.0)) + (100.0 - 25.0))  / 100.0
         view.backgroundColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: CGFloat(alp))
     }
     

+ 4 - 4
NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -1957,7 +1957,7 @@ public class EditorGroup: UIViewController {
                         }
                     }
                 } else if dataMessages[index]["video_id"] as? String != nil && !((dataMessages[index]["video_id"] as? String)!.isEmpty){
-                    Download().startHTTP(forKey: dataMessages[index]["video_id"] as! String) { (name, progress) in
+                    Download().startHTTP(forKey: dataMessages[index]["video_id"] as! String, isImage: false) { (name, progress) in
                         guard progress == 100 else {
                             return
                         }
@@ -2008,7 +2008,7 @@ public class EditorGroup: UIViewController {
                     }
                 }
                 else if dataMessages[index]["file_id"] as? String != nil && !((dataMessages[index]["file_id"] as? String)!.isEmpty) {
-                    Download().startHTTP(forKey: dataMessages[index]["file_id"] as! String) { (name, progress) in
+                    Download().startHTTP(forKey: dataMessages[index]["file_id"] as! String, isImage: false) { (name, progress) in
                         guard progress == 100 else {
                             return
                         }
@@ -5178,7 +5178,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
                     imageDownload.centerYAnchor.constraint(equalTo: sender.imageView.centerYAnchor).isActive = true
                     imageDownload.widthAnchor.constraint(equalToConstant: 30).isActive = true
                     imageDownload.heightAnchor.constraint(equalToConstant: 30).isActive = true
-                    Download().startHTTP(forKey: sender.video_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.video_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)
@@ -5291,7 +5291,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
                     imageupload.centerYAnchor.constraint(equalTo: containerLoading.centerYAnchor).isActive = true
                     imageupload.centerXAnchor.constraint(equalTo: containerLoading.centerXAnchor).isActive = true
                     
-                    Download().startHTTP(forKey: sender.file_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.file_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)

+ 4 - 4
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -3015,7 +3015,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                         }
                     }
                 } else if dataMessages[index]["video_id"] as? String != nil && !((dataMessages[index]["video_id"] as? String)!.isEmpty){
-                    Download().startHTTP(forKey: dataMessages[index]["video_id"] as! String) { (name, progress) in
+                    Download().startHTTP(forKey: dataMessages[index]["video_id"] as! String, isImage: false) { (name, progress) in
                         guard progress == 100 else {
                             return
                         }
@@ -3065,7 +3065,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                     }
                 }
                 else if dataMessages[index]["file_id"] as? String != nil && !((dataMessages[index]["file_id"] as? String)!.isEmpty) {
-                    Download().startHTTP(forKey: dataMessages[index]["file_id"] as! String) { (name, progress) in
+                    Download().startHTTP(forKey: dataMessages[index]["file_id"] as! String, isImage: false) { (name, progress) in
                         guard progress == 100 else {
                             return
                         }
@@ -6494,7 +6494,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
                     imageDownload.centerYAnchor.constraint(equalTo: sender.imageView.centerYAnchor).isActive = true
                     imageDownload.widthAnchor.constraint(equalToConstant: 30).isActive = true
                     imageDownload.heightAnchor.constraint(equalToConstant: 30).isActive = true
-                    Download().startHTTP(forKey: sender.video_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.video_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)
@@ -6603,7 +6603,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
                     imageupload.centerYAnchor.constraint(equalTo: containerLoading.centerYAnchor).isActive = true
                     imageupload.centerXAnchor.constraint(equalTo: containerLoading.centerXAnchor).isActive = true
                     
-                    Download().startHTTP(forKey: sender.file_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.file_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)

+ 2 - 2
NexilisLite/NexilisLite/Source/View/Chat/EditorStarMessages.swift

@@ -1224,7 +1224,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                     imageDownload.centerYAnchor.constraint(equalTo: sender.imageView.centerYAnchor).isActive = true
                     imageDownload.widthAnchor.constraint(equalToConstant: 30).isActive = true
                     imageDownload.heightAnchor.constraint(equalToConstant: 30).isActive = true
-                    Download().startHTTP(forKey: sender.video_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.video_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)
@@ -1333,7 +1333,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                     imageupload.centerYAnchor.constraint(equalTo: containerLoading.centerYAnchor).isActive = true
                     imageupload.centerXAnchor.constraint(equalTo: containerLoading.centerXAnchor).isActive = true
                     
-                    Download().startHTTP(forKey: sender.file_id) { (name, progress) in
+                    Download().startHTTP(forKey: sender.file_id, isImage: false) { (name, progress) in
                         DispatchQueue.main.async {
                             guard progress == 100 else {
                                 shapeLoading.strokeEnd = CGFloat(progress / 100)

+ 1 - 1
NexilisLite/NexilisLite/Source/View/Control/BackupRestoreView.swift

@@ -246,7 +246,7 @@ public class BackupRestoreView: UIViewController, UITableViewDataSource, UITable
             if let dirPath = paths.first {
                 let fileURL = URL(fileURLWithPath: dirPath).appendingPathComponent(getFileName(option: optionBackup, fileId: fileIdBackup))
                 if !FileManager.default.fileExists(atPath: fileURL.path) {
-                    Download().startHTTP(forKey: getFileName(option: optionBackup, fileId: fileIdBackup)) { (name, progress) in
+                    Download().startHTTP(forKey: getFileName(option: optionBackup, fileId: fileIdBackup), isImage: false) { (name, progress) in
                         DispatchQueue.main.async { [self] in
                             guard progress == 100 else {
                                 labelRestoring.text = "Downloading...".localized() + "  \(progress)%"