chore: refresh gramsrv public release
This commit is contained in:
parent
75cebe8dbf
commit
70b6820474
1274 changed files with 378751 additions and 59919 deletions
|
|
@ -6,6 +6,9 @@ type PeerType string
|
|||
const (
|
||||
PeerTypeUser PeerType = "user"
|
||||
PeerTypeChannel PeerType = "channel"
|
||||
// PeerTypeFolder 仅用于 dialog 置顶事件中表达 dialogPeerFolder
|
||||
// (archive folder 行本身被置顶/取消置顶),ID 为 folder_id。
|
||||
PeerTypeFolder PeerType = "folder"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -23,14 +26,44 @@ const (
|
|||
MaxDialogFolderTitleRunes = 64
|
||||
// MaxDialogDraftsPerUser bounds messages.getAllDrafts / clearAllDrafts work.
|
||||
MaxDialogDraftsPerUser = 1000
|
||||
// MaxPinnedDialogsMainFolder/MaxPinnedDialogsArchiveFolder 对齐 TDesktop
|
||||
// 内置默认限额(appConfig dialogs_pinned_limit_default=5 /
|
||||
// dialogs_folder_pinned_limit_default=100);超限返回
|
||||
// PINNED_DIALOGS_TOO_MUCH,服务端兜底防止客户端截断后两端漂移。
|
||||
MaxPinnedDialogsMainFolder = 5
|
||||
MaxPinnedDialogsArchiveFolder = 100
|
||||
// premium 档对齐 appConfig dialogs_pinned_limit_premium=10 /
|
||||
// dialogs_folder_pinned_limit_premium=200。服务端档位必须 ≥ 客户端宣告
|
||||
// 档位,否则 premium 用户 pin 第 6 个会话会被拒、UI 回滚。
|
||||
MaxPinnedDialogsMainFolderPremium = 10
|
||||
MaxPinnedDialogsArchiveFolderPremium = 200
|
||||
)
|
||||
|
||||
// PinnedDialogsLimit 返回 folder 维度的置顶上限档位(premium 双档)。
|
||||
func PinnedDialogsLimit(folderID int, premium bool) int {
|
||||
if folderID == DialogArchiveFolderID {
|
||||
if premium {
|
||||
return MaxPinnedDialogsArchiveFolderPremium
|
||||
}
|
||||
return MaxPinnedDialogsArchiveFolder
|
||||
}
|
||||
if premium {
|
||||
return MaxPinnedDialogsMainFolderPremium
|
||||
}
|
||||
return MaxPinnedDialogsMainFolder
|
||||
}
|
||||
|
||||
// Peer 是业务层 peer 值对象,不依赖 TL 类型。
|
||||
type Peer struct {
|
||||
Type PeerType
|
||||
ID int64
|
||||
}
|
||||
|
||||
// IsSelfUser reports whether this peer is the current user's own user peer.
|
||||
func (p Peer) IsSelfUser(userID int64) bool {
|
||||
return userID != 0 && p.Type == PeerTypeUser && p.ID == userID
|
||||
}
|
||||
|
||||
// Dialog 是账号的一条会话摘要。
|
||||
type Dialog struct {
|
||||
Peer Peer
|
||||
|
|
@ -43,12 +76,21 @@ type Dialog struct {
|
|||
UnreadCount int
|
||||
UnreadMentions int
|
||||
UnreadReactions int
|
||||
TTLPeriod int
|
||||
ThemeEmoticon string
|
||||
HasScheduled bool
|
||||
Pinned bool
|
||||
PinnedOrder int
|
||||
UnreadMark bool
|
||||
ViewForumAsMessages bool
|
||||
PeerSettingsBarHidden bool
|
||||
Draft *DialogDraft
|
||||
// Pts 是 channel peer 当前 channel pts;客户端用 dialog.pts 初始化本地
|
||||
// channel 序列并决定 getChannelDifference 起点,channel dialog 必填。
|
||||
Pts int
|
||||
Draft *DialogDraft
|
||||
// NotifySettings 是该会话的 per-peer 通知设置(nil=未配置,投影时回落默认)。
|
||||
// 由读路径批量装配(非 dialog store 持久字段),见 rpc.withDialogNotifySettings。
|
||||
NotifySettings *PeerNotifySettings
|
||||
}
|
||||
|
||||
// DialogDraftWebPage stores a draft link preview without depending on TL input media types.
|
||||
|
|
@ -85,6 +127,21 @@ func (d DialogDraft) Empty() bool {
|
|||
d.Effect == 0
|
||||
}
|
||||
|
||||
// DialogArchiveSummary 聚合归档(folder_id=1)状态,供主列表 getDialogs
|
||||
// 第一页输出 dialogFolder 条目:TDesktop 依赖该条目发现 archive 的存在
|
||||
// (新登录设备没有任何 update 可重放,缺少它归档会话将彻底不可见)。
|
||||
type DialogArchiveSummary struct {
|
||||
// TopPeer/TopMessage 是归档内最新会话及其 top 消息(dialogFolder.peer/top_message)。
|
||||
TopPeer Peer
|
||||
TopMessage int
|
||||
// UnreadPeersCount 是归档内有未读(或手动标记未读)的会话数;
|
||||
// UnreadMessagesCount 是归档未读消息总数。当前未接 per-peer mute
|
||||
// 状态,全部计入 unmuted 桶。
|
||||
UnreadPeersCount int
|
||||
UnreadMessagesCount int
|
||||
Pinned bool
|
||||
}
|
||||
|
||||
// DialogList 是 dialogs 查询结果。
|
||||
type DialogList struct {
|
||||
Dialogs []Dialog
|
||||
|
|
@ -95,6 +152,16 @@ type DialogList struct {
|
|||
State UpdateState
|
||||
Hash int64
|
||||
Count int
|
||||
// ArchiveSummary 非 nil 时,主列表响应头部追加 dialogFolder 条目。
|
||||
ArchiveSummary *DialogArchiveSummary
|
||||
}
|
||||
|
||||
// DialogHashCheck reports whether a cached stable dialog list hash is known.
|
||||
type DialogHashCheck struct {
|
||||
Known bool
|
||||
Matched bool
|
||||
Hash int64
|
||||
Count int
|
||||
}
|
||||
|
||||
// DialogFilter 是会话列表查询条件。
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue