Files
openclaw/extensions/googlechat/src/monitor-durable.ts
Peter Steinberger 8756cc4a3b fix(googlechat): keep off-mode replies out of threads (#104402)
* fix(googlechat): align reply and typing targets

Co-authored-by: Jai Govindani <jai.g@ewa-services.com>

Co-authored-by: Neerav Makwana <261249544+neeravmakwana@users.noreply.github.com>

Co-authored-by: banddude <127166397+banddude@users.noreply.github.com>

Co-authored-by: Novan Adrian <novan.adrian@qasir.id>

* chore(googlechat): leave changelog to release automation

* style(googlechat): apply canonical formatting

* chore(googlechat): leave changelog to release automation

* style(googlechat): keep monitor imports canonical

* style(googlechat): keep monitor imports canonical

---------

Co-authored-by: Novan Adrian <novan.adrian@qasir.id>
2026-07-11 03:57:16 -07:00

29 lines
752 B
TypeScript

// Googlechat plugin module implements monitor durable behavior.
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
type GoogleChatDurableReplyOptions = {
to: string;
replyToId?: string | null;
threadId?: string;
};
export function resolveGoogleChatDurableReplyOptions(params: {
payload: ReplyPayload;
infoKind: string;
spaceId: string;
hasTypingMessage: boolean;
}): GoogleChatDurableReplyOptions | false {
if (params.infoKind !== "final" || params.hasTypingMessage) {
return false;
}
const threadId = params.payload.replyToId?.trim() || undefined;
if (!threadId) {
return { to: params.spaceId, replyToId: null };
}
return {
to: params.spaceId,
replyToId: threadId,
threadId,
};
}