mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 04:07:58 +01:00
fixed -- MESSAGE -- focus bug, work around mail.getMessages() bug with try/catch
This commit is contained in:
1
Donators
1
Donators
@@ -2,6 +2,7 @@
|
||||
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
|
||||
|
||||
2008:
|
||||
* Kashyap Paidimarri
|
||||
* Gabriel Gellner
|
||||
* Marco Candrian
|
||||
* Ovidiu Curcan
|
||||
|
||||
@@ -928,8 +928,8 @@ vimperator.Events = function () //{{{
|
||||
if (vimperator.config.name == "Muttator")
|
||||
{
|
||||
// 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 == window.content) || elem instanceof HTMLAnchorElement)
|
||||
if ((win && win.document && win.document instanceof HTMLDocument)
|
||||
|| elem instanceof HTMLAnchorElement)
|
||||
{
|
||||
if (vimperator.mode != vimperator.modes.MESSAGE)
|
||||
vimperator.mode = vimperator.modes.MESSAGE;
|
||||
|
||||
@@ -356,6 +356,7 @@ vimperator.Mail = function ()
|
||||
// first try to find in current folder
|
||||
if (gDBView)
|
||||
{
|
||||
//var curIndex =
|
||||
// FIXME: doesn't work with collapsed threads
|
||||
for (var i = gDBView.selection.currentIndex + (reverse ? -1 : 1);
|
||||
(reverse ? ( i >= 0) : (i < gDBView.rowCount)); reverse ? i-- : i++)
|
||||
@@ -390,10 +391,22 @@ vimperator.Mail = function ()
|
||||
if (folder.isServer)
|
||||
continue;
|
||||
|
||||
|
||||
selectMessageCount = count;
|
||||
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())
|
||||
{
|
||||
var msg = msgs.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
|
||||
|
||||
Reference in New Issue
Block a user