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
dd734704
Commit
dd734704
authored
Jan 28, 2021
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im消息过滤
parent
0eb6d8ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
46 deletions
+9
-46
NIMInitManager.java
m-im/src/main/java/com/yidianling/im/helper/NIMInitManager.java
+3
-9
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+2
-4
CustomAttachParser.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
+2
-5
CustomAttachmentFilter.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentFilter.java
+2
-2
CustomAttachtmentFilter42.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter42.java
+0
-26
No files found.
m-im/src/main/java/com/yidianling/im/helper/NIMInitManager.java
View file @
dd734704
...
...
@@ -5,8 +5,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
com.yidianling.im.session.extension.CustomAttachtmentFilter41
;
import
com.yidianling.im.session.extension.CustomAttachtmentFilter42
;
import
com.yidianling.im.session.extension.CustomAttachmentFilter
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NimStrings
;
...
...
@@ -105,13 +104,8 @@ 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
){
// 如果消息为CustomAttachmentFilter,则需要过滤掉此条消息,不显示
if
(
message
.
getAttachment
()
instanceof
CustomAttachmentFilter
){
return
true
;
}
if
(
UserPreferences
.
getMsgIgnore
()
&&
message
.
getAttachment
()
!=
null
)
{
...
...
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
dd734704
...
...
@@ -54,6 +54,7 @@ import com.yidianling.im.session.extension.CustomAttachTipMsg;
import
com.yidianling.im.session.extension.CustomAttachment
;
import
com.yidianling.im.session.extension.CustomAttachmentBusinessCard
;
import
com.yidianling.im.session.extension.CustomAttachmentEvaluate
;
import
com.yidianling.im.session.extension.CustomAttachmentFilter
;
import
com.yidianling.im.session.extension.CustomAttachmentJumpToDaoYi
;
import
com.yidianling.im.session.extension.CustomAttachmentOrderStatus
;
import
com.yidianling.im.session.extension.CustomAttachmentPhoneCallRedPacket
;
...
...
@@ -65,8 +66,6 @@ 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
;
...
...
@@ -459,8 +458,7 @@ 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过滤掉
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachmentFilter
.
class
,
MsgViewHolderUnknown
.
class
);
// 注册消息过滤器
}
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
View file @
dd734704
...
...
@@ -130,13 +130,10 @@ public class CustomAttachParser implements MsgAttachmentParser {
//客服转介需求
attachment
=
new
CustomAttachmentSwitchKeFuTips
();
break
;
//41 42消息过滤掉
case
CustomAttachmentType
.
TYPE_FILTER_41
:
//客服转介需求41 消息过滤掉
attachment
=
new
CustomAttachtmentFilter41
();
break
;
case
CustomAttachmentType
.
TYPE_FILTER_42
:
//客服转介需求42 消息过滤掉
attachment
=
new
CustomAttachtmentFilter42
();
attachment
=
new
CustomAttachmentFilter
();
break
;
default
:
attachment
=
new
DefaultCustomAttachment
();
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttach
tmentFilter41
.java
→
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttach
mentFilter
.java
View file @
dd734704
...
...
@@ -9,8 +9,8 @@ import com.alibaba.fastjson.JSONObject;
* @Company 壹点灵
* @date 2021/1/27
*/
public
class
CustomAttach
tmentFilter41
extends
CustomAttachment
{
public
CustomAttach
tmentFilter41
()
{
public
class
CustomAttach
mentFilter
extends
CustomAttachment
{
public
CustomAttach
mentFilter
()
{
super
(
CustomAttachmentType
.
TYPE_FILTER_41
);
}
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachtmentFilter42.java
deleted
100644 → 0
View file @
0eb6d8ea
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