Closed Bug 366016 Opened 18 years ago Closed 18 years ago

Reduce quoted text in our message preview string to "..."

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird2.0

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: fixed1.8.1.2)

Attachments

(2 files, 3 obsolete files)

In the animated alert and in the folder pane info popup, we show a little bit of the preview text for the new mail. We currently include the quoted text so the preview text looks like: Scott wrote: > Would you like to meet for dinner? Sure that sounds great Most of the time the quoted text takes up most of the space and you don't actually see the text the sender actually typed. This kind of defeats the helpfulness of the new preview text. We should instead compress quotes (of any level) to "..." so the above example looks like: Scott wrote: ... Sure that sounds great! Now at a glance I can see that Scott agreed to meet for dinner. I also want to strip out the quoted citation too. so you'll ultimately see: ... Sure that sounds great! I'll be there at 8pm, looking forward to it! The rules would look like: 1) Replace consecutive lines of quoted plain text replies (of any level, >, >>, >>>, etc.) with a single "...". 2) Currently the preview text generation code in nsMsgDBFolder::GetMsgTextFromStream is also used by spotlight integration. Spotlight is going to want the quoted text, so make these new changes to nsMsgDBFolder::GetMsgTextFromStream an option based on a bool argument.
Attached patch work in progress (obsolete) — Splinter Review
This works really well and works on both html and plain text by acting on the msg body after we've converted html to plain text and after the decoding work has happened. Still to do: 1) make it an option for spotlight 2) try to strip out the citation line
OS: Windows XP → All
Hardware: PC → All
David, I know this behavior needs to be bypassed for spotlight search. What folder API will desktop search be using? GetMsgTextFromStream or GetMsgPreviewTextFromStream?
Status: NEW → ASSIGNED
Attached patch updated fix (obsolete) — Splinter Review
This patch incorporates David's changes in Bug 346873 for decoding base64 and quoted printable. In order to get quoted printable decoding to work for some of my test cases, I had to modify the IMAP peak command we issue when fetching the preview text to also fetch the Content-Transfer-Encoding header. We might be able to move some of the helper routines I added: convertMsgSnippetToPlainText compressQuotesInMsgSnippet decodeMsgSnippet to nsMsgUtils in case we want to share them elsewhere. This patch will be complete once I add a boolean for bypassing the quote compression code. I just don't know which API will need it.
Attachment #250558 - Attachment is obsolete: true
I don't have the code in front of me, but it uses the idl method in nsIMsgFolder.idl, because the desktop search code is currently written in js...
Attached patch updated patch (obsolete) — Splinter Review
* getMsgTextFromStream now takes a boolean for optionally compressing quotes to "..." * aMaxOutputLen is no longer used and has been removed from getMsgTextFromStream. see comment #3 for more details, particularly the change to the peak command we issue when fetching the preview text.
Attachment #250799 - Attachment is obsolete: true
Attachment #250811 - Flags: superreview?(bienvenu)
Attachment #250811 - Flags: superreview?(bienvenu) → superreview+
Attached patch updated fixSplinter Review
I added back aMaxOutputLen as an argument to getMsgTextFromStream. The preview text string gets truncated to aMaxOutputLen after we are done decoding / converting / compressing the string. Carrying forward David's sr.
Attachment #250811 - Attachment is obsolete: true
Attachment #250888 - Flags: superreview+
Attachment #250888 - Flags: approval-thunderbird2?
this has been checked into the trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Blocks: 346873
Comment on attachment 250888 [details] [diff] [review] updated fix this seems to be working ok on the trunk today.
Attachment #250888 - Flags: approval-thunderbird2? → approval-thunderbird2+
Keywords: fixed1.8.1.2
this is causing a crash on the branch today with html mail due to a bad merge.
the line to initialize the sink got dropped during the merge.
Attachment #251088 - Flags: superreview?(bienvenu)
Attachment #251088 - Flags: superreview?(bienvenu) → superreview+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: