feat(wecom): implement quote extraction and populate in handleCallback

This commit is contained in:
nullkey
2026-04-01 21:21:06 +08:00
committed by lyingbug
parent 9790cb4830
commit 3587ddb1c7
3 changed files with 266 additions and 0 deletions
+12
View File
@@ -569,6 +569,18 @@ func (c *LongConnClient) handleCallback(ctx context.Context, frame wsFrame) {
return
}
// Populate quote context if the incoming message has a quoted/replied message.
if incoming != nil && msg.Quote != nil {
incoming.Quote = buildQuotedMessage(msg.Quote, msg.AiBotID)
if incoming.Quote != nil {
logger.Infof(ctx, "[WeCom] Quote detected: msgid=%s sender=%s is_bot=%v content_len=%d",
msg.Quote.MsgID, msg.Quote.From.UserID, incoming.Quote.IsBotMessage, len(incoming.Quote.Content))
// Debug: log raw IDs for bot identity verification during initial rollout
logger.Debugf(ctx, "[WeCom] Quote identity debug: quote.from.userid=%q quote.aibotid=%q msg.aibotid=%q",
msg.Quote.From.UserID, msg.Quote.AiBotID, msg.AiBotID)
}
}
if err := c.handler(ctx, incoming); err != nil {
logger.Errorf(ctx, "[WeCom] Handle message error: %v", err)
}