From 6d7d1b09096a7da43dfa759950fbcf689716f297 Mon Sep 17 00:00:00 2001 From: ex-takashima Date: Fri, 8 May 2026 14:05:58 +0900 Subject: [PATCH] fix(line): capture QuoteToken for all message types and handle location - Store QuoteToken for image, video, and sticker messages (not just text) - Add webhook.LocationMessageContent case to forward as [location] placeholder Co-Authored-By: Claude Opus 4.6 (1M context) --- pkg/channels/line/line.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/channels/line/line.go b/pkg/channels/line/line.go index 87eecd014..e45c1e2e3 100644 --- a/pkg/channels/line/line.go +++ b/pkg/channels/line/line.go @@ -231,6 +231,10 @@ func (c *LINEChannel) processEvent(event webhook.EventInterface) { } case webhook.ImageMessageContent: messageID = msg.Id + if msg.QuoteToken != "" { + quoteToken = msg.QuoteToken + c.quoteTokens.Store(chatID, msg.QuoteToken) + } if localPath := c.downloadContent(msg.Id, "image.jpg"); localPath != "" { scope := channels.BuildMediaScope("line", chatID, msg.Id) mediaPaths = append(mediaPaths, storeMedia(localPath, "image.jpg", scope)) @@ -245,6 +249,10 @@ func (c *LINEChannel) processEvent(event webhook.EventInterface) { } case webhook.VideoMessageContent: messageID = msg.Id + if msg.QuoteToken != "" { + quoteToken = msg.QuoteToken + c.quoteTokens.Store(chatID, msg.QuoteToken) + } if localPath := c.downloadContent(msg.Id, "video.mp4"); localPath != "" { scope := channels.BuildMediaScope("line", chatID, msg.Id) mediaPaths = append(mediaPaths, storeMedia(localPath, "video.mp4", scope)) @@ -253,8 +261,18 @@ func (c *LINEChannel) processEvent(event webhook.EventInterface) { case webhook.FileMessageContent: messageID = msg.Id content = "[file]" + case webhook.LocationMessageContent: + messageID = msg.Id + content = "[location]" + if msg.Title != "" { + content = fmt.Sprintf("[location: %s]", msg.Title) + } case webhook.StickerMessageContent: messageID = msg.Id + if msg.QuoteToken != "" { + quoteToken = msg.QuoteToken + c.quoteTokens.Store(chatID, msg.QuoteToken) + } content = "[sticker]" default: logger.DebugCF("line", "Ignoring unsupported message type", map[string]any{