-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Losing all text in compose window when changing identity / signature not updated #7
Comments
Of course it is, it's always been that way that you open the compose window first and then choose the account/identity combination from the drop-down list at the "From:" field and when you do, the signature changes. This works if there has been no text entered manually. If it weren't that way, individual signature settings for each identity the way TB implements them would not make sense (there is no "reply with.." function for example). |
Yes (and no) if you change the identity SmartTemplate⁴ "starts from scratch" - as if you opened the Compose window with the new identity. However, this will not work once you start editing - you have to do it as the first thing before you type; otherwise, SmartTemplate⁴ would throw away your changes. |
True. This has happened to me, and there is no "undo". If you already wrote a lot of text into the compose window and then thought about changing the identity and select another one, losing everything is pretty unnerving. If keeping the text is not an option, and I can understand that it'd be too difficult to implement, could there be at least a warning with "cancel" option or an undo option? |
yeah to be honest, SmartTemplate⁴ shouldn't even do anything in that case - hadn't tested this in a long time but my understanding is that it used to not touch the email once you started typing. The whole method of ST is to shrink down the email to "almost nothing" apart from the quoted email which you reply to. It then rebuilds all the part bit by bit; but it cannot distinguish between the stuff that Thunderbird has added automatically and the stuff you have typed - there is a flag gMsgCompose.bodyModified which we used to check, but I can see how I can improve the whole thing. |
Just testing this now, when I switch between identities: If you change the identity before editing it (i.e. before you start typing) then SmartTemplate⁴ will rebuild the email according to the identity specific template. If you select another identity after editing the email - Thunderbird itself actually changes the Signature(*) - at this stage, SmartTemplate⁴ doesn't do anything, it simply leaves the email alone - so the behavior you are seeing is actually Thunderbird composer messing it up - in my case, it kept the (non-quoted) portion of my email (Write case, not reply). The real question here is - should it really do anything? If it was to rebuild the mail how would it distinguish the text you typed from what the template has generated? You have to remember that some ST4 commands can use regular expressions to sift out content from the original email and do quite complicated stuff; it's really not reasonable to assume that it may be able to "keep only what's typed" - so I don't really know what to do in that case. (*) in some cases it leaves the old signature in, so you may end up with two signatures: Also if your signature contains smartTemplate variables, these will not be replaced (SmartTemplate⁴ is not involved in the signature replacement that Thunderbird does. I might look into overwriting the internal function of Thunderbird in order to fix that) |
So testing the above with the line back in behaves satisfactorily as long as we don't type ( one problem seems to be that the bodyModified flag (which is taken from the global gMsgCompose) is actually reset when we change the identity for the second time, which can lead to the SmartTemplate being loaded and the email being overwritten (this feels like it is a bug of Thunderbird itself, it should keep this flag even after Loading an Identity) - maybe that's something I can prevent. |
Alright! I have just also implemented some change that removes the unresolved fields (such as |
Sorry it took me a while to get back to this. Is this fix now present in the current v2.7, or should I try the 2.6pre7 that you posted? |
Yes it should be fixed with the current version 2.7. I am very close to releasing 2.8 so why not test with that instead? I will answer to your email directly and we can discuss from there. |
Losing text was caused by using |
Yes, thanks again for you help! |
I have a secondary, non-default identity for an email account that I have defined a signature for in TB account settings. Since signatures are different, I use %sig% in ST4 template, e.g. in the "Reply" settings.
In TB, when I do a "Reply" for an email, it first comes up with the default-identity signature which is fine. In the "From" field, I now switch to the secondary identity which causes the signature to change accordingly, so at first glance it appears correct. However, any changes I do to the signature in TB account settings are not applied, not even after a restart, it always stays the same. ST4 seems to have captured this signature once for the %sig% variable, but not updated it after.
The text was updated successfully, but these errors were encountered: