[Pkg-mozext-commits] [nostalgy] 198/235: Cleanup.
David Prévot
taffit at alioth.debian.org
Tue Oct 8 20:42:24 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit c310126edd59d28183f0771d8436864547383e5e
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Tue Jun 29 11:39:34 2010 +0000
Cleanup.
git-svn-id: http://nostalgy.googlecode.com/svn/trunk@198 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
content/nostalgy.js | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 5ccc05f..70ec0fa 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -467,18 +467,30 @@ function MailSubject() {
} catch (ex) { return ""; }
}
+function NostalgyCurrentFolder() {
+ try {
+ if (!gDBView) return null;
+ if (gDBView.msgFolder) return gDBView.msgFolder;
+ if (gDBView.hdrForFirstSelectedMessage) return gDBView.hdrForFirstSelectedMessage.folder;
+ } catch (ex) { }
+ NostalgyDebug("Cannot determine current folder");
+ return null;
+}
+
function register_folder(folder) {
// last_folder_author[MailAuthor()] = folder;
// last_folder_subject[MailSubject()] = folder;
- last_folder_server[gDBView.hdrForFirstSelectedMessage.folder] = folder;
- last_folder = folder;
+ var f = NostalgyCurrentFolder();
+ if (f) last_folder_server[f.server.key] = folder;
+ last_folder = folder;
}
function NostalgySuggest() {
var r = null;
if (!gDBView) return;
+ var folder = NostalgyCurrentFolder();
try {
- r = NostalgyRules.apply(MailAuthor(), MailSubject(), MailRecipients(), gDBView.hdrForFirstSelectedMessage.folder);
+ if (folder) r = NostalgyRules.apply(MailAuthor(), MailSubject(), MailRecipients(), folder);
if (r) { return(r); }
} catch (ex) { NostalgyDebug("ex1:" + ex); }
@@ -496,7 +508,7 @@ function NostalgySuggest() {
// if (r) { return(r); }
if (nostalgy_completion_options.restrict_to_current_server) {
- return(last_folder_server[gDBView.hdrForFirstSelectedMessage.folder.server.key]);
+ if (folder) return(last_folder_server[folder.server.key]);
} else {
return(last_folder);
}
@@ -701,7 +713,7 @@ function NostalgySearchSender() {
var input = gEBI("searchInput");
if (!input) { alert("Nostalgy error:\nCannot perform this action when Quick Search is not enabled"); return false; }
try {
- var recips = gDBView.msgFolder.displayRecipients;
+ var recips = NostalgyCurrentFolder().displayRecipients;
var key = "";
try {
key = gDBView.hdrForFirstSelectedMessage.messageKey;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list