Remove Duplicate Messages扩展用于ThunderBird 3的补丁

Thunderbird的发展真是够慢的,去年12月就出了3.0 beta1了,现在才出3.0rc1。这一年间每次新的beta版本出来我多试用,一方面是似乎没觉得有多少吸引人的新功能(未认真发掘?),另一方面是因为lightning 等关键扩展不可用的关系,一直没有正式换用v3版本。

这次3.0rc1出来,加上lightning之后试用,觉得基本上可以了,于是正式切换。

但有一个说小不小说大不大的问题让我不爽: 不能删除重复邮件了。旧的Remove Duplicate Messages扩展在v3上用不起来,新的R-D-M Alternative也完全不能工作(AMO上的评价又都还说不错,奇怪)。

今早上着手来解决这个问题,参照R-D-M Alternative的代码来看哪些地方需要修改。结果是搞定了,不过早上的两个多小时都搭进去了, :-)

 

diff -Ner removeduplicates-nosub/chrome/content/removeduplicates/removeduplicates.js removeduplicates-v3/chrome/content/removeduplicates/removeduplicates.js
507,508c
    /*
    if (msgWindow.SelectFolder) {
       msgWindow.SelectFolder( folderList[0].URI );
    }
    else {
      msgWindow.windowCommands.selectFolder( folderList[0].URI );
    }*/
    var x = gDBView;
.
231c
      if (folder.getMessages) {	  
          folderMessages = folder.getMessages(msgWindow);
      } else {
          folderMessages = folder.messages;
      }      
.
diff -Ner removeduplicates-nosub/chrome/content/removeduplicates/showduplicatemessages.js removeduplicates-v3/chrome/content/removeduplicates/showduplicatemessages.js
508,509c
      }      
      msgWindow.windowCommands.selectMessage(null); //FIXME
.
496c
        msgWindow.SelectMessage( message.folder.getUriForMsg (message) );        
      }
      else {
//      msgWindow.windowCommands.selectFolder( message.folder.URI );
        msgWindow.windowCommands.selectMessage( message.folder.getUriForMsg (message) );                                
      }
.
494a
      if (msgWindow.SelectFolder) {
.
493c
      var message = getMessage ( messageTable[i].messageUri );
.
488c
  //var messageToRemove = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
  var messageToRemove = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
.
329,331c
    if (msgWindow.SelectFolder) {
      msgWindow.SelectFolder( message.folder.URI );
      msgWindow.SelectMessage( message.folder.getUriForMsg (message) );
      msgWindow.SelectMessage( message.folder.getUriForMsg (message) );
    }
    else {
      msgWindow.windowCommands.selectFolder( message.folder.URI );
      msgWindow.windowCommands.selectMessage( message.folder.getUriForMsg (message) );
      msgWindow.windowCommands.selectMessage( message.folder.getUriForMsg (message) );      
    }
.
287c
  if ( messageToRemove.length > 0)
.
282c
        messageToRemove.appendElement ( message, false );
.
278c
          messageToRemove.appendElement ( message, false );
.
274c
      var message = getMessage ( messageTable[i].messageUri );
.
269c

  //var messageToRemove = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
  // nsISupportsArray replaced with nsIArray by Mozilla bug 435290
  var messageToRemove = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
.

 

你可能感兴趣的:(工作,chrome)