MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getTopicRootIdFromReplyHeader

Function getTopicRootIdFromReplyHeader

dme/dme.ts:534–548  ·  view source on GitHub ↗

* 从回复头中提取 topic root id

(replyTo: any)

Source from the content-addressed store, hash-verified

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
543function getTopicRootIdFromMessage(message: any): number | undefined {
544 return getTopicRootIdFromReplyHeader(message?.replyTo);
545}
546
547function isMessageInTopic(message: any, topicRootId?: number): boolean {
548 if (typeof topicRootId !== "number") return true;
549 return getTopicRootIdFromMessage(message) === topicRootId;
550}
551

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected