Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
8699f442
Commit
8699f442
authored
Jan 27, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:导医转介屏蔽41和42的云信自定义消息,因为是发给灵犀web端的,只能客户端屏蔽
parent
aba1a1f6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
0 deletions
+82
-0
NIMInitManager.java
m-im/src/main/java/com/yidianling/im/helper/NIMInitManager.java
+14
-0
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+5
-0
CustomAttachParser.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
+8
-0
CustomAttachmentType.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
+3
-0
CustomAttachtmentFilter41.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter41.java
+26
-0
CustomAttachtmentFilter42.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter42.java
+26
-0
No files found.
m-im/src/main/java/com/yidianling/im/helper/NIMInitManager.java
View file @
8699f442
...
...
@@ -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
();
...
...
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
8699f442
...
...
@@ -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
()
{
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
View file @
8699f442
...
...
@@ -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
;
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
View file @
8699f442
...
...
@@ -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
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter41.java
0 → 100644
View file @
8699f442
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
;
}
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter42.java
0 → 100644
View file @
8699f442
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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment