|
@@ -108,6 +108,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
|
|
let maxFakeProgMultip = 2
|
|
let maxFakeProgMultip = 2
|
|
var groupImages: [String:[ImageGrouping]] = [:]
|
|
var groupImages: [String:[ImageGrouping]] = [:]
|
|
var titleText: String!
|
|
var titleText: String!
|
|
|
|
+ var lastY: CGFloat = 0
|
|
|
|
|
|
public override func viewDidDisappear(_ animated: Bool) {
|
|
public override func viewDidDisappear(_ animated: Bool) {
|
|
if self.isMovingFromParent {
|
|
if self.isMovingFromParent {
|
|
@@ -120,6 +121,10 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
|
|
super.viewDidDisappear(true)
|
|
super.viewDidDisappear(true)
|
|
self.removeFromParent()
|
|
self.removeFromParent()
|
|
self.dismiss(animated: true, completion: nil)
|
|
self.dismiss(animated: true, completion: nil)
|
|
|
|
+ if !isContactCenter {
|
|
|
|
+ let l_pin = self.dataPerson["f_pin"]!!
|
|
|
|
+ UserDefaults.standard.set("\(textFieldSend.textColor != UIColor.lightGray ? textFieldSend.text! : ""),\(reffId ?? "")", forKey: "saved_\(l_pin)")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -310,6 +315,8 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
|
|
Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
_ = 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")
|
|
_ = 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")
|
|
_ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(self.dataPerson["f_pin"]!!)'")
|
|
_ = Database.shared.deleteRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", _where: "l_pin='\(self.dataPerson["f_pin"]!!)'")
|
|
|
|
+ let l_pin = self.dataPerson["f_pin"]!!
|
|
|
|
+ UserDefaults.standard.removeObject(forKey: "saved_\(l_pin)")
|
|
if self.fromNotification {
|
|
if self.fromNotification {
|
|
self.didTapExit()
|
|
self.didTapExit()
|
|
} else {
|
|
} else {
|
|
@@ -617,6 +624,19 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ let l_pin = self.dataPerson["f_pin"]
|
|
|
|
+ if let dataSaved = UserDefaults.standard.string(forKey: "saved_\(l_pin)") {
|
|
|
|
+ let last_m = dataSaved.components(separatedBy: ",")[0]
|
|
|
|
+ let last_r = dataSaved.components(separatedBy: ",")[1]
|
|
|
|
+ if !last_m.isEmpty {
|
|
|
|
+ textFieldSend.text = last_m
|
|
|
|
+ textFieldSend.textColor = UIColor.black
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if !last_r.isEmpty {
|
|
|
|
+ reffId = last_r
|
|
|
|
+ }
|
|
|
|
+ }
|
|
tableChatView.scrollToBottom(isAnimated: false)
|
|
tableChatView.scrollToBottom(isAnimated: false)
|
|
}
|
|
}
|
|
} else if isContactCenter && onGoingCC {
|
|
} else if isContactCenter && onGoingCC {
|
|
@@ -4176,6 +4196,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
|
|
}
|
|
}
|
|
|
|
|
|
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
|
|
+ lastY = scrollView.contentOffset.y
|
|
checkNewMessage(tableView: self.tableChatView)
|
|
checkNewMessage(tableView: self.tableChatView)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6560,4 +6581,3 @@ public class ImageGrouping {
|
|
self.dataTopic = dataTopic
|
|
self.dataTopic = dataTopic
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|