nsMsgCompose stores out-of-date identity as a member variable

RESOLVED FIXED in Thunderbird 3.0b3

Status

defect
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

Trunk
Thunderbird 3.0b3
Dependency tree / graph
Bug Flags:
blocking-thunderbird3 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Assignee

Description

10 years ago
Posted patch The fix (obsolete) — Splinter Review
nsMsgCompose stores m_identity when it gets initialised (i.e. the compose window opened). When the user changes the identity, we don't actually update m_identity.

This is needed so that when we save the message for sending, we can set the correct identity in the message database (it already gets set in the headers, but we now need it in the db as well).

The patch attached fixes this and changes the name of the setSignature function to onIdentityChanged as that is more appropriate for what the function is actually doing.
Flags: blocking-thunderbird3+
Attachment #379731 - Flags: superreview?(neil)
Attachment #379731 - Flags: review?(bienvenu)

Comment 1

10 years ago
Comment on attachment 379731 [details] [diff] [review]
The fix

this does work w/ the other two patches in the activity manager send patch. However, I wonder if we want to move the setting of m_identity to identity earlier in this function, since there may be early returns.
Attachment #379731 - Flags: review?(bienvenu) → review+
Why not just use an attribute nsIMsgIdentity identity?
Also, why not use the identity passed to SendMsg?
Assignee

Comment 4

10 years ago
(In reply to comment #2)
> Why not just use an attribute nsIMsgIdentity identity?

That's a possibility, though the Set function would have to do a lot more than set functions do normally.

(In reply to comment #3)
> Also, why not use the identity passed to SendMsg?

We need the identity after the construction of the message is completed - so we need to save it into a member variable. However, I think you may be right, it is possible that SendMsg could be called with a different id to the one saved, and therefore we should be using that one instead.
Assignee

Comment 5

10 years ago
Posted patch The fix v2Splinter Review
This patch makes identity an attribute on nsIMsgCompose, and sets the member variable when the identity is changed, or for when SendMsg is called.
Attachment #379731 - Attachment is obsolete: true
Attachment #379852 - Flags: superreview?(neil)
Attachment #379852 - Flags: review?(bienvenu)
Attachment #379731 - Flags: superreview?(neil)

Updated

10 years ago
Attachment #379852 - Flags: superreview?(neil) → superreview+

Updated

10 years ago
Attachment #379852 - Flags: review?(bienvenu) → review+
Assignee

Comment 6

10 years ago
Checked in: http://hg.mozilla.org/comm-central/rev/5816359932c8
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.