Bug 444932 - nsMsgMessageFlags.h should be an idl file, switch over JS uses, r=Standard8, sr=neil

This commit is contained in:
Phil Ringnalda 2009-03-25 08:45:53 -07:00
Родитель d7b968b489
Коммит 380f7f3501
12 изменённых файлов: 42 добавлений и 49 удалений

Просмотреть файл

@ -46,9 +46,6 @@
#
# ***** END LICENSE BLOCK *****
const MSG_FLAG_READ = 0x000001;
const MSG_FLAG_HAS_RE = 0x000010;
const MSG_FLAG_IMAP_DELETED = 0x200000;
const ADDR_DB_LARGE_COMMIT = 1;
const kClassicMailLayout = 0;
@ -685,7 +682,7 @@ function populateHistoryMenu(menuPopup, isBackMenu)
menuText = folder.prettyName + " - ";
var subject = "";
if(msgHdr.flags & MSG_FLAG_HAS_RE)
if (msgHdr.flags & Components.interfaces.nsMsgMessageFlags.HasRe)
subject = "Re: ";
if (msgHdr.mime2DecodedSubject)
subject += msgHdr.mime2DecodedSubject;
@ -775,7 +772,8 @@ function UpdateDeleteCommand()
function SelectedMessagesAreDeleted()
{
return gDBView && gDBView.numSelected &&
(gDBView.hdrForFirstSelectedMessage.flags & MSG_FLAG_IMAP_DELETED);
(gDBView.hdrForFirstSelectedMessage.flags &
Components.interfaces.nsMsgMessageFlags.IMAPDeleted);
}
function SelectedMessagesAreJunk()
@ -1453,7 +1451,7 @@ let mailTabType = {
aTab.hdr = aMsgHdr;
aTab.title = "";
if(aTab.hdr.flags & MSG_FLAG_HAS_RE)
if (aTab.hdr.flags & Components.interfaces.nsMsgMessageFlags.HasRe)
aTab.title = "Re: ";
if (aTab.hdr.mime2DecodedSubject)
aTab.title += aTab.hdr.mime2DecodedSubject;
@ -2846,9 +2844,9 @@ function HandleMDNResponse(aUrl)
// After a msg is downloaded it's already marked READ at this point so we must check if
// the msg has a "Disposition-Notification-To" header and no MDN report has been sent yet.
const MSG_FLAG_MDN_REPORT_SENT = 0x800000;
var msgFlags = msgHdr.flags;
if ((msgFlags & MSG_FLAG_IMAP_DELETED) || (msgFlags & MSG_FLAG_MDN_REPORT_SENT))
if ((msgFlags & Components.interfaces.nsMsgMessageFlags.IMAPDeleted) ||
(msgFlags & Components.interfaces.nsMsgMessageFlags.MDNReportSent))
return;
var DNTHeader = mimeHdr.extractHeader("Disposition-Notification-To", false);
@ -2864,9 +2862,9 @@ function HandleMDNResponse(aUrl)
msgHdr.messageKey, mimeHdr, false);
// Reset mark msg MDN "Sent" and "Not Needed".
const MSG_FLAG_MDN_REPORT_NEEDED = 0x400000;
msgHdr.flags = (msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
msgHdr.OrFlags(MSG_FLAG_MDN_REPORT_SENT);
msgHdr.flags = (msgFlags &
~Components.interfaces.nsMsgMessageFlags.MDNReportNeeded);
msgHdr.OrFlags(Components.interfaces.nsMsgMessageFlags.MDNReportSent);
// Commit db changes.
var msgdb = msgFolder.msgDatabase;

Просмотреть файл

@ -519,10 +519,10 @@ var messageHeaderSink = {
}
currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, isExternalAttachment));
// if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr
// this will cause the "message with attachment" icon to show up
// in the thread pane
// we only need to do this on the first attachment
// If we have an attachment, set the nsMsgMessageFlags.Attachment flag
// on the hdr to cause the "message with attachment" icon to show up
// in the thread pane.
// We only need to do this on the first attachment.
var numAttachments = currentAttachments.length;
if (numAttachments == 1) {
// we also have to enable the File/Attachments menuitem

Просмотреть файл

@ -305,7 +305,8 @@ var folderListener = {
{
var hdrs = hdrParser.headers;
if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
msgHdr.OrFlags(0x10000000); // 0x10000000 is MSG_FLAG_ATTACHMENT
msgHdr.OrFlags(Components.interfaces.nsMsgMessageFlags
.Attachment);
}
if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
msgHdr.setStringProperty("imageSize", "1");

Просмотреть файл

@ -41,7 +41,6 @@
var EXPORTED_SYMBOLS = ["SearchIntegration"];
const MSG_DB_LARGE_COMMIT = 1;
const MSG_FLAG_ATTACHMENT = 0x10000000;
const CRLF="\r\n";
/**

Просмотреть файл

@ -47,11 +47,6 @@
* ***** END LICENSE BLOCK ***** */
// Flags from nsMsgMessageFlags.h
const MSG_FLAG_READ = 0x000001;
const MSG_FLAG_HAS_RE = 0x000010;
const MSG_FLAG_IMAP_DELETED = 0x200000;
const MSG_FLAG_MDN_REPORT_NEEDED = 0x400000;
const MSG_FLAG_MDN_REPORT_SENT = 0x800000;
const MDN_DISPOSE_TYPE_DISPLAYED = 0;
const MSG_DB_LARGE_COMMIT = 1;
@ -709,7 +704,7 @@ function PopulateHistoryMenu(menuPopup, navOffset)
var msgHdr = messenger.msgHdrFromURI(historyArray[i * 2]);
var subject = "";
if (msgHdr.flags & MSG_FLAG_HAS_RE)
if (msgHdr.flags & Components.interfaces.nsMsgMessageFlags.HasRe)
subject = "Re: ";
if (msgHdr.mime2DecodedSubject)
subject += msgHdr.mime2DecodedSubject;
@ -782,12 +777,9 @@ function UpdateDeleteCommand()
function SelectedMessagesAreDeleted()
{
try {
return gDBView.hdrForFirstSelectedMessage.flags & MSG_FLAG_IMAP_DELETED;
}
catch (ex) {
return 0;
}
return gDBView && gDBView.numSelected &&
(gDBView.hdrForFirstSelectedMessage.flags &
Components.interfaces.nsMsgMessageFlags.IMAPDeleted);
}
function SelectedMessagesAreJunk()
@ -2590,7 +2582,8 @@ function HandleMDNResponse(aUrl)
// After a msg is downloaded it's already marked READ at this point so we must check if
// the msg has a "Disposition-Notification-To" header and no MDN report has been sent yet.
var msgFlags = msgHdr.flags;
if ((msgFlags & MSG_FLAG_IMAP_DELETED) || (msgFlags & MSG_FLAG_MDN_REPORT_SENT))
if ((msgFlags & Components.interfaces.nsMsgMessageFlags.IMAPDeleted) ||
(msgFlags & Components.interfaces.nsMsgMessageFlags.MDNReportSent))
return;
var DNTHeader = mimeHdr.extractHeader("Disposition-Notification-To", false);
@ -2604,8 +2597,9 @@ function HandleMDNResponse(aUrl)
mdnGenerator.process(MDN_DISPOSE_TYPE_DISPLAYED, msgWindow, msgFolder, msgHdr.messageKey, mimeHdr, false);
// Reset mark msg MDN "Sent" and "Not Needed".
msgHdr.flags = (msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
msgHdr.OrFlags(MSG_FLAG_MDN_REPORT_SENT);
msgHdr.flags = (msgFlags &
~Components.interfaces.nsMsgMessageFlags.MDNReportNeeded);
msgHdr.OrFlags(Components.interfaces.nsMsgMessageFlags.MDNReportSent);
// Commit db changes.
var msgdb = msgFolder.msgDatabase;

Просмотреть файл

@ -483,10 +483,10 @@ var messageHeaderSink = {
}
currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, isExternalAttachment));
// if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr
// this will cause the "message with attachment" icon to show up
// in the thread pane
// we only need to do this on the first attachment
// If we have an attachment, set the nsMsgMessageFlags.Attachment flag
// on the hdr to cause the "message with attachment" icon to show up
// in the thread pane.
// We only need to do this on the first attachment.
var numAttachments = currentAttachments.length;
if (numAttachments == 1) {
// we also have to enable the Message/Attachments menuitem

Просмотреть файл

@ -289,7 +289,8 @@ var folderListener = {
{
var hdrs = hdrParser.headers;
if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
msgHdr.OrFlags(0x10000000); // 0x10000000 is MSG_FLAG_ATTACHMENT
msgHdr.OrFlags(Components.interfaces.nsMsgMessageFlags
.Attachment);
}
if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
msgHdr.setStringProperty("imageSize", "1");

Просмотреть файл

@ -208,7 +208,7 @@ function TestSearchx(aFolder, aValue, aAttrib, aOp, aHitCount, onDone)
else if (aAttrib == Ci.nsMsgSearchAttrib.JunkStatus)
value.junkStatus = aValue;
else if (aAttrib == Ci.nsMsgSearchAttrib.HasAttachmentStatus)
value.status = 0x10000000; // 0x10000000 is MSG_FLAG_ATTACHMENT
value.status = Ci.nsMsgMessageFlags.Attachment;
else
value.str = aValue;
searchTerm.value = value;

Просмотреть файл

@ -158,9 +158,6 @@ function MakeCleanMsgHdrCallback(aMsgHdr, aGlodaMessageID) {
};
}
const MSG_FLAG_OFFLINE = 0x80;
const MSG_FLAG_EXPUNGED = 0x08;
/**
* @class Capture the indexing batch concept explicitly.
*
@ -1632,8 +1629,9 @@ var GlodaIndexer = {
yield this.kWorkSync;
}
if ((isLocal || (msgHdr.flags & MSG_FLAG_OFFLINE)) &&
!(msgHdr.flags & MSG_FLAG_EXPUNGED)) {
if ((isLocal ||
(msgHdr.flags & Components.interfaces.nsMsgMessageFlags.Offline)) &&
!(msgHdr.flags & Components.interfaces.nsMsgMessageFlags.Expunged)) {
// this returns 0 when missing
let glodaMessageId = msgHdr.getUint32Property(
this.GLODA_MESSAGE_ID_PROPERTY);
@ -1703,8 +1701,9 @@ var GlodaIndexer = {
// it needs a header, the header needs to not be expunged, plus, the
// message needs to be considered offline.
if (msgHdr &&
!(msgHdr.flags&MSG_FLAG_EXPUNGED) &&
(folderIsLocal || (msgHdr.flags & MSG_FLAG_OFFLINE)))
!(msgHdr.flags & Components.interfaces.nsMsgMessageFlags.Expunged) &&
(folderIsLocal ||
(msgHdr.flags & Components.interfaces.nsMsgMessageFlags.Offline)))
yield this._callbackHandle.pushAndGo(this._indexMessage(msgHdr,
this._callbackHandle));
else

Просмотреть файл

@ -41,7 +41,6 @@ const MINUTES_TO_SECONDS = 60;
const SECONDS_TO_MILLISECONDS = 1000;
const MINUTES_TO_MILLISECONDS = MINUTES_TO_SECONDS * SECONDS_TO_MILLISECONDS;
const HOURS_TO_MILLISECONDS = HOURS_TO_MINUTES * MINUTES_TO_MILLISECONDS;
const MSG_FLAG_NEW = 0x10000;
const ENCLOSURE_BOUNDARY_PREFIX = "--------------"; // 14 dashes
const ENCLOSURE_HEADER_BOUNDARY_PREFIX = "------------"; // 12 dashes

Просмотреть файл

@ -132,13 +132,15 @@ var actionResults = {
// "2@regular.invalid" should not be in database
"3@regular.invalid" : function (header, folder) {
var flags = folder.msgDatabase.GetThreadContainingMsgHdr(header).flags;
var ignored = Ci.nsMsgMessageFlags.Ignored;
// This is checking the thread's kill flag
return (flags & 0x40000) == 0x40000;
return (flags & ignored) == ignored;
},
"4@regular.invalid" : function (header, folder) {
var flags = folder.msgDatabase.GetThreadContainingMsgHdr(header).flags;
var watched = Ci.nsMsgMessageFlags.Watched;
// This is checking the thread's watch flag
return (flags & 0x100) == 0x100;
return (flags & watched) == watched;
},
"5@regular.invalid" : ["isFlagged", true],
"6.odd@regular.invalid" : ["isRead", false],

Просмотреть файл

@ -102,7 +102,7 @@ function TestSearch(aFolder, aValue, aAttrib, aOp, aHitCount, onDone)
else if (aAttrib == Ci.nsMsgSearchAttrib.JunkStatus)
value.junkStatus = aValue;
else if (aAttrib == Ci.nsMsgSearchAttrib.HasAttachmentStatus)
value.status = 0x10000000; // 0x10000000 is MSG_FLAG_ATTACHMENT
value.status = Ci.nsMsgMessageFlags.Attachment;
else
value.str = aValue;
searchTerm.value = value;