thunderbird / thunderbird/thunderbird-android

Only "hide" attachments that are referenced from a displayed part

Open
#2,894 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

Right now we use a questionable heuristic to decide whether or not to display an "attachment box" for a message part.

https://github.com/k9mail/k-9/blob/d696723023d8eb2c5dde223fdbcef1d67bd49bb9/k9mail/src/main/java/com/fsck/k9/message/extractors/AttachmentInfoExtractor.java#L134-L141

The right thing to do is to only hide the message parts that are referenced from the displayed text content. This requires parsing the HTML to find image references. We can probably do this in HtmlProcessor where we already have access to the parsed document.

This could also be used to get rid of the regular expression that tries to figure out whether a document references external images in order to display the "Show pictures" button.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AttachmentInfoExtractor.java at the linked heuristic and then inspect HtmlProcessor, where the parsed document is already available. Trace how displayed text references image parts and how the external-image regular expression controls the “Show pictures” button; the work is done when only referenced parts are hidden and that heuristic is no longer needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.