docs(comments): 注释中文化 · internal/services/channelbridge(纯替换)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 只翻注释/文档字符串:剥掉注释后代码行逐字节不变(机械校验只剩允许的行尾注释形态)
- 术语对齐既有译法(owner→主人、persona→角色、engage→参与度判定、quiet hours→安静时段、backoff→退避)
- 复核:go build 绿 + channelbridge 包测试绿;gofmt 干净
This commit is contained in:
AskaEth committed 2026-10-04 13:33:06 +08:00
1 parent 61cf80d5ee
commit 093f38d986
28 files changed
+1089 -1089

No files matched your search

+11 -11
View File
@@ -9,9 +9,9 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/user"
)
// gapCounter returns a bubbleGapFn that counts how many times the inter-bubble delay
// is consulted and returns zero, so the multi-bubble spacing can be asserted without
// sleeping a real 0.5-2s per gap.
// gapCounter 返回一个 bubbleGapFn:它统计气泡间延时的咨询次数
// 并返回零,因此无需为每个间隔真的 sleep 0.5-2s
// 就能断言多气泡间隔。
func gapCounter(counter *int) func() time.Duration {
return func() time.Duration {
*counter++
@@ -51,8 +51,8 @@ func TestSendIMBubbles_SplitsStripsAndGaps(t *testing.T) {
if ad.sends[0].Platform != "kook" || ad.sends[0].ChannelID != "329284282" {
t.Fatalf("bubble[0] target = %+v, want kook 329284282", ad.sends[0])
}
// Two bubbles → exactly one inter-bubble delay is consulted (and applies to both
// reply and proactive paths, since this drives the shared dispatcher).
// 两个气泡 → 恰好咨询一次气泡间延时(回复与主动推送两条路径
// 都适用,因为驱动的是共享派发器)。
if gaps != 1 {
t.Fatalf("gap calls = %d, want 1 (2 bubbles → one gap)", gaps)
}
@@ -105,9 +105,9 @@ func TestSendIMBubbles_PureActionDropped(t *testing.T) {
}
}
// TestSendReply_SplitsBubblesAndStrips exercises the reply exit (sendReply) after the
// refactor: a multi-<p> reply is delivered as several stripped bubbles through the
// shared dispatcher, targeting the source conversation.
// TestSendReply_SplitsBubblesAndStrips 覆盖重构后的回复出口(sendReply):
// 含多个 <p> 的回复经共享派发器以多个已剥离的气泡
// 投递,目标为来源会话。
func TestSendReply_SplitsBubblesAndStrips(t *testing.T) {
t.Parallel()
b, _, _, ad := newTestBridge(t)
@@ -128,9 +128,9 @@ func TestSendReply_SplitsBubblesAndStrips(t *testing.T) {
}
}
// TestSendProactive_SplitsWeChatBubbles verifies the proactive push now splits a
// multi-paragraph message into bubbles on WeChat (the reported regression: WeChat
// proactive pushes arrived as one un-split <p> blob).
// TestSendProactive_SplitsWeChatBubbles 验证主动推送现在会在 WeChat 上
// 把多段消息拆成气泡(上报的回归问题:WeChat
// 主动推送曾以一整块未拆分的 <p> 到达)。
func TestSendProactive_SplitsWeChatBubbles(t *testing.T) {
t.Parallel()
const acct = "o9cq802QPKPscBenJAp-SMZPBlnQ@im.wechat"