现在发送消息大小不能超过64KB
This commit is contained in:
@@ -136,6 +136,15 @@ public class SendMessageHandler extends IMHandler<WFCMessage.Message> {
|
|||||||
ErrorCode errorCode = ErrorCode.ERROR_CODE_SUCCESS;
|
ErrorCode errorCode = ErrorCode.ERROR_CODE_SUCCESS;
|
||||||
boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;
|
boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;
|
||||||
if (message != null) {
|
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;
|
boolean ignoreMsg = false;
|
||||||
if (!isAdmin) { //admin do not check the right
|
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_ROBOT_NO_TOKEN(27, "robot no token"),
|
||||||
ERROR_CODE_WS_NOT_CONFIGURED_CORRECTLY(28, "ws not configured correctly"),
|
ERROR_CODE_WS_NOT_CONFIGURED_CORRECTLY(28, "ws not configured correctly"),
|
||||||
ERROR_CODE_TIME_INCONSISTENT(30, "time inconsistent"),
|
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_ROOM_NOT_EXIST(60, "conference room not exist"),
|
||||||
ERROR_CODE_CONFERENCE_SERVICE_NOT_AVAILABLE(61, "conference service not available"),
|
ERROR_CODE_CONFERENCE_SERVICE_NOT_AVAILABLE(61, "conference service not available"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user