~rjarry/aerc-devel

aerc: forward: better preserve attached file names v1 APPLIED

Vitaly Ovchinnikov: 1
 forward: better preserve attached file names

 1 files changed, 2 insertions(+), 2 deletions(-)
#1310814 alpine-edge.yml success
#1310815 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/54685/mbox | git am -3
Learn more about email & git

[PATCH aerc] forward: better preserve attached file names Export this patch

Use a dedicated filename function for getting a name of the attached
file instad of analyzing its mime type. Some attachments have file name
in `Content-Disposition` rather than `Content-Type`, the new method
handles both cases.

Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru>
---
 commands/msg/forward.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index cb2cab35..7c491a06 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -236,8 +236,8 @@ func (f forward) Execute(args []string) error {
					fetchBodyPart(p, func(reader io.Reader) {
						mime := bs.FullMIMEType()
						params := lib.SetUtf8Charset(bs.Params)
						name, ok := params["name"]
						if !ok {
						name := bs.FileName()
						if name == "" {
							name = fmt.Sprintf("%s_%s_%d", bs.MIMEType, bs.MIMESubType, rand.Uint64())
						}
						mu.Lock()
-- 
2.39.3 (Apple Git-145)
aerc/patches: SUCCESS in 1m59s

[forward: better preserve attached file names][0] from [Vitaly Ovchinnikov][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/54685
[1]: mailto:v@ovch.ru

✓ #1310814 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1310814
✓ #1310815 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1310815
Vitaly Ovchinnikov <v@ovch.ru> wrote: