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

[muttator] fixed off-by-one error

This commit is contained in:
Martin Stubenschrott
2008-05-06 15:15:12 +00:00
parent 3fe5216a5d
commit 049780bcb3

View File

@@ -231,6 +231,34 @@ liberator.Mail = function ()
function (count) { liberator.mail.selectMessage(function (msg) { return !msg.isRead; }, true, true, true, count); }, function (count) { liberator.mail.selectMessage(function (msg) { return !msg.isRead; }, true, true, true, count); },
{ flags: liberator.Mappings.flags.COUNT }); { flags: liberator.Mappings.flags.COUNT });
liberator.mappings.add(modes, ["*"],
"Select next message from the same sender",
function (count)
{
try
{
var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
liberator.mail.selectMessage(function(msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, false, count);
}
catch (e) { liberator.beep(); }
},
{ flags: liberator.Mappings.flags.COUNT });
liberator.mappings.add(modes, ["#"],
"Select previous message from the same sender",
function (count)
{
try
{
var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
liberator.mail.selectMessage(function(msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, true, count);
}
catch (e) { liberator.beep(); }
},
{ flags: liberator.Mappings.flags.COUNT });
// SENDING MESSAGES
liberator.mappings.add(modes, ["r"], liberator.mappings.add(modes, ["r"],
"Reply to sender", "Reply to sender",
function () { goDoCommand("cmd_reply"); }); function () { goDoCommand("cmd_reply"); });
@@ -626,7 +654,6 @@ liberator.Mail = function ()
index = (typeof index == "number") ? index : gDBView.selection.currentIndex; index = (typeof index == "number") ? index : gDBView.selection.currentIndex;
return !gDBView.isContainerOpen(index) && !gDBView.isContainerEmpty(index); return !gDBView.isContainerOpen(index) && !gDBView.isContainerEmpty(index);
} }
if (typeof validatorFunc != "function") if (typeof validatorFunc != "function")
return; return;
@@ -688,7 +715,7 @@ liberator.Mail = function ()
var folders = this.getFolders("", true, true); var folders = this.getFolders("", true, true);
var ci = GetFolderTree().currentIndex; var ci = GetFolderTree().currentIndex;
for (var i = 1; i <= folders.length; i++) for (var i = 1; i < folders.length; i++)
{ {
let index = (i + ci) % folders.length; let index = (i + ci) % folders.length;
if (reverse) if (reverse)