@@ -495,7 +495,7 @@ func handleMsgEvent(ctx context.Context, rt *runtime.Runtime, event *MsgEvent) e
495
495
if utils .Attachment (attURL ).ContentType () != "" {
496
496
attachments = append (attachments , utils .Attachment (attURL ))
497
497
} else {
498
- attachment , logUUID , err := msgio .FetchAttachment (ctx , rt , channel , attURL )
498
+ attachment , logUUID , err := msgio .FetchAttachment (ctx , rt , channel , attURL , event . MsgID )
499
499
if err != nil {
500
500
return errors .Wrapf (err , "error fetching attachment '%s'" , attURL )
501
501
}
@@ -598,7 +598,7 @@ func handleMsgEvent(ctx context.Context, rt *runtime.Runtime, event *MsgEvent) e
598
598
599
599
msgIn := flows .NewMsgIn (event .MsgUUID , event .URN , channel .ChannelReference (), event .Text , availableAttachments )
600
600
msgIn .SetExternalID (string (event .MsgExternalID ))
601
- msgIn .SetID (event .MsgID )
601
+ msgIn .SetID (flows . MsgID ( event .MsgID ) )
602
602
603
603
// build our hook to mark a flow message as handled
604
604
flowMsgHook := func (ctx context.Context , tx * sqlx.Tx , rp * redis.Pool , oa * models.OrgAssets , sessions []* models.Session ) error {
@@ -783,7 +783,7 @@ func markMsgHandled(ctx context.Context, db models.Queryer, contact *flows.Conta
783
783
flowID = flow .ID ()
784
784
}
785
785
786
- err := models .UpdateMessage (ctx , db , msg .ID (), models .MsgStatusHandled , models .VisibilityVisible , msgType , flowID , attachments , logUUIDs )
786
+ err := models .UpdateMessage (ctx , db , models . MsgID ( msg .ID () ), models .MsgStatusHandled , models .VisibilityVisible , msgType , flowID , attachments , logUUIDs )
787
787
if err != nil {
788
788
return errors .Wrapf (err , "error marking message as handled" )
789
789
}
@@ -813,7 +813,7 @@ type MsgEvent struct {
813
813
ContactID models.ContactID `json:"contact_id"`
814
814
OrgID models.OrgID `json:"org_id"`
815
815
ChannelID models.ChannelID `json:"channel_id"`
816
- MsgID flows .MsgID `json:"msg_id"`
816
+ MsgID models .MsgID `json:"msg_id"`
817
817
MsgUUID flows.MsgUUID `json:"msg_uuid"`
818
818
MsgExternalID null.String `json:"msg_external_id"`
819
819
URN urns.URN `json:"urn"`
0 commit comments