Closed Bug 1240823 Opened 9 years ago Closed 9 years ago

Add observer to compose to allow extensions to manipulate outgoing server

Categories

(MailNews Core :: Composition, defect)

defect
Not set
normal

Tracking

(thunderbird44 wontfix, thunderbird45 fixed, thunderbird46 fixed)

RESOLVED FIXED
Thunderbird 46.0
Tracking Status
thunderbird44 --- wontfix
thunderbird45 --- fixed
thunderbird46 --- fixed

People

(Reporter: rkent, Assigned: rkent)

References

Details

Attachments

(1 file)

This is a followup to bug 1240327, fixing the observer notification since accountKey is unreliable (bug 449482 comment 16).
Assignee: nobody → rkent
Status: NEW → ASSIGNED
Attachment #8709637 - Flags: review?(mkmelin+mozilla)
Comment on attachment 8709637 [details] [diff] [review] Add an observer and test Review of attachment 8709637 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/compose/src/nsMsgCompose.cpp @@ +1079,5 @@ > + > + // Allow extensions to specify an outgoing server. > + nsCOMPtr<nsIObserverService> observerService = > + mozilla::services::GetObserverService(); > + if (observerService) shouldn't !observerService just error out? @@ +1085,5 @@ > + // Assemble a string with sending parameters. > + nsAutoString sendParms; > + > + // First parameter: account key. This is not reliable, see > + // bug 449482 comment 16. per comment 22 that should not be the case anymore though @@ +1086,5 @@ > + nsAutoString sendParms; > + > + // First parameter: account key. This is not reliable, see > + // bug 449482 comment 16. > + sendParms.AppendASCII(accountKey && *accountKey ? accountKey : "none"); should this really be "none"? not just ""? ::: mailnews/compose/test/unit/test_sendObserver.js @@ +32,5 @@ > + fields.cc = "Alex <alex@tinderbox.invalid>"; > + fields.subject = "Let's test the observer"; > + > + yield richCreateMessage(fields, [], identity); > + // observer data should have: nit: trailing space here and a few lines down
Attachment #8709637 - Flags: review?(mkmelin+mozilla) → review+
https://hg.mozilla.org/comm-central/rev/fa1e66e01549 One comment on review: "per comment 22 that should not be the case anymore though" Yes, but there are other places in the code where SendMsg is called with a null account, so I changed the message to a simple warning that the account might be null.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 46.0
Comment on attachment 8709637 [details] [diff] [review] Add an observer and test [Triage Comment] This is a feature, giving a hook for extensions, that should be in TB 45. It should not have any effect on existing usage. Please land after an initial successful comm-central build and tests. (Land from the hg rev, not this actual patch).
Attachment #8709637 - Flags: approval-comm-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: