@@ -30,6 +30,7 @@ func (h *Handler) ConvertImage(ctx context.Context, portal *bridgev2.Portal, int
3030
3131 mediaCategory := lineMediaCategory (data .ContentMetadata )
3232 downloadOptions := lineOBSDownloadOptions (data .ContentMetadata , isPlainMedia )
33+ talkMetaMessageID := obsTalkMetaMessageID (data .ID , isPlainMedia )
3334
3435 var imgData []byte
3536 var err error
@@ -43,18 +44,18 @@ func (h *Handler) ConvertImage(ctx context.Context, portal *bridgev2.Portal, int
4344 Bool ("plain_media" , isPlainMedia ).
4445 Msg ("Downloading image from LINE OBS" )
4546 if isPlainMedia {
46- imgData , err = client .DownloadOBSWithSIDOptions (ctx , oid , data . ID , "m" , downloadOptions )
47+ imgData , err = client .DownloadOBSWithSIDOptions (ctx , oid , talkMetaMessageID , "m" , downloadOptions )
4748 } else {
48- imgData , err = client .DownloadOBSWithOptions (ctx , oid , data . ID , downloadOptions )
49+ imgData , err = client .DownloadOBSWithOptions (ctx , oid , talkMetaMessageID , downloadOptions )
4950 }
5051
5152 // Refresh token if we get a 401
5253 if newClient , ok := h .tryRecoverClient (ctx , err ); ok {
5354 client = newClient
5455 if isPlainMedia {
55- imgData , err = client .DownloadOBSWithSIDOptions (ctx , oid , data . ID , "m" , downloadOptions )
56+ imgData , err = client .DownloadOBSWithSIDOptions (ctx , oid , talkMetaMessageID , "m" , downloadOptions )
5657 } else {
57- imgData , err = client .DownloadOBSWithOptions (ctx , oid , data . ID , downloadOptions )
58+ imgData , err = client .DownloadOBSWithOptions (ctx , oid , talkMetaMessageID , downloadOptions )
5859 }
5960 }
6061 downloadDuration := time .Since (dlStart )
@@ -66,19 +67,8 @@ func (h *Handler) ConvertImage(ctx context.Context, portal *bridgev2.Portal, int
6667 Str ("msg_id" , data .ID ).
6768 Bool ("plain_media" , isPlainMedia ).
6869 Dur ("download_duration" , downloadDuration ).
69- Msg ("Failed to download image from OBS, sending placeholder" )
70- return & bridgev2.ConvertedMessage {
71- Parts : []* bridgev2.ConvertedMessagePart {
72- {
73- Type : event .EventMessage ,
74- Content : & event.MessageEventContent {
75- MsgType : event .MsgNotice ,
76- Body : "[Image unavailable — LINE media expired before it could be bridged]" ,
77- RelatesTo : relatesTo ,
78- },
79- },
80- },
81- }, nil
70+ Msg ("Failed to download image from OBS" )
71+ return mediaDownloadFailure ("Image" , err , relatesTo )
8272 }
8373
8474 // Decrypt image if it has keyMaterial (E2EE)
0 commit comments