




















@@ -178,7 +178,7 @@ describe("resolveSourceReplyDeliveryMode", () => {
178178).toBe("message_tool_only");
179179});
180180181-it("falls back to automatic only for implicit message-tool-only mode", () => {
181+it("falls back to automatic when message-tool-only delivery cannot use the message tool", () => {
182182expect(
183183resolveSourceReplyDeliveryMode({
184184cfg: emptyConfig,
@@ -200,6 +200,18 @@ describe("resolveSourceReplyDeliveryMode", () => {
200200requested: "message_tool_only",
201201messageToolAvailable: false,
202202}),
203+).toBe("automatic");
204+});
205+206+it("keeps strict message-tool-only delivery when the message tool is unavailable", () => {
207+expect(
208+resolveSourceReplyDeliveryMode({
209+cfg: emptyConfig,
210+ctx: { ChatType: "channel" },
211+requested: "message_tool_only",
212+strictMessageToolOnly: true,
213+messageToolAvailable: false,
214+}),
203215).toBe("message_tool_only");
204216});
205217@@ -378,7 +390,7 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
378390},
379391);
380392});
381-it("falls back to automatic only for implicit message-tool-only mode", () => {
393+it("falls back to automatic when message-tool-only delivery cannot use the message tool", () => {
382394expectPolicyFields(
383395resolveSourceReplyVisibilityPolicy({
384396cfg: emptyConfig,
@@ -402,6 +414,25 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
402414sendPolicy: "allow",
403415messageToolAvailable: false,
404416}),
417+{
418+sourceReplyDeliveryMode: "automatic",
419+suppressAutomaticSourceDelivery: false,
420+suppressDelivery: false,
421+deliverySuppressionReason: "",
422+},
423+);
424+});
425+426+it("keeps strict message-tool-only delivery suppressed when the message tool is unavailable", () => {
427+expectPolicyFields(
428+resolveSourceReplyVisibilityPolicy({
429+cfg: emptyConfig,
430+ctx: { ChatType: "channel" },
431+requested: "message_tool_only",
432+strictMessageToolOnly: true,
433+sendPolicy: "allow",
434+messageToolAvailable: false,
435+}),
405436{
406437sourceReplyDeliveryMode: "message_tool_only",
407438suppressAutomaticSourceDelivery: true,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。