Commit 8699f442 by 霍志良

feat:导医转介屏蔽41和42的云信自定义消息,因为是发给灵犀web端的,只能客户端屏蔽

parent aba1a1f6
......@@ -5,6 +5,11 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.yidianling.avchatkit.common.log.LogUtil;
import com.yidianling.im.session.extension.CustomAttachtmentFilter41;
import com.yidianling.im.session.extension.CustomAttachtmentFilter42;
import com.yidianling.im.session.extension.DefaultCustomAttachment;
import com.yidianling.nimbase.common.ToastHelper;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.NimStrings;
......@@ -103,6 +108,15 @@ public class NIMInitManager {
NIMClient.getService(MsgService.class).registerIMMessageFilter(new IMMessageFilter() {
@Override
public boolean shouldIgnore(IMMessage message) {
/*
* 因为灵犀消息,产品觉得有未知消失类型
* 后端不能区分该消息是给客户端发还是WEB前端发----
* 晚上十点写的代码---TMD---
* 所以过滤掉CustomAttachtmentFilter41和CustomAttachtmentFilter42这个消息类型
* */
if (message.getAttachment() instanceof CustomAttachtmentFilter41||message.getAttachment() instanceof CustomAttachtmentFilter42){
return true;
}
if (UserPreferences.getMsgIgnore() && message.getAttachment() != null) {
if (message.getAttachment() instanceof UpdateTeamAttachment) {
UpdateTeamAttachment attachment = (UpdateTeamAttachment) message.getAttachment();
......
......@@ -65,6 +65,8 @@ import com.yidianling.im.session.extension.CustomAttachmentRedStatus;
import com.yidianling.im.session.extension.CustomAttachmentShareMsg;
import com.yidianling.im.session.extension.CustomAttachmentSwitchKeFuTips;
import com.yidianling.im.session.extension.CustomAttachmentTest;
import com.yidianling.im.session.extension.CustomAttachtmentFilter41;
import com.yidianling.im.session.extension.CustomAttachtmentFilter42;
import com.yidianling.im.session.extension.CustomCustomerServiceCardAttachment;
import com.yidianling.im.session.extension.CustomRecommendExpertListMsg;
import com.yidianling.im.session.extension.CustomSystemTips;
......@@ -457,6 +459,9 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachmentBusinessCard.class, MsgViewHolderBusinessCard.class);//专家自定义名片 ,TYPE=34
NimUIKit.registerMsgItemViewHolder(CustomAttachmentJumpToDaoYi.class, MsgViewHolderJumpToDaoYi.class);//跳转导医聊天窗口触发导医分配逻辑,TYPE=35
NimUIKit.registerMsgItemViewHolder(CustomAttachmentSwitchKeFuTips.class, MsgViewHolderSwitchKeFuTips.class);//客服转介需求,TYPE=40
NimUIKit.registerMsgItemViewHolder(CustomAttachtmentFilter41.class, MsgViewHolderUnknown.class);//客服转介需求,TYPE=41过滤掉
NimUIKit.registerMsgItemViewHolder(CustomAttachtmentFilter42.class, MsgViewHolderUnknown.class);//客服转介需求,TYPE=42过滤掉
}
private static void setSessionListener() {
......
......@@ -130,6 +130,14 @@ public class CustomAttachParser implements MsgAttachmentParser {
//客服转介需求
attachment = new CustomAttachmentSwitchKeFuTips();
break;
case CustomAttachmentType.TYPE_FILTER_41:
//客服转介需求41 消息过滤掉
attachment = new CustomAttachtmentFilter41();
break;
case CustomAttachmentType.TYPE_FILTER_42:
//客服转介需求42 消息过滤掉
attachment = new CustomAttachtmentFilter42();
break;
default:
attachment = new DefaultCustomAttachment();
break;
......
......@@ -38,4 +38,7 @@ public interface CustomAttachmentType {
int TYPE_EXPERT_DETAIL_CARD=34;//专家名片
int TYPE_JUMPTO_DAOYI=35;//跳转导医聊天界面
int TYPE_SWITCH_KEFU_TIPS=40;//客服切换第一次提示语
int TYPE_FILTER_41=41;//客服切换过滤41
int TYPE_FILTER_42=42;//客服切换过滤42
}
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2021/1/27
*/
public class CustomAttachtmentFilter41 extends CustomAttachment{
public CustomAttachtmentFilter41() {
super(CustomAttachmentType.TYPE_FILTER_41);
}
@Override
protected void parseData(JSONObject data) {
}
@Override
protected JSONObject packData() {
return null;
}
}
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2021/1/27
*/
public class CustomAttachtmentFilter42 extends CustomAttachment{
public CustomAttachtmentFilter42() {
super(CustomAttachmentType.TYPE_FILTER_42);
}
@Override
protected void parseData(JSONObject data) {
}
@Override
protected JSONObject packData() {
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment