This is just some static backup of the original site, don't expect every link to work!

Changeset 284956


Ignore:
Timestamp:
Sep 25, 2011, 10:42:36 PM (11 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
fadbc5
Parents:
9cedc0
Message:

moved some files to increase overview

Location:
chrome
Files:
1 added
17 edited
11 moved

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/modules/vI_account.js

    r9cedc0 r284956  
    2222    Contributor(s):
    2323 * ***** END LICENSE BLOCK ***** */
     24
     25/* this is now used as a module - there is no required reference to any other interface-elements in this code */
    2426
    2527virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
  • chrome/content/v_identity/modules/vI_helper.js

    r9cedc0 r284956  
    2222    Contributor(s):
    2323 * ***** END LICENSE BLOCK ***** */
     24
     25/* this is now used as a module - there is no required reference to any other interface-elements in this code */
    2426
    2527virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
  • chrome/content/v_identity/modules/vI_rdfDatasource.js

    r9cedc0 r284956  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
     25/* this is now used as a module - there is no required reference to any other interface-elements in this code */
    2526
    2627virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
  • chrome/content/v_identity/vI_Dialog.xul

    r9cedc0 r284956  
    4444    persist="height width">
    4545
    46     <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     46    <script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    4747    <script type="application/x-javascript" src="chrome://v_identity/content/vI_Dialog.js" />
    4848
  • chrome/content/v_identity/vI_am-Overlay.xul

    r9cedc0 r284956  
    2525
    2626<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    27     <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     27    <script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    2828    <script type="application/x-javascript" src="chrome://v_identity/content/vI_am-Overlay.js"/>
    2929</overlay>
  • chrome/content/v_identity/vI_am-smtpOverlay.xul

    r9cedc0 r284956  
    2525
    2626<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    27     <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     27    <script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    2828    <script type="application/x-javascript" src="chrome://v_identity/content/vI_am-smtpOverlay.js"/>
    2929</overlay>
  • chrome/content/v_identity/vI_context.xul

    r9cedc0 r284956  
    3434
    3535<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    36     <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
     36    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />
    3737    <script type="application/x-javascript">
    3838    virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
  • chrome/content/v_identity/vI_getHeader.xul

    r9cedc0 r284956  
    3535<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    3636
    37 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     37<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    3838<script type="application/x-javascript" src="chrome://v_identity/content/vI_getHeader.js"/>
    39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
     39<script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
    4040
    4141
  • chrome/content/v_identity/vI_prefDialog.xul

    r9cedc0 r284956  
    5353            src="chrome://v_identity/content/vI_storageExtras.js" />
    5454<script type="application/x-javascript"
    55             src="chrome://v_identity/content/vI_rdfDatasource.js" />
     55            src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />
    5656<script type="application/x-javascript"
    57             src="chrome://v_identity/content/vI_notificationBar.js" />
     57            src="chrome://v_identity/content/notificationbar/vI_notificationBar.js" />
    5858
    5959<stringbundleset id="stringbundleset">
  • chrome/content/v_identity/vI_prefDialog_TB3.xul

    r9cedc0 r284956  
    3939            title="&vI_prefDialog.dlgTitle.label;" >
    4040       
    41 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     41<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    4242        <script type="application/x-javascript"
    4343            src="chrome://v_identity/content/vI_prefDialog_FolderPicker.js" />
     
    4545            src="chrome://v_identity/content/vI_prefDialog.js" />
    4646        <script type="application/x-javascript"
    47             src="chrome://v_identity/content/vI_helper.js" />
     47            src="chrome://v_identity/content/modules/vI_helper.js" />
    4848
    4949</dialog>
  • chrome/content/v_identity/vI_rdfAccountMismatchDialog.xul

    r9cedc0 r284956  
    3535    ondialogcancel="virtualIdentityExtension.rdfAccountMismatchDialog.accept();"
    3636    zlevel="6">
    37     <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
    38     <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
     37    <script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
     38    <script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
    3939    <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfAccountMismatchDialog.js" />
    4040   
  • chrome/content/v_identity/vI_rdfDataEditor.xul

    r9cedc0 r284956  
    3636    title="&vI_rdfDataEditor.dlgTitle.label;" >
    3737
    38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     38<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    3939<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataEditor.js" />
    40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
     40<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
    4141<script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" />
    4242<script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    43 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    44 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
     43<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
     44<script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
    4545<script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
    4646
  • chrome/content/v_identity/vI_rdfDataTree.xul

    r9cedc0 r284956  
    6161        title="&vI_rdfDataTree.dlgTitle.label;">
    6262
    63 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
    64 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    65 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
    66 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    67 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
     63<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
     64<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
     65<script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
     66<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
     67<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />
    6868<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataTree.js" />
    6969<script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
  • chrome/content/v_identity/vI_smartIdentity.js

    r9cedc0 r284956  
    2424
    2525virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    26 
    2726   
    28 function smartIdentityCollection(msgHdr, preseletedID, currentIDisVID, newsgroup, recipients) {
    29     this._IDisVID = currentIDisVID;
    30     this._preselectedID = preseletedID;
    31     this._msgHdr = msgHdr;
    32     this._newsgroup = newsgroup;
    33     this._unicodeConverter.charset = "UTF-8";
    34     this._recipients = recipients;
    35     this._rdfDatasourceAccess = new vI.rdfDatasourceAccess();
    36     this._allIdentities = new vI.identityCollection();
    37 };
    38 
    39 smartIdentityCollection.prototype = {
    40     messenger : Components.classes["@mozilla.org/messenger;1"].createInstance()
    41         .QueryInterface(Components.interfaces.nsIMessenger),
    42     _pref : Components.classes["@mozilla.org/preferences-service;1"]
    43             .getService(Components.interfaces.nsIPrefService)
    44             .getBranch("extensions.virtualIdentity."),
    45     _unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
    46             .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
    47     _headerParser : Components.classes["@mozilla.org/messenger/headerparser;1"]
    48             .getService(Components.interfaces.nsIMsgHeaderParser),
    49 
    50     _msgComposeTypeReference : Components.interfaces.nsIMsgCompType,
    51    
    52     _IDisVID : false,
    53     _preselectedID : null,
    54     _allIdentities : null,
    55     _selectedValue : null,
    56     _newsgroup : null,
    57     _rdfDatasourceAccess : null,
    58 
    59     // this function adds a timestamp to the current sender
    60     __autoTimestamp : function() {
    61         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: __autoTimestamp()\n");
    62         if (this._IDisVID) {
    63             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: Virtual Identity in use, aborting\n");
    64             return;
    65         }
    66 
    67         var current_email = this._preselectedID.email.split("@");
    68         var localpart = current_email[0];
    69         var domain = current_email[1];
    70        
    71         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: current email: " + current_email[0] + "@" + current_email[1] + "\n");
    72        
    73         var autoString = this._pref.getCharPref("autoString");
    74         var formatString = this._pref.getCharPref("autoTimeFormat");
    75        
    76         var dateObj = new Date(); var dateString = "";
    77         if (formatString == "") dateString = parseInt(dateObj.getTime()/1000);
    78         else try {  //  you never know what the formatString will be...
    79             dateString = dateObj.toLocaleFormat(formatString).replace(/\s+|[\x00-\x2a]|\x2c|\x2f|[\x3a-\x40]|[\x5b-\x5d]|\x60|\x7c|[\x7f-\xff]/g,"_");
    80         } catch(e) { };
    81        
    82         var new_email = autoString.replace(/%l/g, localpart).replace(/%d/g, domain).replace(/%t/g,dateString);
    83         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: new email: " + new_email + "\n");
    84 
    85         var newIdentity = new vI.identityData(new_email,
    86             this._preselectedID.fullName, this._preselectedID.key, this._preselectedID.smtpServerKey, null, null)
    87 
    88         this._allIdentities.addWithoutDuplicates(newIdentity);
    89         this._selectedValue = 0;
    90     },
    91    
    92     __ignoreID : function() {
    93         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: checking " + this._pref.getCharPref("idSelection_ignoreIDs") + " against " + this._preselectedID.key + "\n")
    94         // check if usage if virtual Identities should be used at all for the currently selected ID
    95         if (this._pref.getCharPref("idSelection_ignoreIDs").indexOf(":" + this._preselectedID.key + ":") != -1) {
    96             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: not using virtual Identites for ID " + this._preselectedID.key + "\n");
    97             return true;
    98         }
    99         return false
    100     },
    101    
    102     NewMail : function() {
    103         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: NewMail()\n");
    104         if (this.__ignoreID()) return;
    105         this._rdfDatasourceAccess.getVIdentityFromAllRecipients(this._allIdentities, this._recipients);
    106         if (this._allIdentities.number == 0 && this._pref.getBoolPref("autoTimestamp")) this.__autoTimestamp();
    107     },
    108    
    109     _foundExistingIdentity : function() {
    110         /* compare with existing Identities                                     */
    111         for (var index = 0; index < this._allIdentities.number; index++) {
    112             var existingID = this._allIdentities.identityDataCollection[index].isExistingIdentity(false);
    113             if (existingID) {
    114                 this._allIdentities.identityDataCollection[index].id.key = existingID;  // set found identity
    115                 // reorder list of Identities to prefer it on autoselect
    116                 // has to be done before Identities are added to the Menu
    117                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: found existing Identity, reorder to prefer this one.\n");
    118                 var firstIdentity = this._allIdentities.identityDataCollection[index];
    119                 for (var i = index; index > 0; index--) {
    120                     this._allIdentities.identityDataCollection[index] = this._allIdentities.identityDataCollection[index-1];
    121                 }
    122                 this._allIdentities.identityDataCollection[0] = firstIdentity;
    123                 return { key: index };
    124             }
    125         }
    126         return null;
    127     },
    128    
    129     ReplyOnSent : function() {
    130         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: ReplyOnSent() (rules like SmartDraft)\n");
    131         this.__SmartDraftOrReplyOnSent();
    132         this._rdfDatasourceAccess.getVIdentityFromAllRecipients(this._allIdentities, this._recipients);
    133     },
    134 
    135     Draft : function() {
    136         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: Draft()\n");
    137        
    138         this.__SmartDraftOrReplyOnSent();
    139         this._rdfDatasourceAccess.getVIdentityFromAllRecipients(this._allIdentities, this._recipients);
    140     },
    141    
    142     __parseHeadersWithArray: function(header, identityCollection) {
    143         var emails = {}; var fullNames = {}; var combinedNames = {};
    144         var number = this._headerParser.parseHeadersWithArray(header, emails, fullNames, combinedNames);
    145         for (var index = 0; index < number; index++) {
    146             var newIdentity = new vI.identityData(emails.value[index], fullNames.value[index],
    147                 null, vI.NO_SMTP_TAG, null, null);
    148             identityCollection.addWithoutDuplicates(newIdentity);
    149         }
    150     },
    151 
    152     // this function checks if we have a draft-case and Smart-Draft should replace the Identity
    153     __SmartDraftOrReplyOnSent : function() {
    154         if (!this._pref.getBoolPref("smart_draft"))
    155             { if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: SmartDraft deactivated\n"); return; }
    156 
    157         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: __SmartDraftOrReplyOnSent()\n");
    158 
    159         if (this._msgHdr) {
    160             this.__parseHeadersWithArray(this._msgHdr.author, this._allIdentities)
    161             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: sender '" + this._allIdentities.identityDataCollection[0].combinedName + "'\n");
    162         }
    163         else if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: __SmartDraftOrReplyOnSent: No Header found, shouldn't happen\n");
    164     },
    165    
    166     __filterAddresses : function() {
    167         var returnIdentities = new vI.identityCollection();
    168        
    169         var filterList  =
    170             this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_filter")).split(/\n/)
    171         if (filterList.length == 0) filterList[0] == ""
    172        
    173         for (var i = 0; i < filterList.length; i++) {
    174             const filterType = { None : 0, RegExp : 1, StrCmp : 2 }
    175             var recentfilterType; var skipRegExp = false;
    176             if (filterList.length <= 1 && filterList[0] == "")
    177                 { if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: no filters configured\n"); recentfilterType = filterType.None; }
    178             else if (/^[+-]?\/(.*)\/$/.exec(filterList[i]))
    179                 { if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: filter emails with RegExp '"
    180                     + filterList[i].replace(/\\/g,"\\\\") + "'\n"); recentfilterType = filterType.RegExp; }
    181             else    { if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: filter emails, compare with '"
    182                     + filterList[i] + "'\n"); recentfilterType = filterType.StrCmp; }
    183             for (var j = 0; j < this._allIdentities.number; j++) { // check if recent email-address (pre-choosen identity) is found in
    184             // copied and adapted from correctIdentity, thank you for the RegExp-idea!
    185                 var add_addr = false;
    186                 switch (recentfilterType) {
    187                     case filterType.None:
    188                         add_addr = true; break;
    189                     case filterType.RegExp:
    190                         if (skipRegExp) break;
    191                         try {   /^[+-]?\/(.*)\/$/.exec(filterList[i]);
    192                             if ( filterList[i][0] == "-" ) {
    193                                 if (this._allIdentities.identityDataCollection[j].email.match(new RegExp(RegExp.$1,"i")))
    194                                     this._allIdentities.dropIdentity(j--);
    195                             } else
    196                                 add_addr = (this._allIdentities.identityDataCollection[j].email.match(new RegExp(RegExp.$1,"i")));
    197                         }
    198                         catch(vErr) {
    199                             if (vI.notificationBar) vI.notificationBar.addNote(
    200                                 vI.main.elements.strings.getString("vident.smartIdentity.ignoreRegExp") +
    201                                 +filterList[i].replace(/\\/g,"\\\\") + " .",
    202                                 "smart_reply_notification");
    203                                 skipRegExp = true; }
    204                         break;
    205                     case filterType.StrCmp:
    206                         add_addr = ( this._allIdentities.identityDataCollection[j].email.toLowerCase().indexOf(filterList[i].toLowerCase()) != -1)
    207                         break;
    208                 }
    209                 if (add_addr)   returnIdentities.addWithoutDuplicates(this._allIdentities.identityDataCollection[j])
    210             }
    211         }
    212         this._allIdentities.takeOver(returnIdentities);
    213     },
    214    
    215     __smartReplyCollectAddresses : function() {
    216         // add emails from selected headers (stored by vI_getHeader.xul/js)
    217         var reply_headers = this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_headers")).split(/\n/)
    218                    
    219         for (var index = 0; index < reply_headers.length; index++) {
    220             // ------------- prepare fields to read the stored header ----------------
    221             var replyHeader_splitted = reply_headers[index].split(/:/)
    222             // use first part (all before ':') as the header name
    223             var replyHeaderName = replyHeader_splitted[0].toLowerCase()
    224             // check second or third part for any number
    225             var replyHeaderNumber = parseInt(replyHeader_splitted[1])
    226             if (isNaN(replyHeaderNumber)) replyHeaderNumber = parseInt(replyHeader_splitted[2])
    227             // check if Fullnames should be erased
    228             var replyHeaderEmptyFullNames = ((replyHeader_splitted[1] && replyHeader_splitted[1].match(/@/)) ||
    229                             (replyHeader_splitted[2] && replyHeader_splitted[2].match(/@/)))
    230            
    231             // create header name to find the value
    232             var replyHeaderNameToRead = replyHeaderName
    233             if (!isNaN(replyHeaderNumber)) replyHeaderNameToRead += ":" + replyHeaderNumber
    234            
    235             // if mailing-list ignore to-header (usually the mailing list address)
    236             if (replyHeaderNameToRead == "to" && this._msgHdr.getStringProperty("vI_list-id")) {
    237                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: header 'list-id' found (mailinglist), skipping header 'to'\n");
    238                 continue;
    239             }
    240            
    241             // ------------- read the stored header -------------------------------
    242             var value = this._unicodeConverter.ConvertToUnicode(this._msgHdr.getStringProperty("vI_" + replyHeaderNameToRead))
    243 /*          let window3pane =  Components.classes['@mozilla.org/appshell/window-mediator;1']
    244                  .getService(Components.interfaces.nsIWindowMediator)
    245                  .getMostRecentWindow("mail:3pane");
    246            
    247             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: found stored header '" +
    248                 replyHeaderNameToRead + "': '" + window3pane.virtualIdentityExtension.storedHeaders["vI_" + replyHeaderNameToRead] + "'\n");*/
    249            
    250             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: reading header '" +
    251                 replyHeaderNameToRead + "': '" + value + "'\n");
    252            
    253             // ------------- parse address-string to get a field of single email-addresses
    254             var splitted = new vI.identityCollection();
    255             this.__parseHeadersWithArray(value, splitted);
    256            
    257             // move found addresses step by step to this._allIdentities, and change values if requested
    258             for (var i = 0; i < splitted.number; i++) {
    259                 // if there is no email than it makes no sense to use it as a sender
    260                 if (!splitted.identityDataCollection[i].email.match(/^.*@.*$/)) {
    261                     if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity:   skipping '" +
    262                     splitted.identityDataCollection[i].email + "', no email\n")
    263                     continue;
    264                 }
    265 
    266                 if (replyHeaderEmptyFullNames) splitted.identityDataCollection[i].fullName = ""
    267 
    268                 this._allIdentities.addWithoutDuplicates(splitted.identityDataCollection[i]);
    269 
    270                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity:   found '" +
    271                     splitted.identityDataCollection[i].combinedName + "'\n")
    272             }
    273         }
    274     },
    275    
    276     Reply : function() {
    277         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: Reply()\n");
    278 
    279         if (this._msgHdr && this._newsgroup && !this._msgHdr.getStringProperty("vI_content_base")) {
    280         //  RFC 2821 (http://www.ietf.org/rfc/rfc2821.txt) says:
    281         //  "4.4 Trace Information
    282         //  When an SMTP server receives a message for delivery or further
    283         //  processing, it MUST insert trace ("time stamp" or "Received")
    284         //  information at the beginning of the message content, as discussed in
    285         //  section 4.1.1.4."
    286         //  so it should be always possible to decide if Reply or Draft based on received headers
    287         //  hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers
    288             // RFC-compliant
    289             if (this._pref.getBoolPref("smart_detectByReceivedHeader")) {
    290                 if (!this._msgHdr.getStringProperty("vI_received")) { // mail was not received
    291                     if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
    292                     this.ReplyOnSent();
    293                     return;
    294                 }
    295             }
    296             // not RFC-compliant
    297             else {
    298                 const MSG_FOLDER_FLAG_INBOX = 0x1000
    299                 const MSG_FOLDER_FLAG_SENTMAIL = 0x0200;
    300 
    301                 if (this._msgHdr && (this._msgHdr.folder.flags & MSG_FOLDER_FLAG_SENTMAIL)) {
    302                     if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: reply from Sent folder.");
    303                     if (this._msgHdr.folder.flags & MSG_FOLDER_FLAG_INBOX)
    304                         if (vI.notificationBar) vI.notificationBar.dump(" Folder is INBOX, assuming Reply-Case. \n");
    305                     else {
    306                         if (vI.notificationBar) vI.notificationBar.dump(" Using SmartDraft. \n");
    307                         this.ReplyOnSent();
    308                         return;
    309                     }
    310                 }
    311             }
    312         }
    313        
    314         if (this.__ignoreID()) return;
    315        
    316         var storageIdentities = new vI.identityCollection();
    317         this._rdfDatasourceAccess.getVIdentityFromAllRecipients(storageIdentities, this._recipients);
    318        
    319         if (storageIdentities.number == 0 || !this._pref.getBoolPref("idSelection_storage_ignore_smart_reply"))
    320             this.__SmartReply();
    321         else if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: SmartReply skipped, Identities in Storage found.\n");
    322 
    323         // merge SmartReply-Identities and Storage-Identites
    324         if (this._pref.getBoolPref("idSelection_storage_prefer_smart_reply"))
    325             { this._allIdentities.mergeWithoutDuplicates(storageIdentities); }
    326         else {
    327             var smartIdentities = this._allIdentities;
    328             this._allIdentities = storageIdentities;       
    329             this._allIdentities.mergeWithoutDuplicates(smartIdentities);
    330         }
    331        
    332         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: merged SmartReply & Storage, " + this._allIdentities.number + " address(es) left\n")
    333     },
    334    
    335     // this function checks if we have a reply-case and Smart-Reply should replace the Identity
    336     __SmartReply : function() {
    337         if (!this._pref.getBoolPref("smart_reply"))
    338             { if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: SmartReply deactivated\n"); return; }
    339         if (this._newsgroup && !this._pref.getBoolPref("smart_reply_for_newsgroups")) {
    340             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: SmartReply, answering to a newsgroup, aborting\n");
    341             return;
    342         }
    343 
    344         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: __SmartReply()\n");
    345         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: ----------------------------------------------------------\n")
    346         if (this._msgHdr) {
    347             /* first step: collect addresses */
    348             this.__smartReplyCollectAddresses();
    349             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: " + this._allIdentities.number + " address(es) after parsing, before filtering\n")
    350            
    351             /* second step: filter (and sort) addresses */
    352             this.__filterAddresses();
    353            
    354             if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: filtering done, " + this._allIdentities.number + " address(es) left\n")
    355            
    356             /* set default FullName */
    357             var smart_reply_defaultFullName = this._unicodeConverter.ConvertToUnicode(this._pref.getCharPref("smart_reply_defaultFullName"))
    358             if (smart_reply_defaultFullName != "") {
    359                 for (var index = 0; index < this._allIdentities.number; index++) {
    360                     if (this._allIdentities.identityDataCollection[index].fullName == "") {
    361                         this._allIdentities.identityDataCollection[index].fullName = smart_reply_defaultFullName
    362                         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: added default FullName '" +
    363                             smart_reply_defaultFullName + "' to '" + this._allIdentities.identityDataCollection[index].email + "'\n")
    364                     }
    365                 }
    366             }   
    367 
    368             /* smart_reply_ignoreFullName: compare email with other Identities          */
    369             /* if match replace FullName with existing one, keep identity in list by now        */
    370             /* will not be added to the menu but probably choosen with __smartIdentitySelection     */
    371             if (this._pref.getBoolPref("smart_reply_ignoreFullName")) {
    372                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: compare with existing Identities (ignoring FullNames).\n")
    373            
    374                 for (var index = 0; index < this._allIdentities.number; index++) {
    375                     var idKey = this._allIdentities.identityDataCollection[index].isExistingIdentity(true);
    376                     if (idKey) {
    377                         var newFullName = gAccountManager.getIdentity(idKey).fullName;
    378                         this._allIdentities.identityDataCollection[index].fullName = newFullName;
    379                         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: replaced Fullname of '" + this._allIdentities.identityDataCollection[index].email + "' with '" + newFullName + "' \n");
    380                     }
    381                 }
    382             }
    383         }
    384         else if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: SmartReply skipped. No Header-information found.\n");
    385        
    386         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: ----------------------------------------------------------\n")
    387     },
    388    
    389 
    390 };
    391 
    39227var smartIdentity = {
    39328    _pref : Components.classes["@mozilla.org/preferences-service;1"]
     
    40641        var newsgroup = gMsgCompose.compFields.newsgroups;
    40742        var autocreate = false;
    408         if (vI.notificationBar) vI.notificationBar.dump("## smartIdentityCollection: msgComposeTypeReference = " + gMsgCompose.type + "\n");
     43        if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: msgComposeTypeReference = " + gMsgCompose.type + "\n");
    40944        switch (gMsgCompose.type) {
    41045            case msgComposeTypeReference.ForwardAsAttachment:
     
    41752            case msgComposeTypeReference.ReplyWithTemplate:
    41853            case msgComposeTypeReference.ReplyToList:
    419                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentityCollection: Reply\n");
     54                if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: Reply\n");
    42055                msgHdr = smartIdentity.messenger.
    42156                    messageServiceFromURI(gMsgCompose.originalMsgURI).messageURIToMsgHdr(gMsgCompose.originalMsgURI);
    422                 smartIdentity._smartIdentityCollection = new smartIdentityCollection(msgHdr, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients());
     57                smartIdentity._smartIdentityCollection = new vI.smartIdentityCollection(msgHdr, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients()); 
    42358                smartIdentity._smartIdentityCollection.Reply();
    42459                autocreate = false; break;
    42560            case msgComposeTypeReference.Draft:
    42661            case msgComposeTypeReference.Template:
    427                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentityCollection: Draft\n");
     62                if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: Draft\n");
    42863                msgHdr = smartIdentity.messenger.
    42964                    messageServiceFromURI(gMsgCompose.compFields.draftId).messageURIToMsgHdr(gMsgCompose.compFields.draftId);
    430                 smartIdentity._smartIdentityCollection = new smartIdentityCollection(msgHdr, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients());
     65                smartIdentity._smartIdentityCollection = new vI.smartIdentityCollection(msgHdr, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients()); 
    43166                smartIdentity._smartIdentityCollection.Draft();
    43267                autocreate = false; break;
     
    43469            case msgComposeTypeReference.NewsPost:
    43570            case msgComposeTypeReference.MailToUrl:
    436                 if (vI.notificationBar) vI.notificationBar.dump("## smartIdentityCollection: New Mail\n");
    437                 smartIdentity._smartIdentityCollection = new smartIdentityCollection(null, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients());   
     71                if (vI.notificationBar) vI.notificationBar.dump("## smartIdentity: New Mail\n");
     72                smartIdentity._smartIdentityCollection = new vI.smartIdentityCollection(null, getCurrentIdentity(), document.getElementById("msgIdentity_clone").vid, newsgroup, this._getRecipients());   
    43873                // to enable composing new email with new identity: identity is hidden in subject line
    43974                // used for instance from conversation addon
     
    561196}
    562197vI.smartIdentity = smartIdentity;
    563 vI.smartIdentityCollection = smartIdentityCollection;
    564198}});
  • chrome/content/v_identity/vI_smartReplyDialog.xul

    r9cedc0 r284956  
    3737    zlevel="6">
    3838
    39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     39<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    4040<script type="application/x-javascript" src="chrome://v_identity/content/vI_smartReplyDialog.js" />
    4141
  • chrome/content/v_identity/vI_upgrade.xul

    r9cedc0 r284956  
    4040    zlevel="6" onload="virtualIdentityExtension.upgrade.init(); virtualIdentityExtension.upgrade.prepare(document.getElementById('introPage'));" onunload="virtualIdentityExtension.upgrade.clean();" >
    4141
    42 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     42<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    4343<script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
    44 <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" />
     44<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_account.js" />
    4545<script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    46 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    47 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    48 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
    49 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />   
     46<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
     47<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
     48<script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
     49<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />   
    5050<script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" />
    5151
  • chrome/content/v_identity/vI_upgradeOverlay.xul

    r9cedc0 r284956  
    3636
    3737<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    38     <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     38    <script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
    3939
    40     <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>   
    41     <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" />
    42     <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
     40    <script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>   
     41    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_account.js" />
     42    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />
    4343    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgradeOverlay.js" />
    4444
     
    4646    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
    4747    <script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    48     <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    49     <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
     48    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
     49    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
    5050    <!-- include following script to enable conversation plugin -->
    5151    <script type="application/x-javascript" src="chrome://v_identity/content/vI_smartIdentity.js" />
     52    <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_smartIdentityCollection.js" />
    5253
    5354    <vbox id="messagepanebox" >
  • chrome/content/v_identity/v_identity.xul

    r9cedc0 r284956  
    3636  <overlay id="v_identity"
    3737          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
     38<script type="application/x-javascript" src="chrome://v_identity/content/_overlayNameSpaceWrapper.js" />
     39
     40<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
     41<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_account.js" />
     42<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_smartIdentityCollection.js" />
     43<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js"/>
     44
    3945<script type="application/x-javascript" src="chrome://v_identity/content/v_identity.js" />
    40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    41 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    42 <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" />
     46<script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
    4347<script type="application/x-javascript" src="chrome://v_identity/content/vI_msgIdentityCloneTools.js" />
    4448<script type="application/x-javascript" src="chrome://v_identity/content/vI_smartIdentity.js" />
    4549<script type="application/x-javascript" src="chrome://v_identity/content/vI_statusmenu.js" />
    46 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
    47 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js"/>
     50<script type="application/x-javascript" src="chrome://v_identity/content/notificationbar/vI_notificationBar.js"/>
    4851<script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js"/>
    4952<script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js"/>
  • chrome/skin/classic/v_identity/vI_Dialog.css

    r9cedc0 r284956  
    4343
    4444.vI_htmlTextBox {
    45   -moz-binding: url("chrome://v_identity/content/vI_htmlTextBox.xml#vI_htmlTextBox");
     45  -moz-binding: url("chrome://v_identity/content/bindings/vI_htmlTextBox.xml#vI_htmlTextBox");
    4646}
    4747
  • chrome/skin/classic/v_identity/v_identity.css

    r9cedc0 r284956  
    1313
    1414.mismatchLine {
    15     -moz-binding: url("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xml#mismatch-line");
     15    -moz-binding: url("chrome://v_identity/content/bindings/vI_rdfAccountMismatchDialog.xml#mismatch-line");
    1616}
    1717
    1818.mismatchMenulist {
    19     -moz-binding: url("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xml#mismatch-menulist");
     19    -moz-binding: url("chrome://v_identity/content/bindings/vI_rdfAccountMismatchDialog.xml#mismatch-menulist");
    2020}
    2121
    2222.mismatchMenupopup {
    23     -moz-binding: url("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xml#mismatch-menupopup");
     23    -moz-binding: url("chrome://v_identity/content/bindings/vI_rdfAccountMismatchDialog.xml#mismatch-menupopup");
    2424}
    2525
    2626
    2727.selectorListitem {
    28     -moz-binding: url("chrome://v_identity/content/vI_prefDialog.xml#selectorListitem");
     28    -moz-binding: url("chrome://v_identity/content/bindings/vI_prefDialog.xml#selectorListitem");
    2929}
    3030.identitySelector {
    31     -moz-binding: url("chrome://v_identity/content/vI_prefDialog.xml#identitySelector");
     31    -moz-binding: url("chrome://v_identity/content/bindings/vI_prefDialog.xml#identitySelector");
    3232}
    3333
     
    3535
    3636.mismatchMenuitem {
    37     -moz-binding: url("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xml#mismatch-menuitem");
     37    -moz-binding: url("chrome://v_identity/content/bindings/vI_rdfAccountMismatchDialog.xml#mismatch-menuitem");
    3838}
    3939
     
    4444
    4545.smtpServerListHbox {
    46     -moz-binding: url("chrome://v_identity/content/v_identity.xml#smtpServerList");
     46    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#smtpServerList");
    4747}
    4848#vI_rdfDataEditorContent checkbox.vI_plain {
     
    310310
    311311#vINotification {
    312   -moz-binding: url("chrome://v_identity/content/vI_notificationBar.xml#vI_notificationbox");
     312  -moz-binding: url("chrome://v_identity/content/notificationbar/vI_notificationBar.xml#vI_notificationbox");
    313313  -moz-box-orient: vertical;
    314314  overflow: hidden;
     
    316316
    317317#vINotification notification {
    318   -moz-binding: url("chrome://v_identity/content/vI_notificationBar.xml#vI_notification");
     318  -moz-binding: url("chrome://v_identity/content/notificationbar/vI_notificationBar.xml#vI_notification");
    319319}
    320320
     
    331331
    332332.identity_clone-menulist {
    333     -moz-binding: url(chrome://v_identity/content/v_identity.xml#fromMenuList_clone);
     333    -moz-binding: url(chrome://v_identity/content/bindings/v_identity.xml#fromMenuList_clone);
    334334    -moz-appearance: textfield;
    335335    margin: 2px 4px;
     
    345345
    346346.description-treecell {
    347     -moz-binding: url("chrome://v_identity/content/v_identity.xml#descriptionTreeCell");
     347    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#descriptionTreeCell");
    348348    color: red;
    349349}
     
    371371
    372372.autoReplyTo {
    373     -moz-binding: url("chrome://v_identity/content/v_identity.xml#autoReplyTo");
     373    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#autoReplyTo");
    374374}
    375375
    376376
    377377.identityDataTooltip {
    378     -moz-binding: url("chrome://v_identity/content/v_identity.xml#vI_identityDataTooltip");
     378    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#vI_identityDataTooltip");
    379379}
    380380
    381381#virtualIdentityExtension_tooltipPopupset {
    382     -moz-binding: url("chrome://v_identity/content/v_identity.xml#vI_tooltipPopupset");
     382    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#vI_tooltipPopupset");
    383383}
    384384
    385385.vI_htmlTextBox {
    386     -moz-binding: url("chrome://v_identity/content/vI_htmlTextBox.xml#vI_htmlTextBox");
     386    -moz-binding: url("chrome://v_identity/content/bindings/vI_htmlTextBox.xml#vI_htmlTextBox");
    387387}
    388388
    389389.vI_remoteBrowserBox {
    390     -moz-binding: url("chrome://v_identity/content/vI_htmlTextBox.xml#vI_remoteBrowserBox");
     390    -moz-binding: url("chrome://v_identity/content/bindings/vI_htmlTextBox.xml#vI_remoteBrowserBox");
    391391    margin: 0;
    392392    -moz-appearance: listbox;
     
    395395
    396396.identity_clone-popup-item {
    397     -moz-binding: url("chrome://v_identity/content/v_identity.xml#fromPopupItem_clone");
     397    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#fromPopupItem_clone");
    398398    padding: 0;
    399399    margin: 0;
     
    401401
    402402.auto-reply-to {
    403     -moz-binding: url("chrome://v_identity/content/v_identity.xml#autoReplyTo");
     403    -moz-binding: url("chrome://v_identity/content/bindings/v_identity.xml#autoReplyTo");
    404404}
    405405
Note: See TracChangeset for help on using the changeset viewer.