Skip to content

Commit 3541409

Browse files
authored
msgconv/from-matrix: fix filename of documents without caption (#840)
1 parent ca11716 commit 3541409

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/msgconv/from-matrix.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,14 @@ func (mc *MessageConverter) constructMediaMessage(
255255
},
256256
}
257257
case event.MsgFile:
258+
fileName := content.FileName
259+
if fileName == "" {
260+
fileName = content.Body
261+
}
262+
258263
msg := &waE2E.Message{
259264
DocumentMessage: &waE2E.DocumentMessage{
260-
FileName: proto.String(content.FileName),
265+
FileName: proto.String(fileName),
261266

262267
Caption: proto.String(caption),
263268
JPEGThumbnail: thumbnail,

0 commit comments

Comments
 (0)