|
@@ -433,16 +433,14 @@ class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
|
|
|
UserDefaults.standard.set(dataPerson["f_pin"]!, forKey: "inEditorPersonal")
|
|
|
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [dataPerson["f_pin"]!!])
|
|
|
|
|
|
-// if isContactCenter || fromNotification {
|
|
|
-// let imageButton = UIImageView(frame: CGRect(x: -16, y: 0, width: 20, height: 44))
|
|
|
-// imageButton.image = UIImage(systemName: "chevron.backward", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular, scale: .default))?.withTintColor(.white)
|
|
|
-// imageButton.contentMode = .left
|
|
|
-// let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapExit))
|
|
|
-// imageButton.isUserInteractionEnabled = true
|
|
|
-// imageButton.addGestureRecognizer(tapGestureRecognizer)
|
|
|
-// let leftItem = UIBarButtonItem(customView: imageButton)
|
|
|
-// self.navigationItem.leftBarButtonItem = leftItem
|
|
|
-// }
|
|
|
+ let imageButton = UIImageView(frame: CGRect(x: -16, y: 0, width: 20, height: 44))
|
|
|
+ imageButton.image = UIImage(systemName: "chevron.backward", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular, scale: .default))?.withTintColor(.white)
|
|
|
+ imageButton.contentMode = .left
|
|
|
+ let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapExit))
|
|
|
+ imageButton.isUserInteractionEnabled = true
|
|
|
+ imageButton.addGestureRecognizer(tapGestureRecognizer)
|
|
|
+ let leftItem = UIBarButtonItem(customView: imageButton)
|
|
|
+ self.navigationItem.leftBarButtonItem = leftItem
|
|
|
|
|
|
changeAppBar()
|
|
|
getData()
|
|
@@ -1114,142 +1112,6 @@ class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
|
|
|
_ = Nexilis.write(message: tmessage)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// if (pin.equals(HolderMessage.F_PIN_GPT_CHATBOT)) {
|
|
|
-// HolderPerson personHolder = new HolderPerson();
|
|
|
-// personHolder.setFPin(pin);
|
|
|
-// personHolder.setFirstName(HolderMessage.F_PIN_GPT_CHATBOT_NAME);
|
|
|
-// personHolder.setLastName("");
|
|
|
-// personHolder.setQuote(SharedObj.BOT_QUOTE);
|
|
|
-// personHolder.setExBuddyAutoQuote(SharedObj.BOT_QUOTE);
|
|
|
-// personHolder.setAutoQuoteStatus(SharedObj.BOT_QUOTE);
|
|
|
-// personHolder.setThumbId(pin);
|
|
|
-// return personHolder;
|
|
|
-// }
|
|
|
-
|
|
|
-// private void requestGPTBot() {
|
|
|
-// try {
|
|
|
-// addWaitingMessage();
|
|
|
-// new Thread() {
|
|
|
-// @Override
|
|
|
-// public void run() {
|
|
|
-// try {
|
|
|
-// JSONArray array = new JSONArray();
|
|
|
-// for (int i = 0; i < messageList.size(); i++) {
|
|
|
-// HolderMessage msg = (HolderMessage) messageList.get(i);
|
|
|
-// if (msg.getMessageScopeId().equals(CoreDataConstantScope.GPT_CHATBOT)) {
|
|
|
-// JSONObject jo = new JSONObject();
|
|
|
-// jo.put("role", (msg.getFPin().equals(CoreSphereSphere.Mine.getHolder().getfPin()) ? "user" : "assistant"));
|
|
|
-// jo.put(SHARED_CONTENT, msg.getMessageText());
|
|
|
-// array.put(jo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if(bShowAvatar){
|
|
|
-// JSONObject reqObj = new JSONObject();
|
|
|
-// reqObj.put("use_video","1");
|
|
|
-// reqObj.put("payload",array);
|
|
|
-// GPTBot.getInstance(getContext()).request(reqObj.toString(), gptBotCallback);
|
|
|
-// } else {
|
|
|
-// GPTBot.getInstance(getContext()).request(array.toString(), gptBotCallback);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// Lg.e(TAG, e.getMessage(), e);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }.start();
|
|
|
-// } catch (Exception e) {
|
|
|
-// Lg.e(TAG, e.getMessage(), e);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// private void addWaitingMessage() {
|
|
|
-// removeWaitingMessage();
|
|
|
-// HolderMessage message = createGPTBotWaitingMessage("Waiting..");
|
|
|
-// addMessage(message);
|
|
|
-// scrollToBottom();
|
|
|
-// }
|
|
|
-
|
|
|
-// private void removeWaitingMessage() {
|
|
|
-// try {
|
|
|
-// for (int i = 0; i < a1Lsad11Message.getItemCount(); i++) {
|
|
|
-// HolderMessage m = (HolderMessage) a1Lsad11Message.get(i);
|
|
|
-// if (m.getMessageId().contains("gptbot_waiting")) {
|
|
|
-// Lg.d(TAG, "JANCOKK " + m.toJSONObject());
|
|
|
-// a1Lsad11Message.remove(i);
|
|
|
-// a1Lsad11Message.notifyItemRemoved(i);
|
|
|
-// i--;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// Lg.e(TAG, e.getMessage(), e);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// protected void sendMessageCheck(String pMessage) {
|
|
|
-// if (!App.isReady()) {
|
|
|
-// Toast.makeText(API.getContext(), API.getContext().getString(R.string.pb_loading), Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// if (!SharedObj.getSetProfile((Context) getBaseLayout())) {
|
|
|
-// Controller.openChangeProfileAll(null);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// long textMaxSize = UtilMediaUtil.DEFAULT_MAX_SIZE_TEXT_CHAR;
|
|
|
-// if (CoreDataSqlitePrefsDB.getSubscriptionText() != 0) {
|
|
|
-// textMaxSize = CoreDataSqlitePrefsDB.getSubscriptionText();
|
|
|
-// }
|
|
|
-// if (pMessage.length() > textMaxSize) {
|
|
|
-// Toast.makeText((Context) getBaseLayout(), getString(R.string.pb_cant_send_msg_larger_than_) + " " + textMaxSize + " char", Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// HolderMessage message = createGPTBotMessage(CoreSphereSphere.Mine.getHolder().getfPin(), HolderMessage.F_PIN_GPT_CHATBOT, pMessage);
|
|
|
-// saveMessage(message);
|
|
|
-// addMessage(message);
|
|
|
-// requestGPTBot();
|
|
|
-// }
|
|
|
-
|
|
|
-// private HolderMessage createGPTBotWaitingMessage(String message) {
|
|
|
-// HolderMessage holder = new HolderMessage();
|
|
|
-// holder.setMessageId("gptbot_waiting" + System.currentTimeMillis());
|
|
|
-// holder.setFPin(HolderMessage.F_PIN_GPT_CHATBOT);
|
|
|
-// holder.setLPin(CoreSphereSphere.Mine.getHolder().getfPin());
|
|
|
-// holder.setExOppositePin(CoreSphereSphere.Mine.getHolder().getfPin());
|
|
|
-// holder.setMessageText(message);
|
|
|
-// holder.setServerDate(System.currentTimeMillis());
|
|
|
-// holder.setLocalTimestamp(System.currentTimeMillis());
|
|
|
-// holder.setMessageScopeId(CoreDataConstantScope.GPT_CHATBOT);
|
|
|
-// holder.setAttachmentFlag(HolderMessage.ATTACHMENT_LOADING_DOTS);
|
|
|
-// holder.setStatus(HolderMessage.READ);
|
|
|
-// return holder;
|
|
|
-// }
|
|
|
-
|
|
|
-// private HolderMessage createGPTBotMessage(String fPin, String mOppositePin, String message) {
|
|
|
-// HolderMessage holder = new HolderMessage();
|
|
|
-// holder.setMessageId(System.currentTimeMillis() + "gptbot");
|
|
|
-// holder.setFPin(fPin);
|
|
|
-// holder.setLPin(mOppositePin);
|
|
|
-// holder.setExOppositePin(mOppositePin);
|
|
|
-// holder.setMessageText(message);
|
|
|
-// holder.setServerDate(System.currentTimeMillis());
|
|
|
-// holder.setLocalTimestamp(System.currentTimeMillis());
|
|
|
-// holder.setMessageScopeId(CoreDataConstantScope.GPT_CHATBOT);
|
|
|
-// holder.setStatus(HolderMessage.READ);
|
|
|
-// return holder;
|
|
|
-// }
|
|
|
-
|
|
|
-// public static final String GPT_CHATBOT = "31";
|
|
|
-
|
|
|
-
|
|
|
- /*
|
|
|
- // MARK: - Navigation
|
|
|
-
|
|
|
- // In a storyboard-based application, you will often want to do a little preparation before navigation
|
|
|
- override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
|
|
- // Get the new view controller using segue.destination.
|
|
|
- // Pass the selected object to the new view controller.
|
|
|
- }
|
|
|
- */
|
|
|
|
|
|
}
|
|
|
|