Closed Bug 36480 Opened 25 years ago Closed 24 years ago

Change sig if identity is changed

Categories

(MailNews Core :: Composition, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: BenB, Assigned: bugzilla)

References

Details

(Whiteboard: [nsbeta3+])

Attachments

(2 files)

Reproduce: Use a profile with 2 sigs, which each have different signatures. 1. Reply or open a new msg 2. Select in the "From" box an identity with a different sig. Actual result: The signature in the content does not change. Expected result: The existant signature is replaced with the sig of the newly selected identity. Proposed fix: With bug 35158, you'll have a div, which surrounds the sig. Just remove it's content and insert the new sig. Be sure to use the same routinnses for the content creation, that are used to create the initial sig (MsgCompose::ProcessSignature, I think).
Depends on: 35158
this on is a dup of bug 35305
*** Bug 35305 has been marked as a duplicate of this bug. ***
alangho suggests in the dup bug, *not* to change the sig automatically, but add new UI: a button to "repair" the sig, which appears, if identity and sig are inconsistent. (Did I understand you correctly, or did you propose a dialog box?)
Status: NEW → ASSIGNED
Target Milestone: --- → M18
See also bug 37644, `Show signature in collapsible pane for editing/switching'.
Summary: Change sig, if identity is changed → Change sig if identity is changed
Added "nsbeta3" and "polish" keywords.
Keywords: nsbeta3, polish
Keywords: mail2
I need to find out what else is not changed (wrong) when the user changes identity? ie. does organization change, etc? Suresh - can you try out for me?
Keywords: polishcorrectness
Whiteboard: [nsbeta3+]
Normally, everything that are not editable in the compose window will be changed as we don't cache them.
Ben, did you wrote some function to find the signature in a message body or something like that?
These are the fields that should change when you change the identity. Name, E-Mail, Reply-to, Organization, Signature. Right now Name, E-mail and organization changes if you change the identity. Reply-to and signature doesn't change.
Are you using a M18 build? if yes, reply-to should change now. Also, Bcc self and bcc others change.
I tested on M17 builds.
Ok, that explains while reply-to wasn't changed.
ducarroz, no function, but I added a "class=signature" (should actually be "class=\"signature\"") to the wrapping element. You can search for that class* in the DOM, remember its place, remove it, create a new signature using |nsMsgCompose::ProcessSignature| (you may need to modify that function slightly), and insert the result at the remembered place. * Just search for the class, do *not* rely on the tag - currently a <div> - as this will change. If the sig is plaintext, I will remove the <div> and add the calss to the <pre>, which is there anyway. Even if the sig is HTML, the <div> might be replaced with another tag.
Whiteboard: [nsbeta3+] → [nsbeta3+]Fix in hand
Fixed and checked in. If you are not happy with the fact we switch the signature when you change the identity, you can press undo twice to get back the previous signature.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta3+]Fix in hand → [nsbeta3+]
Thanks for fixing this bug! But I found some problems with the implementation: - The class will be quoted (e.g. |class="signature"|). Akk told me, I have to explicitly check for that. I have two fixes: Either - add |attributeValue.StripChars("\"");| or - use |attributeValue.Find("signature", PR_TRUE) != kNotFound| instead of |Equals...| The latter still works, if there is more than one class, e.g. |class="signature redness"|. - You check for the existance of <div>. This doesn't work with my local changes (which I intend to check in ASAP). Fixed this by simply removing the check. - If the user altered the sig, it will be removed nevertheless. This is especially bad, as all text after the sig seems to be considered part of it. Doesn't the editor insert a moz-dirty="true" attribute to changed nodes? We could just check for that. - The sig is not always found. Reproduce: Delete sig completely. From now on, each identity change adds one sig (leaving the old one(s) as is). (As a user might do this to reset a manually changed sig.) Will attach patch for the first two problems. Should I file new bugs or reopen?
ops, doublepost, sorry.
Ben, you patch is ok for me, R=ducarroz. Let me know when you check it in. I reopen this bug and I will try to find a fix for problem 3 & 4
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
ducarroz, thx! Asking for approval right now.
Keywords: approval
a=waterson. Will propably checkin tonight PDT.
checked in.
Ben, about problem number 3: _moz_dirty is not used to mark a block as changed. I think it has something to do with the refresh process. Therefore, I will not do anything else to detect if yes or no the user has altered the current signature. Anyway if it was the case and you switch identity, you can alway get back your previous signature using undo (twice). About problem 4, I wasn't able to reproduce it. I totally delete my signature and I correctly get a new one when I swith identity. And if I switch it again, the signature is correctly replaced.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
I verified the following in Win32 commercial build 2000-09-01-11-m18. Need to still verify on Mac and Linux platforms. Things verified: 1. I have a total of 4 accounts. Created a signature for mail account 1 and a different signature for news account 2. mail account 1 - sig file A mail acounnt 2 - no sig file news account 1 - no sig file news account 2 - sig file B 2. When I create a new message from within each of the accounts, the proper signature file shows up (if applicable) 3. When I create a new message from within one account, I change the From field within the compose window. Each time, the proper signature file shows up (if applicable) or the signature file gets removed.
QA Contact: lchiang → esther
QA Contact: esther → laurel
Verified similar cases to lisa's comments with multiple accounts profile with mail and news accounts . OK using: 2000-09-20-08 commercial build linux rh6.0 2000-09-20-05 commercial build NT 4.0 2000-09-20-08 commercial build mac OS 9.0
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: