Files
open-anylink-web/src/const/msgConst.js
2025-04-29 16:44:00 +08:00

54 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const msgType = {
NO_MORE_MSG: 1,
USER_MSG: 2
}
export const proto = {
magic: 0x8e110b0b,
version: 0x01
}
// 和服务端约定好的第一个消息都是从10001开始的
export const BEGIN_MSG_ID = 10001
// 消息内容类型
export const msgContentType = {
MIX: 0, // 组合,包含多种类型
TEXT: 1, // 文本
IMAGE: 2, // 图片
RECORDING: 3, // 语音
AUDIO: 4, // 音频文件
EMOJI: 5, // 表情
VIDEO: 6, // 视频
DOCUMENT: 7 // 文档
}
// 消息发送状态
export const msgSendStatus = {
PENDING: 'pending', // 发送中
OK: 'ok', // 发送成功
FAILED: 'failed', // 发送失败
UPLOAD_FAILED: 'uploadFailed' // 文件上传失败
}
/**
* 消息中文件的上传状态
* 目前没有实现上传状态以及上传进度的效果
*/
export const msgFileUploadStatus = {
UPLOAD_DEFAULT: 0, // 默认状态,不上传
UPLOADING: 1, // 上传中
UPLOAD_SUCCESS: 2, // 上传成功
UPLOAD_FAILED: 3 // 上传失败
}
/**
* 消息撤回时间限制 10分钟
*/
export const MSG_REVOKE_TIME_LIMIT = 10 * 60 * 1000
/**
* 消息撤回后能重新编辑的时间限制 2分钟
*/
export const MSG_REEDIT_TIME_LIMIT = 2 * 60 * 1000