If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Auto save isn't reported to the listeners (extensions) of event 'compose-send-message'

RESOLVED DUPLICATE of bug 321890

Status

Thunderbird
Message Compose Window
RESOLVED DUPLICATE of bug 321890
10 years ago
10 years ago

People

(Reporter: Tomer, Assigned: Patrick Brunschwig)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 XPCOMViewer/0.9.5
Build Identifier: version 2.0.0.4 (20070604)

In file MsgComposeCommands.js, function GenericSendMessage an event 'compose-send-message' is dispatched (line 1872) for registered listeners.  
This event is for doing any pre-sending work and its especially useful for extensions. 

Such listener (an extension) might want to know what the msgType is, for example, to see if GenericSendMessage was called because the Send button was pressed or because the the auto save  timer expired. 
However, the variable gAutoSaving is set only after firing the the event, thus the listener cannot know that information. 

Possible solutions:
1. set gAutoSaving before firing the 'compose-send-message' event.
2. Better: save the msgType argument to a local variable immediately when entering the GenericSendMessage function. The listener can access this variable using the exception object. By accessing msgType, all message types are known to the listeners.

Reproducible: Always

Steps to Reproduce:
1. Activate autosave.
2. Write an extension that listen to 'compose-send-message' event.
3. Try to determine what scenario fired the event (pressing send, later, save, autosave).
(Assignee)

Comment 1

10 years ago
This is definitely an issue for extensions like Enigmail and AutoZipAttachments. I'll try to write a patch for this
Assignee: nobody → patrick.brunschwig
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → 2.0
(Assignee)

Updated

10 years ago
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 321890
You need to log in before you can comment on or make changes to this bug.