feat : 私聊限制功能, 私聊消息发送前的拦截预留

This commit is contained in:
eggmanQQQ
2024-11-01 14:06:35 +08:00
parent 00bd56cf96
commit 8cb8734b3f
3 changed files with 28 additions and 43 deletions

View File

@@ -1,14 +1,10 @@
package com.chwl.core.im.custom.bean;
import static com.chwl.core.im.custom.bean.CustomAttachment.*;
import static com.chwl.library.utils.log.LogToES.writeLog;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.chwl.core.utils.WLog;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachmentParser;
import com.chwl.core.R;
import com.chwl.core.bean.attachmsg.RoomQueueMsgAttachment;
import com.chwl.core.community.attachment.DynamicSysAttachment;
@@ -39,8 +35,11 @@ import com.chwl.core.room.queuing_mic.attachment.QueuingMicAttachment;
import com.chwl.core.super_admin.attachment.SuperAdminOpAttachment;
import com.chwl.core.super_admin.util.SaMsgUtil;
import com.chwl.core.utils.LogUtils;
import com.chwl.core.utils.WLog;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.utils.log.MLog;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachmentParser;
/**
* 云信自定义消息解析器
@@ -661,35 +660,17 @@ public class CustomAttachParser implements MsgAttachmentParser {
LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second);
break;
}
if (first == BOOM_FIRST) {
LogUtils.dd("本地日志 CustomAttachment --befor fromJson second = "+second);
}
Object value = object.get("data");
if (value instanceof JSONArray) {
if (first == BOOM_FIRST) {
LogUtils.dd("本地日志 CustomAttachment befor fromJson1 value instanceof JSONArray --start second = "+second);
}
JSONArray data = object.getJSONArray("data");
if (attachment != null) {
attachment.fromJsonArr(data);
}
if (first == BOOM_FIRST) {
LogUtils.dd("本地日志 CustomAttachment befor fromJson1 value instanceof JSONArray --end second = "+second);
}
} else {
if (first == BOOM_FIRST) {
LogUtils.dd("本地日志 CustomAttachment befor fromJson2 value !instanceof JSONArray --start second = "+second );
if (value != null) {
LogUtils.dd("本地日志 CustomAttachment befor fromJson2 value !instanceof JSONArray second = "+second + "value = "+value.getClass().getSimpleName());
}
}
JSONObject data = object.getJSONObject("data");
if (attachment != null) {
attachment.fromJson(data);
}
if (first == BOOM_FIRST) {
LogUtils.dd("本地日志 CustomAttachment befor fromJson2 value !instanceof JSONArray --end second = "+second );
}
}
} catch (Exception e) {