fix(hooks): add isGroup and groupId to message:sent context

Adds group context fields to MessageSentHookContext so hooks can
correlate sent events with received events for the same conversation.

Previously, message:received included isGroup/groupId but message:sent
did not, forcing hooks to use mismatched identifiers (e.g. groupId vs
numeric chat ID) when tracking conversations.

Fields are derived from MsgContext in dispatch-from-config and threaded
through route-reply and deliver via the mirror parameter.

Addresses feedback from matskevich (production user, 550+ events)
reported on PR #6797.
This commit is contained in:
Eric Lytle
2026-03-02 12:02:48 +00:00
committed by Peter Steinberger
parent 7ad6a04058
commit b5102ba4f9
4 changed files with 29 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ export type MessageSentHookContext = {
conversationId?: string;
/** Message ID returned by the provider */
messageId?: string;
/** Whether this message was sent in a group/channel context */
isGroup?: boolean;
/** Group or channel identifier, if applicable */
groupId?: string;
};
export type MessageSentHookEvent = InternalHookEvent & {