diff options
author | thomascube <thomas@roundcube.net> | 2005-12-14 23:47:32 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2005-12-14 23:47:32 +0000 |
commit | 749b07c78a29b03c63812c3ec3630b16db4baa8f (patch) | |
tree | 5e6749f18a5a65a6bd0b97b356d41358e3676fea /program/js/app.js | |
parent | 9fc381f4e8712fec0e7b67c0f4e7af0980261e16 (diff) |
IMAP bugfixes, better signature handling
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js index d65af420e..a7445e2b5 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -6,7 +6,7 @@ | Copyright (C) 2005, RoundCube Dev, - Switzerland | | Licensed under the GNU GPL | | | - | Modified: 2005/11/13 (roundcube) | + | Modified: 2005/12/14 (roundcube) | | | +-----------------------------------------------------------------------+ | Author: Thomas Bruederli <roundcube@gmail.com> | @@ -1356,24 +1356,30 @@ function rcube_webmail() var id = obj.options[obj.selectedIndex].value; var input_message = rcube_find_object('_message'); var message = input_message ? input_message.value : ''; + var sig, p; // remove the 'old' signature if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity]) { - var sig = this.env.signatures[this.env.identity]; - - if (p = message.lastIndexOf(sig)) + sig = this.env.signatures[this.env.identity]; + if (sig.indexOf('-- ')!=0) + sig = '-- \n'+sig; + + p = message.lastIndexOf(sig); + if (p>=0) message = message.substring(0, p-1) + message.substring(p+sig.length, message.length); } // add the new signature string if (this.env.signatures && this.env.signatures[id]) { - var sig = this.env.signatures[id]; + sig = this.env.signatures[id]; + if (sig.indexOf('-- ')!=0) + sig = '-- \n'+sig; message += '\n'+sig; } - if (input_message && message) + if (input_message) input_message.value = message; this.env.identity = id; |