mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 12:31:12 +00:00
* 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>
29 lines
752 B
TypeScript
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,
|
|
};
|
|
}
|