Add missing field for sending files. Fixes #595

This commit is contained in:
Tulir Asokan 2023-02-15 16:04:05 +02:00
parent c477f46af8
commit 96092af492
3 changed files with 8 additions and 3 deletions

2
go.mod
View file

@ -11,7 +11,7 @@ require (
github.com/prometheus/client_golang v1.14.0
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/tidwall/gjson v1.14.4
go.mau.fi/whatsmeow v0.0.0-20230213175431-ec411f5b9afe
go.mau.fi/whatsmeow v0.0.0-20230215140331-067248436db3
golang.org/x/image v0.4.0
golang.org/x/net v0.6.0
google.golang.org/protobuf v1.28.1

4
go.sum
View file

@ -66,8 +66,8 @@ github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=
github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
go.mau.fi/whatsmeow v0.0.0-20230213175431-ec411f5b9afe h1:6u6qn9I9ev9nF2A0MZVYseojBObzbHyaiWwWs9VgHvg=
go.mau.fi/whatsmeow v0.0.0-20230213175431-ec411f5b9afe/go.mod h1:FYaCKtMD7yDQ7zpTSW28o24GODR75wVZ5OKHUfQySbA=
go.mau.fi/whatsmeow v0.0.0-20230215140331-067248436db3 h1:ot7/ErX6ZIOjz3Z9nHT4WFQ4PljYvBYaT1OA3J1cMa0=
go.mau.fi/whatsmeow v0.0.0-20230215140331-067248436db3/go.mod h1:FYaCKtMD7yDQ7zpTSW28o24GODR75wVZ5OKHUfQySbA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=

View file

@ -3818,6 +3818,7 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
Caption: &media.Caption,
JpegThumbnail: media.Thumbnail,
Url: &media.URL,
DirectPath: &media.DirectPath,
MediaKey: media.MediaKey,
Mimetype: &content.GetInfo().MimeType,
FileEncSha256: media.FileEncSHA256,
@ -3834,6 +3835,7 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
ContextInfo: ctxInfo,
PngThumbnail: media.Thumbnail,
Url: &media.URL,
DirectPath: &media.DirectPath,
MediaKey: media.MediaKey,
Mimetype: &content.GetInfo().MimeType,
FileEncSha256: media.FileEncSHA256,
@ -3853,6 +3855,7 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
Caption: &media.Caption,
JpegThumbnail: media.Thumbnail,
Url: &media.URL,
DirectPath: &media.DirectPath,
MediaKey: media.MediaKey,
Mimetype: &content.GetInfo().MimeType,
GifPlayback: &gifPlayback,
@ -3870,6 +3873,7 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
msg.AudioMessage = &waProto.AudioMessage{
ContextInfo: ctxInfo,
Url: &media.URL,
DirectPath: &media.DirectPath,
MediaKey: media.MediaKey,
Mimetype: &content.GetInfo().MimeType,
Seconds: &duration,
@ -3894,6 +3898,7 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
Caption: &media.Caption,
JpegThumbnail: media.Thumbnail,
Url: &media.URL,
DirectPath: &media.DirectPath,
Title: &media.FileName,
FileName: &media.FileName,
MediaKey: media.MediaKey,