Changeset cb0162


Ignore:
Timestamp:
Jul 7, 2011, 7:24:49 PM (9 years ago)
Author:
rene <rene@…>
Branches:
ng_0.8, ng_0.9
Children:
8b64a0
Parents:
a760b3
Message:

compatibility with Thunderbird Conversation

File:
1 edited

Legend:

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

    ra760b3 rcb0162  
    7575    },
    7676
    77     getHeader: function() {
     77    getHeaderDummy: function() {
     78       
     79    },
     80   
     81    getHeader: function(hdr) {
    7882        vI_notificationBar.clear_dump()
    7983        var index;
    80 
    81         try { var srcMsgURI = gDBView.URIForFirstSelectedMessage; } catch (ex) { return; }
    82         if (srcMsgURI == null) return;
    83        
    84         if (/type=application\/x-message-display/.test(srcMsgURI)) {
    85             vI_notificationBar.dump("## vI_getHeader: opening stored Message, can't get Message Header\n");
    86             return;
    87         }
    88        
    89         try { var hdr = vI_getHeader.messenger.messageServiceFromURI(srcMsgURI).messageURIToMsgHdr(srcMsgURI); }
    90         catch(vErr) {
    91             vI_notificationBar.dump("## vI_getHeader: can't get Message Header.\n");
    92             return;
    93         };
    9484
    9585        if (!vI_getHeader.headerToSearch) vI_getHeader.prepareHeaderToSearchArray()
     
    178168        var listener = {};
    179169        listener.onStartHeaders = vI_getHeader.hideExtraHeader;
    180         listener.onEndHeaders   = vI_getHeader.getHeader;
     170        listener.onEndHeaders   = vI_getHeader.getHeaderDummy;
    181171        gMessageListeners.push(listener);
    182172
     
    186176       
    187177        vI_getHeader.unicodeConverter.charset = "UTF-8";
     178       
     179        // read headers later if msg is loaded completely - this ensures compatibility to Thunderbird Conversation
     180        vI_getHeader.orig_OnMsgLoaded = OnMsgLoaded;
     181        OnMsgLoaded = vI_getHeader.OnMsgLoaded;
     182    },
     183   
     184    OnMsgLoaded: function(url) {
     185        const Cc = Components.classes;
     186        const Ci = Components.interfaces;
     187        // Necko URL, so convert it into a message header
     188        let ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
     189        var neckoURL = ioService.newURI(null, null, url.baseURI);
     190        neckoURL.QueryInterface(Ci.nsIMsgMessageUrl);
     191       
     192        var msgHdr = neckoURL.messageHeader;
     193        if (msgHdr) vI_getHeader.getHeader(msgHdr);
     194        vI_getHeader.orig_OnMsgLoaded(url)
    188195    }
    189196}
Note: See TracChangeset for help on using the changeset viewer.