|
|
@@ -5,6 +5,7 @@ import android.util.Log;
|
|
|
import android.util.Pair;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
+import com.tencent.imsdk.v2.V2TIMMessage;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.MessageFeature;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.MessageReceiptInfo;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
|
|
|
@@ -14,7 +15,9 @@ import com.tencent.qcloud.tuikit.tuichat.TUIChatService;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.bean.ChatInfo;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.bean.CustomStartConsultationBean;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.bean.message.MessageTypingBean;
|
|
|
+import com.tencent.qcloud.tuikit.tuichat.bean.message.PatientStartConsultationBean;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.interfaces.C2CChatEventListener;
|
|
|
+import com.tencent.qcloud.tuikit.tuichat.util.ChatMessageBuilder;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatUtils;
|
|
|
|
|
|
@@ -64,7 +67,14 @@ public class C2CChatPresenter extends ChatPresenter {
|
|
|
parseTypingMessage((MessageTypingBean) message);
|
|
|
return;
|
|
|
} else if (message instanceof CustomStartConsultationBean) {
|
|
|
-
|
|
|
+ V2TIMMessage v2TIMMessage = message.getV2TIMMessage();
|
|
|
+ if (v2TIMMessage != null) {
|
|
|
+ String description = v2TIMMessage.getCustomElem().getDescription();
|
|
|
+ if (!TextUtils.isEmpty(description)) {
|
|
|
+ sendPatientMessage(description);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return;
|
|
|
}
|
|
|
C2CChatPresenter.this.onRecvNewMessage(message);
|
|
|
}
|
|
|
@@ -114,6 +124,18 @@ public class C2CChatPresenter extends ChatPresenter {
|
|
|
initMessageSender();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 发送患者信息
|
|
|
+ */
|
|
|
+ private void sendPatientMessage(String description) {
|
|
|
+ Gson gson = new Gson();
|
|
|
+ PatientStartConsultationBean patientStartConsultationBean = new PatientStartConsultationBean();
|
|
|
+ patientStartConsultationBean.businessID = TUIChatConstants.BUSINESS_ID_CUSTOM_PATIENT_CONSULTATION;
|
|
|
+ String data = gson.toJson(patientStartConsultationBean);
|
|
|
+ TUIMessageBean info = ChatMessageBuilder.buildCustomMessage(data, description, description.getBytes());
|
|
|
+ sendMessage(info, false, null);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 拉取消息
|
|
|
*
|