mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-21 12:44:49 -05:00
Add inline attachments to comments
If incoming email is configured and an email is sent, inline attachments are currently not added to the comment if it has the `Content-Disposition: inline` instead of `Content-Disposition: attachment` as e.g. with Apple Mail. This adds inline attachments (`Content-Disposition: inline`) that have a filename as attachment to the comment. Fixes #3496
This commit is contained in:
parent
bfdbc2371d
commit
162b840100
1 changed files with 8 additions and 0 deletions
|
@ -367,6 +367,14 @@ func getContentFromMailReader(env *enmime.Envelope) *MailContent {
|
||||||
Content: attachment.Content,
|
Content: attachment.Content,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
for _, inline := range env.Inlines {
|
||||||
|
if inline.FileName != "" {
|
||||||
|
attachments = append(attachments, &Attachment{
|
||||||
|
Name: inline.FileName,
|
||||||
|
Content: inline.Content,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return &MailContent{
|
return &MailContent{
|
||||||
Content: reply.FromText(env.Text),
|
Content: reply.FromText(env.Text),
|
||||||
|
|
Loading…
Reference in a new issue