rem: if( msgBody.indexOf(prefix) >= 0 && msgBody.indexOf(suffix) >= 0 ) { 
add: if( (prefix && msgBody.indexOf(prefix) >= 0 ) && (suffix && msgBody.indexOf(suffix) >= 0 ) ) { 
context:   NotifyDocumentStateChanged: function(nowDirty) {    dump("tzDocStateListener.NotifyDocumentStateChanged("+nowDirty+"): ");    var isEmpty = tzEditorObj.documentIsEmpty;    var isEditable = tzEditorObj.isDocumentEditable;    dump( (isEmpty?"empty":"not empty")+", "      +(isEditable?"editable":"not editable")+"\n" );    if( !isEditable )      return;    /* Don't add a tagline if there's one already added (eg, editing a       draft) -- experimental!  May break if a tagline is quoted in a       reply */    if( !isEmpty && !tzAddedTagline ) {      var msgBody;  // Message body for our perusal      // indicators for detecting tagline      var prefix = readMyPref("tagzilla.mail.prefix","string","");      var suffix = readMyPref("tagzilla.mail.suffix","string","");      if( window.GetCurrentEditor ) {        var ed = window.GetCurrentEditor();        /* 1026 = 2 (output formatted) | 1024 (LF linebreak)           taken from enigmailMsgComposeOverlay.js */        msgBody = ed.outputToString("text/plain", 1026);      }      /*      else if(msgPane.editorShell) {        // FIXME      }      */      msgBody = msgBody.replace(/\n/g,"\\n");      if( msgBody.indexOf(prefix) >= 0 && msgBody.indexOf(suffix) >= 0 ) {        tzDump( "tzDocStateListener detected previous tagline\n" );        tzAddedTagline = true;      }    }    if( !tzAddedTagline ) {      var prefPrefix = "tagzilla."+gCurrentIdentity.key;      if(readMyPref(prefPrefix+".mailAuto","bool",true) &&        readMyPref(prefPrefix+".mailPick","bool",false)) {        tzDump("tzDocStateListener inserting tagline\n");        setTimeout(tzInsertTagline, 150);      }    }  }
meta: 1647	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1647/5437265ca38b31859b09fc1d641104773c6476d1/tagzillaComposeOverlay.js/buggy/src/tagzilla/content/tagzillaComposeOverlay.js