|
@@ -359,6 +359,13 @@ 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)
|
|
|
DispatchQueue.global().async {
|
|
|
Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT f_pin, first_name, last_name, image_id, official_account, user_type FROM BUDDY where f_pin <> '\(UserDefaults.standard.string(forKey: "me")!)' order by 5 desc, 2 collate nocase asc") {
|
|
@@ -539,6 +546,10 @@ extension ContactChatViewController {
|
|
|
} else {
|
|
|
data = contacts[indexPath.row]
|
|
|
}
|
|
|
+ if data.pin == "-997" {
|
|
|
+ APIS.openSmartChatbot()
|
|
|
+ return
|
|
|
+ }
|
|
|
if let chooser = isChooser {
|
|
|
var exblock = User.getDataCanNil(pin: data.pin)?.ex_block
|
|
|
exblock = exblock == nil ? "0" : exblock!.isEmpty ? "0" : exblock!
|
|
@@ -866,9 +877,14 @@ extension ContactChatViewController {
|
|
|
data = contacts[indexPath.row]
|
|
|
}
|
|
|
content.imageProperties.maximumSize = CGSize(width: 40, height: 40)
|
|
|
- getImage(name: data.thumb, placeholderImage: UIImage(named: "Profile---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
|
|
|
- content.image = image
|
|
|
- })
|
|
|
+ if data.pin == "-997" {
|
|
|
+ content.image = UIImage(named: "pb_gpt_bot", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ getImage(name: data.thumb, placeholderImage: UIImage(named: "Profile---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
|
|
|
+ content.image = image
|
|
|
+ })
|
|
|
+ }
|
|
|
if User.isOfficial(official_account: data.official ?? "") || User.isOfficialRegular(official_account: data.official ?? "") {
|
|
|
content.attributedText = self.set(image: UIImage(named: "ic_official_flag", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, with: " \(data.fullName)", size: 15, y: -4, colorText: UIColor.officialColor)
|
|
|
|