* 从回复头中提取 topic root id
(replyTo: any)
| 532 | replyTo.replyToMsgId, |
| 533 | replyTo.replyToMsg?.id, |
| 534 | ]; |
| 535 | for (const candidate of candidates) { |
| 536 | if (typeof candidate === "number" && Number.isFinite(candidate) && candidate > 0) { |
| 537 | return candidate; |
| 538 | } |
| 539 | } |
| 540 | return undefined; |
| 541 | } |
| 542 | |
| 543 | function getTopicRootIdFromMessage(message: any): number | undefined { |
| 544 | return getTopicRootIdFromReplyHeader(message?.replyTo); |
| 545 | } |
| 546 | |
| 547 | function isMessageInTopic(message: any, topicRootId?: number): boolean { |
| 548 | if (typeof topicRootId !== "number") return true; |
| 549 | return getTopicRootIdFromMessage(message) === topicRootId; |
| 550 | } |
| 551 |
no outgoing calls
no test coverage detected