fix chat
parent
eddd5459e0
commit
96bf9d7482
|
@ -99,14 +99,23 @@ public class ChatLogic {
|
|||
return;
|
||||
}
|
||||
FriendManager friendManager = user.getFriendManager();
|
||||
boolean result = true;
|
||||
long nowTime = System.currentTimeMillis();
|
||||
|
||||
long nowTime = System.currentTimeMillis();
|
||||
String tmp = SensitivewordFilter.replaceSensitiveWord(message, 1, "*");
|
||||
|
||||
|
||||
if(!tmp.equals(message)){
|
||||
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1);
|
||||
ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build();
|
||||
MessageUtil.sendMessage(iSession,1,msgId,response,true);
|
||||
return;
|
||||
}
|
||||
boolean result = true;
|
||||
switch (chatType){
|
||||
case 1:
|
||||
//0|content需要解字符串
|
||||
String s = message;
|
||||
String[] strs = message.split("\\|",3);
|
||||
String[] strs = message.split("|",3);
|
||||
if(strs.length==3){
|
||||
message = strs[2];
|
||||
}
|
||||
|
@ -121,13 +130,11 @@ public class ChatLogic {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if (!result) {
|
||||
String s = SensitivewordFilter.replaceSensitiveWord(message, 1, "*");
|
||||
// MessageUtil.sendErrorResponse(iSession, 0, msgId, "包含敏感字");
|
||||
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,s,nowTime,-1);
|
||||
if(!result){
|
||||
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1);
|
||||
ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build();
|
||||
MessageUtil.sendMessage(iSession,1,msgId,response,true);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (chatType){
|
||||
|
|
Loading…
Reference in New Issue