1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:28:01 +01:00

fixed -- MESSAGE -- focus bug, work around mail.getMessages() bug with try/catch

This commit is contained in:
Martin Stubenschrott
2008-03-05 13:03:28 +00:00
parent bc5efdab0d
commit 72f274c7c6
3 changed files with 17 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me. <b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
2008: 2008:
* Kashyap Paidimarri
* Gabriel Gellner * Gabriel Gellner
* Marco Candrian * Marco Candrian
* Ovidiu Curcan * Ovidiu Curcan

View File

@@ -928,8 +928,8 @@ vimperator.Events = function () //{{{
if (vimperator.config.name == "Muttator") if (vimperator.config.name == "Muttator")
{ {
// we switch to -- MESSAGE -- mode for muttator, when the main HTML widget gets focus // we switch to -- MESSAGE -- mode for muttator, when the main HTML widget gets focus
//if ((win && win.document && win.document instanceof HTMLDocument) || if ((win && win.document && win.document instanceof HTMLDocument)
if ((win && win == window.content) || elem instanceof HTMLAnchorElement) || elem instanceof HTMLAnchorElement)
{ {
if (vimperator.mode != vimperator.modes.MESSAGE) if (vimperator.mode != vimperator.modes.MESSAGE)
vimperator.mode = vimperator.modes.MESSAGE; vimperator.mode = vimperator.modes.MESSAGE;

View File

@@ -356,6 +356,7 @@ vimperator.Mail = function ()
// first try to find in current folder // first try to find in current folder
if (gDBView) if (gDBView)
{ {
//var curIndex =
// FIXME: doesn't work with collapsed threads // FIXME: doesn't work with collapsed threads
for (var i = gDBView.selection.currentIndex + (reverse ? -1 : 1); for (var i = gDBView.selection.currentIndex + (reverse ? -1 : 1);
(reverse ? ( i >= 0) : (i < gDBView.rowCount)); reverse ? i-- : i++) (reverse ? ( i >= 0) : (i < gDBView.rowCount)); reverse ? i-- : i++)
@@ -390,10 +391,22 @@ vimperator.Mail = function ()
if (folder.isServer) if (folder.isServer)
continue; continue;
selectMessageCount = count; selectMessageCount = count;
selectMessageKeys = []; selectMessageKeys = [];
var msgs = folder.getMessages(msgWindow); // sometimes folder.getMessages can fail with an exception
// TODO: find out why, and solve the problem
try
{
var msgs = folder.getMessages(msgWindow);
}
catch (e)
{
dump("ERROR: " + folder.prettyName + " failed to getMessages\n");
continue;
}
while (msgs.hasMoreElements()) while (msgs.hasMoreElements())
{ {
var msg = msgs.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr); var msg = msgs.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);