Changeset 612fd5


Ignore:
Timestamp:
Nov 25, 2008, 9:23:31 PM (12 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
16bb7e
Parents:
85cfdc
Message:

if Sent folder is Inbox reply didn't worked. Now checking for received-headers.

Location:
chrome/content/v_identity
Files:
2 edited

Legend:

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

    r85cfdc r612fd5  
    9393        var subtitle = vI_getHeader.strings.getString("vident.getHeader.noHeader");
    9494        // create array to count the header
    95         var currentHeadersCounter = []
     95        var currentHeadersCounter = [];
     96       
     97        var vI_listId = false; var vI_received = false;
    9698        // loop through the headers
    9799        for (var header in currentHeaderData) {
    98             var headerName = currentHeaderData[header].headerName.toLowerCase()
     100            var headerName = currentHeaderData[header].headerName.toLowerCase();
    99101
    100102            // remember list-id header to prevent using Mailing-List addresses as sender
    101             if (headerName == "list-id") {
    102                 hdr.setStringProperty("vI_list-id","found");
     103            if (!vI_listId && headerName == "list-id") {
     104                hdr.setStringProperty("vI_list-id","found"); vI_listId = true;
    103105                vI_notificationBar.dump("## vI_getHeader: found header: list-id  ...stored to recognize mailing-list\n");
    104                 continue;
    105             }
    106 
     106//              continue;
     107            }
     108
     109            // remember received header to prevent using Mailing-List addresses as sender
     110            if (!vI_received && headerName == "received") {
     111                hdr.setStringProperty("vI_received","found"); vI_received = true;
     112                vI_notificationBar.dump("## vI_getHeader: found header: received  ...stored to recognize received mail\n");
     113//              continue;
     114            }
     115           
    107116            if (currentHeadersCounter[headerName]) currentHeadersCounter[headerName]++
    108117            else currentHeadersCounter[headerName] = 1
     
    216225        // add List-Id to recognizable headers to prevent using Mailing-List addresses as sender
    217226        header_list.push("List-Id")
     227       
     228        // add Received to recognizable headers to detect if mail was sent or received
     229        header_list.push("Received")
    218230
    219231        try {
  • chrome/content/v_identity/vI_smartIdentity.js

    r85cfdc r612fd5  
    265265        vI_notificationBar.dump("## vI_smartIdentity: Reply()\n");
    266266       
    267         const MSG_FOLDER_FLAG_INBOX = 0x1000
    268         const MSG_FOLDER_FLAG_SENTMAIL = 0x0200;
    269 
    270         if (hdr && (hdr.folder.flags & MSG_FOLDER_FLAG_SENTMAIL)) {
    271             vI_notificationBar.dump("## vI_smartIdentity: reply from Sent folder.");
    272             if (hdr.folder.flags & MSG_FOLDER_FLAG_INBOX)
    273                 vI_notificationBar.dump(" Folder is INBOX, assuming Reply-Case. \n");
    274             else {
    275                 vI_notificationBar.dump(" Using SmartDraft. \n");
     267        if (hdr && !hdr.getStringProperty("vI_received")) { // mail was not received
     268                vI_notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
    276269                vI_smartIdentity.ReplyOnSent(hdr);
    277270                return;
    278             }
    279         }
    280        
     271        }
     272
    281273        var storageIdentities = new identityCollection();
    282274        vI_storage.getVIdentityFromAllRecipients(storageIdentities);
Note: See TracChangeset for help on using the changeset viewer.