Documentation
¶
Index ¶
Constants ¶
View Source
const ( // 消息已删除 CMDMessageDeleted = "messageDeleted" // CMDMessageErase 消息擦除 CMDMessageErase = "messageEerase" )
View Source
const ( ReminderTypeMentionMe = 1 // 有人@我 ReminderTypeApplyJoinGroup = 2 // 申请加群 )
View Source
const CacheReadedCountPrefix = "readedCount:" // 消息已读数量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
Conversation 最近会话
type MsgSyncResp ¶
type MsgSyncResp struct {
Header messageHeader `json:"header"` // 消息头部
Setting uint8 `json:"setting"` // 设置
MessageID int64 `json:"message_id"` // 服务端的消息ID(全局唯一)
MessageIDStr string `json:"message_idstr"` // 服务端的消息ID(全局唯一)字符串形式
MessageSeq uint32 `json:"message_seq"` // 消息序列号 (用户唯一,有序递增)
ClientMsgNo string `json:"client_msg_no"` // 客户端消息唯一编号
StreamNo string `json:"stream_no,omitempty"` // 流编号
FromUID string `json:"from_uid"` // 发送者UID
ToUID string `json:"to_uid,omitempty"` // 接受者uid
ChannelID string `json:"channel_id"` // 频道ID
ChannelType uint8 `json:"channel_type"` // 频道类型
Expire uint32 `json:"expire,omitempty"` // expire
Timestamp int32 `json:"timestamp"` // 服务器消息时间戳(10位,到秒)
Payload map[string]interface{} `json:"payload"` // 消息内容
SignalPayload string `json:"signal_payload"` // signal 加密后的payload base64编码,TODO: 这里为了兼容没加密的版本,所以新用SignalPayload字段
ReplyCount int `json:"reply_count,omitempty"` // 回复集合
ReplyCountSeq string `json:"reply_count_seq,omitempty"` // 回复数量seq
ReplySeq string `json:"reply_seq,omitempty"` // 回复seq
Reactions []*reactionSimpleResp `json:"reactions,omitempty"` // 回应数据
IsDeleted int `json:"is_deleted"` // 是否已删除
VoiceStatus int `json:"voice_status,omitempty"` // 语音状态 0.未读 1.已读
Streams []*streamItemResp `json:"streams,omitempty"` // 流数据
// ---------- 旧字段 这些字段都放到MessageExtra对象里了 ----------
Readed int `json:"readed"` // 是否已读(针对于自己)
Revoke int `json:"revoke,omitempty"` // 是否撤回
Revoker string `json:"revoker,omitempty"` // 消息撤回者
ReadedCount int `json:"readed_count,omitempty"` // 已读数量
UnreadCount int `json:"unread_count,omitempty"` // 未读数量
ExtraVersion int64 `json:"extra_version"` // 扩展数据版本号
// 消息扩展字段
MessageExtra *messageExtraResp `json:"message_extra,omitempty"` // 消息扩展
}
MgSyncResp 消息同步请求
type ProhibitWordModel ¶
ProhibitWordModel 违禁词model
type ProhibitWordResp ¶
type ReminderType ¶
type ReminderType int
type Service ¶
func NewService ¶
type SyncUserConversationResp ¶
type SyncUserConversationResp struct {
ChannelID string `json:"channel_id"` // 频道ID
ChannelType uint8 `json:"channel_type"` // 频道类型
Unread int `json:"unread,omitempty"` // 未读消息
Mute int `json:"mute,omitempty"` // 免打扰
Stick int `json:"stick,omitempty"` // 置顶
Timestamp int64 `json:"timestamp"` // 最后一次会话时间
LastMsgSeq int64 `json:"last_msg_seq"` // 最后一条消息seq
LastClientMsgNo string `json:"last_client_msg_no"` // 最后一条客户端消息编号
OffsetMsgSeq int64 `json:"offset_msg_seq"` // 偏移位的消息seq
Version int64 `json:"version,omitempty"` // 数据版本
Recents []*MsgSyncResp `json:"recents,omitempty"` // 最近N条消息
Extra *conversationExtraResp `json:"extra,omitempty"` // 扩展
}
SyncUserConversationResp 最近会话离线返回
type SyncUserConversationRespWrap ¶
type SyncUserConversationRespWrap struct {
UID string `json:"uid"` // 请求者uid
Conversations []*SyncUserConversationResp `json:"conversations"`
Users []*user.UserDetailResp `json:"users"` // 用户详情
Groups []*group.GroupResp `json:"groups"` // 群
}
SyncUserConversationRespWrap SyncUserConversationRespWrap
Source Files
¶
- 1module.go
- api.go
- api_conversation.go
- api_manager.go
- api_pinned.go
- api_reminders.go
- api_vo.go
- common.go
- const.go
- db.go
- db_channel_offset.go
- db_conversation_extra.go
- db_device_offset.go
- db_manager.go
- db_member_readed.go
- db_message_extra.go
- db_message_reaction.go
- db_message_user_extra.go
- db_pinned.go
- db_reminders.go
- db_user_last_offset.go
- event.go
- service.go
Click to show internal directories.
Click to hide internal directories.