feat(wecom): implement quote extraction and populate in handleCallback
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user