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) <noreply@anthropic.com>
This commit is contained in:
ex-takashima
2026-05-08 14:05:58 +09:00
parent 41d6156dce
commit 6d7d1b0909
+18
View File
@@ -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{