|
|
@@ -1,8 +1,10 @@
|
|
|
package com.tencent.qcloud.tuikit.tuichat.presenter;
|
|
|
|
|
|
import android.text.TextUtils;
|
|
|
+import android.util.Log;
|
|
|
import android.util.Pair;
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.MessageFeature;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.MessageReceiptInfo;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
|
|
|
@@ -10,6 +12,7 @@ import com.tencent.qcloud.tuikit.timcommon.component.interfaces.IUIKitCallback;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.TUIChatConstants;
|
|
|
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.interfaces.C2CChatEventListener;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
|
|
|
@@ -20,6 +23,7 @@ import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class C2CChatPresenter extends ChatPresenter {
|
|
|
+
|
|
|
private static final String TAG = C2CChatPresenter.class.getSimpleName();
|
|
|
|
|
|
private ChatInfo chatInfo;
|
|
|
@@ -52,12 +56,15 @@ public class C2CChatPresenter extends ChatPresenter {
|
|
|
|
|
|
@Override
|
|
|
public void onRecvNewMessage(TUIMessageBean message) {
|
|
|
+ Log.e("wpp", new Gson().toJson(message));
|
|
|
if (chatInfo == null || !TextUtils.equals(message.getUserId(), chatInfo.getId())) {
|
|
|
TUIChatLog.i(TAG, "receive a new message , not belong to current chat.");
|
|
|
} else {
|
|
|
if (message instanceof MessageTypingBean) {
|
|
|
parseTypingMessage((MessageTypingBean) message);
|
|
|
return;
|
|
|
+ } else if (message instanceof CustomStartConsultationBean) {
|
|
|
+
|
|
|
}
|
|
|
C2CChatPresenter.this.onRecvNewMessage(message);
|
|
|
}
|
|
|
@@ -109,12 +116,13 @@ public class C2CChatPresenter extends ChatPresenter {
|
|
|
|
|
|
/**
|
|
|
* 拉取消息
|
|
|
- * @param type 向前,向后或者前后同时拉取
|
|
|
- * @param lastMessageInfo 拉取消息的起始点
|
|
|
- *
|
|
|
*
|
|
|
- * pull message
|
|
|
- * @param type Pull forward, backward, or both
|
|
|
+ * @param type 向前,向后或者前后同时拉取
|
|
|
+ * @param lastMessageInfo 拉取消息的起始点
|
|
|
+ * <p>
|
|
|
+ * <p>
|
|
|
+ * pull message
|
|
|
+ * @param type Pull forward, backward, or both
|
|
|
* @param lastMessageInfo The starting point for pulling messages
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -226,7 +234,8 @@ public class C2CChatPresenter extends ChatPresenter {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onError(String module, int errCode, String errMsg) {}
|
|
|
+ public void onError(String module, int errCode, String errMsg) {
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|