Changeset 577806


Ignore:
Timestamp:
Aug 18, 2008, 8:23:06 PM (13 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
a26656
Parents:
762f6c
Message:

bugfix to re-enable editing drafts / smart draft in TB 3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_smartIdentity.js

    r762f6c r577806  
    9696    },
    9797   
     98    ReplyOnSent : function(hdr) {
     99        vI_notificationBar.dump("## vI_smartIdentity: ReplyOnSent() (rules like SmartDraft)\n");
     100       
     101        var allIdentities = new identityCollection();
     102
     103        vI_smartIdentity.__SmartDraftOrReplyOnSent(hdr, allIdentities);
     104        var storageIdentities = new identityCollection();
     105        vI_storage.getVIdentityFromAllRecipients(storageIdentities);
     106       
     107        allIdentities.mergeWithoutDuplicates(storageIdentities);
     108           
     109        if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, true);
     110
     111    },
     112
    98113    Draft : function(hdr) {
    99114        vI_notificationBar.dump("## vI_smartIdentity: Draft()\n");
    100115       
    101116        var allIdentities = new identityCollection();
    102         vI_smartIdentity.__SmartDraft(hdr, allIdentities);
     117
     118        var draftHdr = null;
     119        // fails with seamonkey 1.1.11, so just try it
     120        try { draftHdr = vI_smartIdentity.messenger.
     121            messageServiceFromURI(gMsgCompose.compFields.draftId).messageURIToMsgHdr(gMsgCompose.compFields.draftId);
     122        } catch (ex) { };
     123
     124        vI_smartIdentity.__SmartDraftOrReplyOnSent(draftHdr, allIdentities);
    103125        var storageIdentities = new identityCollection();
    104126        vI_storage.getVIdentityFromAllRecipients(storageIdentities);
     
    110132   
    111133    // this function checks if we have a draft-case and Smart-Draft should replace the Identity
    112     __SmartDraft : function(hdr, allIdentities) {
     134    __SmartDraftOrReplyOnSent : function(hdr, allIdentities) {
    113135        if (!vI.preferences.getBoolPref("smart_draft"))
    114136            { vI_notificationBar.dump("## vI_smartIdentity: SmartDraft deactivated\n"); return; }
    115         vI_notificationBar.dump("## vI_smartIdentity: __SmartDraft()\n");
    116            
     137
     138        vI_notificationBar.dump("## vI_smartIdentity: __SmartDraftOrReplyOnSent()\n");
     139
    117140        if (hdr) {
    118141            vI.headerParser.parseHeadersWithArray(hdr.author, allIdentities.emails,
     
    125148            vI_notificationBar.dump("## vI_smartIdentity: sender '" + allIdentities.combinedNames[0] + "'\n");
    126149        }
    127         else vI_notificationBar.dump("## vI_smartIdentity: __SmartDraft: No Header found, shouldn't happen\n");
     150        else vI_notificationBar.dump("## vI_smartIdentity: __SmartDraftOrReplyOnSent: No Header found, shouldn't happen\n");
    128151    },
    129152   
     
    248271        if (hdr.folder.flags & 0x0200) {    // MSG_FOLDER_FLAG_SENTMAIL
    249272            vI_notificationBar.dump("## vI_smartIdentity: reply from Sent folder, using SmartDraft. \n");
    250             vI_smartIdentity.Draft(hdr);
     273            vI_smartIdentity.ReplyOnSent(hdr);
    251274            return;
    252275        }
Note: See TracChangeset for help on using the changeset viewer.