现在发送消息大小不能超过64KB

This commit is contained in:
heavyrian2012
2025-08-03 18:04:12 +08:00
parent 88d764fb6d
commit 59b1c3180f
2 changed files with 10 additions and 0 deletions
@@ -136,6 +136,15 @@ public class SendMessageHandler extends IMHandler<WFCMessage.Message> {
ErrorCode errorCode = ErrorCode.ERROR_CODE_SUCCESS;
boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;
if (message != null) {
if(message.getContent().getContent().length() +
message.getContent().getSearchableContent().length() +
message.getContent().getData().size() +
message.getContent().getExtra().length() +
message.getContent().getPushContent().length() +
message.getContent().getPushData().length() > 64 * 1024) {
return ErrorCode.ERROR_CODE_MESSAGE_TOO_LARGE;
}
boolean ignoreMsg = false;
if (!isAdmin) { //admin do not check the right
// 不能在端上直接发送撤回和群通知
@@ -49,6 +49,7 @@ public enum ErrorCode {
ERROR_CODE_ROBOT_NO_TOKEN(27, "robot no token"),
ERROR_CODE_WS_NOT_CONFIGURED_CORRECTLY(28, "ws not configured correctly"),
ERROR_CODE_TIME_INCONSISTENT(30, "time inconsistent"),
ERROR_CODE_MESSAGE_TOO_LARGE(35, "message too large"),
ERROR_CODE_CONFERENCE_ROOM_NOT_EXIST(60, "conference room not exist"),
ERROR_CODE_CONFERENCE_SERVICE_NOT_AVAILABLE(61, "conference service not available"),