Changeset 367290


Ignore:
Timestamp:
Dec 1, 2008, 7:13:21 PM (13 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
1f7cec
Parents:
3e6ac1
Message:

same as [454] for 0.6 branch (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

    r3e6ac1 r367290  
    9292        var subtitle = vI_getHeader.strings.getString("vident.getHeader.noHeader");
    9393        // create array to count the header
    94         var currentHeadersCounter = []
     94        var currentHeadersCounter = [];
     95       
     96        var vI_listId = false; var vI_received = false;
    9597        // loop through the headers
    9698        for (var header in currentHeaderData) {
    97             var headerName = currentHeaderData[header].headerName.toLowerCase()
     99            var headerName = currentHeaderData[header].headerName.toLowerCase();
    98100
    99101            // remember list-id header to prevent using Mailing-List addresses as sender
    100             if (headerName == "list-id") {
    101                 hdr.setStringProperty("vI_list-id","found");
     102            if (!vI_listId && headerName == "list-id") {
     103                hdr.setStringProperty("vI_list-id","found"); vI_listId = true;
    102104                vI_notificationBar.dump("## vI_getHeader: found header: list-id  ...stored to recognize mailing-list\n");
    103                 continue;
    104             }
    105 
     105//              continue;
     106            }
     107
     108            // remember received header to prevent using Mailing-List addresses as sender
     109            if (!vI_received && headerName == "received") {
     110                hdr.setStringProperty("vI_received","found"); vI_received = true;
     111                vI_notificationBar.dump("## vI_getHeader: found header: received  ...stored to recognize received mail\n");
     112//              continue;
     113            }
     114           
    106115            if (currentHeadersCounter[headerName]) currentHeadersCounter[headerName]++
    107116            else currentHeadersCounter[headerName] = 1
     
    209218        // add List-Id to recognizable headers to prevent using Mailing-List addresses as sender
    210219        header_list.push("List-Id")
     220
     221        // add Received to recognizable headers to detect if mail was sent or received
     222        header_list.push("Received")
    211223
    212224        try {
  • chrome/content/v_identity/vI_smartIdentity.js

    r3e6ac1 r367290  
    252252
    253253        vI_notificationBar.dump("## vI_smartIdentity: Reply()\n");
    254         if (hdr && (hdr.folder.flags & 0x0200)) {   // MSG_FOLDER_FLAG_SENTMAIL
    255             vI_notificationBar.dump("## vI_smartIdentity: reply from Sent folder, using SmartDraft. \n");
    256             vI_smartIdentity.ReplyOnSent(hdr);
    257             return;
     254       
     255        if (hdr && !hdr.getStringProperty("vI_received")) { // mail was not received
     256                vI_notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
     257                vI_smartIdentity.ReplyOnSent(hdr);
     258                return;
    258259        }
    259260               
Note: See TracChangeset for help on using the changeset viewer.