Changeset 98f5ee


Ignore:
Timestamp:
Mar 3, 2008, 12:12:33 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
1a63de
Parents:
01d76e
Message:

code cleanup

File:
1 edited

Legend:

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

    r01d76e r98f5ee  
    4545        // if there is no ID of the original Message  (Why?) leave the function
    4646        var uri = gMsgCompose.originalMsgURI;
    47         if (!uri) {
    48             vI_notificationBar.dump("## vI_smartIdentity: cant get URI of former Message\n");
    49             //~ return;
    50         }
     47        if (!uri) vI_notificationBar.dump("## vI_smartIdentity: can't get URI of former Message\n");
    5148        try { var hdr = vI_smartIdentity.messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); }
    5249        catch(vErr) {
    53             vI_notificationBar.dump("## vI_smartIdentity: can't get Message Header.\n");
    54             vI_notificationBar.dump("## vI_smartIdentity: (maybe you're opening a message stored as a file)\n");
     50            vI_notificationBar.dump("## vI_smartIdentity: can't get Message Header of former Message.\n");
    5551            hdr = null;
    56             //~ return;
    5752        };
    5853       
     
    7772            case msgComposeType.NewsPost:
    7873            case msgComposeType.MailToUrl:
    79                 vI_smartIdentity.queryStorage();
    80                 if (vI.preferences.getBoolPref("smart_timestamp"))
    81                     vI_smartIdentity.SmartTimestamp();
     74                vI_smartIdentity.SmartNewMail();
    8275                break;
    8376
    8477            }
    8578    },
    86    
    87     // this function creates a list of possible sender addresses from Storage and uses them (according to SmartReply behaivior)
    88     queryStorage : function() {
    89         var all_addresses = { number : 0, emails : {}, fullNames : {}, combinedNames : {}, id_keys : {}, smtp_keys : {} };
    90         vI_storage.getVIdentityFromAllRecipients(all_addresses);
    91         vI_notificationBar.dump("## vI_smartIdentity: checked for stored VIdentities and found " + all_addresses.number + " address(es)\n")
    92         if (all_addresses.number > 0) vI_smartIdentity.smartIdentitySelection(all_addresses, false);
    93     },
    94    
     79       
    9580    // this function adds a timestamp to the current sender
    9681    SmartTimestamp : function() {
     
    11196                    "smart_reply_notification");
    11297        vI_msgIdentityClone.setIdentity(getCurrentIdentity().fullName + " <" + new_email + ">");
     98    },
     99   
     100    SmartNewMail : function() {
     101        var all_addresses = { number : 0, emails : {}, fullNames : {}, combinedNames : {}, id_keys : {}, smtp_keys : {} };
     102        vI_storage.getVIdentityFromAllRecipients(all_addresses);
     103        vI_notificationBar.dump("## vI_smartIdentity: checked for stored VIdentities and found " + all_addresses.number + " address(es)\n")
     104
     105        if (all_addresses.number > 0)
     106            vI_smartIdentity.smartIdentitySelection(all_addresses, false)
     107        else if (vI.preferences.getBoolPref("smart_timestamp"))
     108            vI_smartIdentity.SmartTimestamp(); 
    113109    },
    114110   
     
    159155    },
    160156   
    161     // checks if any Identity in the collected address-set i still available as
     157    // checks if any Identity in the collected address-set is already available as
    162158    // a stored identity. If so, use the stored one.
    163159    matchAnyIdentity : function(all_addresses) {
     
    350346        /* first step: collect addresses */
    351347       
    352         // check if Storage-search should be used before SmartReply
     348        // check if Storage-search should be used in SmartReply-case
    353349        if (vI.preferences.getBoolPref("storage_use_for_smart_reply")) {
    354350            vI_storage.getVIdentityFromAllRecipients(storage_addresses);
Note: See TracChangeset for help on using the changeset viewer.