Closed Bug 410050 Opened 16 years ago Closed 15 years ago

e-mail to event/task conversion: description is taken from wrong e-mail message (depending on Message Pane content)


(Calendar :: Lightning Only, defect)

Not set


(Not tracked)



(Reporter: mozilla, Assigned: mschroeder)




(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20071127 Firefox/
Build Identifier: 

Seen in Thunderbird with Lightning 0.8pre Build 2007-12-27-04-mozilla1.8 on Win XP.

When creating a new task or event by dropping an E-Mail on the Mode Toolbar, taking the text as a description only works if you use the Message Pane in Thunderbird. I don't use it, so the proposed description always is Thunderbird's start page; in general it is the last site/message that was loaded in the Message Pane during a session.
Open the message in its own window is not sufficant.

I saw this with different IMAP-accounts. The offline-settings don't make a difference.

Reproducible: Always

Steps to Reproduce:
1. Create a fresh profile with IMAP-account, install Lightning.
2. Disable Message Pane by pressing F8, restart Thunderbird.
3. Create new task/event by dropping an E-Mail on the Mode Toolbar. 
Actual Results:  
Proposed description is Thunderbird's start page.

Expected Results:  
Proposed description should be the Mail Body.
I cannot reproduce it using Lt 2008012609
I still see the issue using Lightning 0.8pre 2008012618.
I tested again in a fresh profile, with two different IMAP-Accounts (, I didn't change Thunderbird's default settings, so it just pulls the headers of the E-Mails.
See [1] for a screenshot (text of Thunderbird's start page as the proposed description).

Additional info:
Thunderbird starts in Mail Mode. If I switch to Calendar or Task Mode, switch back to Mail Mode and then try to reproduce the described behaviour, the description field of the new task/event is blank.

Lightning 2008012320: confirmed the described behaviour in comment 0. 
Ever confirmed: true
Flags: wanted-calendar0.8?
I don't think this is related to IMAP because I can reproduce it and I only use POP3.  I also didn't need to create a new profile or restart Thunderbird.

Thunderbird / Lightning 2008-01-21 19 / WinXP
I can confirm the bug:

Dropping Mails vom POP3 or IMAP-Accounts will take the description from Thunderbird's start page. I try to repeat this a few times, but I could not always reproduce the exactly behavior. After some tries the description field becomes blank.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Lightning/0.8pre (2008012818) Thunderbird/ ID:2007103104
Flags: wanted-calendar0.8? → wanted-calendar0.8+
Not going to happen for 0.8.
Flags: wanted-calendar0.8+ → wanted-calendar0.8-
I have reproduced this bug.  I can also add that the description that appears is always the message body from the last message loaded into the message pane:

1.  Highlight message 1 so that message 1 body appears in the message pane.
2.  Turn the message pane off.
3.  Drag message 1 to task area and drop - new task appears with message 1 body as description.
4.  Highlight message 2
5.  Drag message 2 to task area and drop - new task appears with message 2 subject as title but with message 1 body as description.

Thunderbird (20080213)/Lightning 0.8 (Build 20080331118)/Linux Ubuntu 7.10
OS: Windows XP → All
Hardware: PC → All
It still happens on
Thunderbird Version (20080213) and lightning 0.8 (Build 2008033120) on Windows XP SP2.
It is reproduceable every time.
Flags: wanted-calendar0.9+
Flags: wanted-calendar0.9+ → wanted-calendar0.9?
Flags: wanted-calendar0.9?
Flags: wanted-calendar0.9+
Flags: wanted-calendar0.8-
Flags: wanted-calendar0.9+ → wanted-calendar1.0+
I would like to confirm this is still an issue with Thunderbird and Lightning 0.9rc2 (Build 2008091718).
It is not working at all on Mozilla Firefox 3.0.4 in connection with Lightning 0.7
on Ubuntu 8.04. you cannot drop a message at all.  Very disappointing.
Summary: eMail to event/task conversion: wrong description when not using Message Pane → e-mail to event/task conversion: wrong description when not using Message Pane
Summary: e-mail to event/task conversion: wrong description when not using Message Pane → e-mail to event/task conversion: description is taken from wrong e-mail message (depending on Message Pane content)
This was obviously known at the time of coding:

It looks like the function that is needed is implemented in gloda as function MsgHdrToMimeMessage here:

Is there an easy way to reuse that function from gloda?
Assignee: nobody → mschroeder
Attached patch Patch v1Splinter Review
First try using a synchronous stream listener because we need the information for opening the new event/task dialog. I do not know if I really need a new instance of nsIMessenger or if I can reuse Thunderbird's global one. It is also unclear what are proper values for aBytesToRead (for whole message) and aMaxOutputLen (for truncation of the plain text) in our use case.
Attachment #382026 - Flags: review?(philipp)
Comment on attachment 382026 [details] [diff] [review]
Patch v1

>+        plainTextMessage = msgFolder.getMsgTextFromStream(streamListener.inputStream,
>+                                                          "",
>+                                                          65536, //XXX aBytesToRead
>+                                                          32768, //XXX aMaxOutputLen
>+                                                          false,
>+                                                          true,
>+                                                          {});
The second parameter should be aMsgHdr.Charset.

Looking at the other calls to getMsgTextFromStream and also the source, it seems there is no other possibility than to pass arbitrary numbers. Maybe using hex numbers looks a bit nicer here though.

Nice work!

Attachment #382026 - Flags: review?(philipp) → review+
(In reply to comment #14)
> The second parameter should be aMsgHdr.Charset.

Pushed to comm-central <>

Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
+ plainTextMessage = msgFolder.getMsgTextFromStream(streamListener.inputStream,
+                                                   aMsgHdr.Charset,
+                                                   65536,
+                                                   32768,
+                                                   false,
+                                                   true,
+                                                   {});

You could improve readability and maintainability by something like:

+ const aBytesToRead = 0x10000;
+ const aMaxOutputLen = 0x8000;
+ const aCompressQuotes = false;
+ const aStripHTMLTags = true;
+ plainTextMessage = msgFolder.getMsgTextFromStream(streamListener.inputStream,
+                                                   aMsgHdr.Charset,
+                                                   aBytesToRead,
+                                                   aMaxOutputLen,
+                                                   aCompressQuotes,
+                                                   aStripHTMLTags,
+                                                   {});
Blocks: 453122
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.