Bug 1510571 - clean up some includes of nsMsgMessageFlags.h and use of Ci.nsMsgMessageFlags. r=jorgk

This commit is contained in:
aceman 2019-05-01 19:25:34 +02:00
Родитель 22360aa5a9
Коммит 2e99d5678a
24 изменённых файлов: 28 добавлений и 36 удалений

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

@ -23,7 +23,6 @@ var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
var {IOUtils} = ChromeUtils.import("resource:///modules/IOUtils.js"); var {IOUtils} = ChromeUtils.import("resource:///modules/IOUtils.js");
var statusHeader = "X-Mozilla-Status: "; var statusHeader = "X-Mozilla-Status: ";
var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
var gInbox; var gInbox;
var gOutbox; var gOutbox;
@ -111,7 +110,7 @@ function test_mark_messages_read() {
press_delete(mc); press_delete(mc);
assert_not_equals(curMessage, select_click_row(0)); assert_not_equals(curMessage, select_click_row(0));
check_status(null, offset, statusOffset, check_status(null, offset, statusOffset,
nsMsgMessageFlags.Read + nsMsgMessageFlags.Expunged); Ci.nsMsgMessageFlags.Read + Ci.nsMsgMessageFlags.Expunged);
// 4 messages in the folder. // 4 messages in the folder.
curMessage = select_click_row(0); curMessage = select_click_row(0);
@ -124,16 +123,16 @@ function test_mark_messages_read() {
// All the 4 messages should now be read. // All the 4 messages should now be read.
assert_true(curMessage.isRead, "Message should have been marked Read!"); assert_true(curMessage.isRead, "Message should have been marked Read!");
check_status(curMessage, null, null, nsMsgMessageFlags.Read); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Read);
curMessage = select_click_row(1); curMessage = select_click_row(1);
assert_true(curMessage.isRead, "Message should have been marked Read!"); assert_true(curMessage.isRead, "Message should have been marked Read!");
check_status(curMessage, null, null, nsMsgMessageFlags.Read); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Read);
curMessage = select_click_row(2); curMessage = select_click_row(2);
assert_true(curMessage.isRead, "Message should have been marked Read!"); assert_true(curMessage.isRead, "Message should have been marked Read!");
check_status(curMessage, null, null, nsMsgMessageFlags.Read); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Read);
curMessage = select_click_row(3); curMessage = select_click_row(3);
assert_true(curMessage.isRead, "Message should have been marked Read!"); assert_true(curMessage.isRead, "Message should have been marked Read!");
check_status(curMessage, null, null, nsMsgMessageFlags.Read); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Read);
// Let's have the last message unread. // Let's have the last message unread.
right_click_on_row(3); right_click_on_row(3);
@ -150,7 +149,7 @@ function test_mark_messages_flagged() {
mc.click_menus_in_sequence(mc.e("mailContext"), [{id: "mailContext-mark"}, mc.click_menus_in_sequence(mc.e("mailContext"), [{id: "mailContext-mark"},
{id: "mailContext-markFlagged"}]); {id: "mailContext-markFlagged"}]);
assert_true(curMessage.isFlagged, "Message should have been marked Flagged!"); assert_true(curMessage.isFlagged, "Message should have been marked Flagged!");
check_status(curMessage, null, null, nsMsgMessageFlags.Read + nsMsgMessageFlags.Marked); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Read + Ci.nsMsgMessageFlags.Marked);
} }
function subtest_check_queued_message() { function subtest_check_queued_message() {
@ -160,7 +159,7 @@ function subtest_check_queued_message() {
while (queued.hasMoreElements()) { while (queued.hasMoreElements()) {
let msg = queued.getNext().QueryInterface(Ci.nsIMsgDBHdr); let msg = queued.getNext().QueryInterface(Ci.nsIMsgDBHdr);
if (!queued.hasMoreElements()) { if (!queued.hasMoreElements()) {
check_status(msg, null, null, nsMsgMessageFlags.Queued); check_status(msg, null, null, Ci.nsMsgMessageFlags.Queued);
} }
} }
} }
@ -210,7 +209,7 @@ function test_mark_messages_replied() {
reply_forward_message(2, true); reply_forward_message(2, true);
let curMessage = select_click_row(2); let curMessage = select_click_row(2);
check_status(curMessage, null, null, check_status(curMessage, null, null,
nsMsgMessageFlags.Replied + nsMsgMessageFlags.Read); Ci.nsMsgMessageFlags.Replied + Ci.nsMsgMessageFlags.Read);
} }
function test_mark_messages_forwarded() { function test_mark_messages_forwarded() {
@ -218,14 +217,14 @@ function test_mark_messages_forwarded() {
// Forward a clean message. // Forward a clean message.
reply_forward_message(3, false); reply_forward_message(3, false);
let curMessage = select_click_row(3); let curMessage = select_click_row(3);
check_status(curMessage, null, null, nsMsgMessageFlags.Forwarded); check_status(curMessage, null, null, Ci.nsMsgMessageFlags.Forwarded);
// Forward a message that is read and already replied to. // Forward a message that is read and already replied to.
reply_forward_message(2, false); reply_forward_message(2, false);
curMessage = select_click_row(2); curMessage = select_click_row(2);
check_status(curMessage, null, null, check_status(curMessage, null, null,
nsMsgMessageFlags.Forwarded + nsMsgMessageFlags.Replied + Ci.nsMsgMessageFlags.Forwarded + Ci.nsMsgMessageFlags.Replied +
nsMsgMessageFlags.Read); Ci.nsMsgMessageFlags.Read);
} }
function teardownModule(module) { function teardownModule(module) {

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

@ -54,6 +54,7 @@
#include "nsIMsgAttachment.h" #include "nsIMsgAttachment.h"
#include "nsIMsgProgress.h" #include "nsIMsgProgress.h"
#include "nsMsgFolderFlags.h" #include "nsMsgFolderFlags.h"
#include "nsMsgMessageFlags.h"
#include "nsIMsgDatabase.h" #include "nsIMsgDatabase.h"
#include "nsStringStream.h" #include "nsStringStream.h"
#include "nsIMutableArray.h" #include "nsIMutableArray.h"

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

@ -7,6 +7,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsMsgBaseCID.h" #include "nsMsgBaseCID.h"
#include "nsMsgFolderFlags.h" #include "nsMsgFolderFlags.h"
#include "nsMsgMessageFlags.h"
#include "nsIMsgFolder.h" #include "nsIMsgFolder.h"
#include "nsIMsgAccountManager.h" #include "nsIMsgAccountManager.h"
#include "nsIMsgFolder.h" #include "nsIMsgFolder.h"

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

@ -62,6 +62,7 @@
#include "nsIMsgMessageService.h" #include "nsIMsgMessageService.h"
#include "nsIMsgHdr.h" #include "nsIMsgHdr.h"
#include "nsIMsgFolder.h" #include "nsIMsgFolder.h"
#include "nsMsgMessageFlags.h"
#include "nsComposeStrings.h" #include "nsComposeStrings.h"
#include "nsString.h" #include "nsString.h"
#include "nsMsgUtils.h" #include "nsMsgUtils.h"

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

@ -113,7 +113,6 @@
#include "msgCore.h" #include "msgCore.h"
#include "prprf.h" #include "prprf.h"
#include "nsIOutputStream.h" #include "nsIOutputStream.h"
#include "nsMsgMessageFlags.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsMsgAttachmentHandler.h" #include "nsMsgAttachmentHandler.h"
#include "nsMsgCompFields.h" #include "nsMsgCompFields.h"

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

@ -28,6 +28,7 @@
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsIMsgLocalMailFolder.h" #include "nsIMsgLocalMailFolder.h"
#include "nsIMsgDatabase.h" #include "nsIMsgDatabase.h"
#include "nsMsgMessageFlags.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "nsArrayUtils.h" #include "nsArrayUtils.h"

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

@ -19,10 +19,6 @@ const {Gloda} = ChromeUtils.import("resource:///modules/gloda/gloda.js");
const {TagNoun} = ChromeUtils.import("resource:///modules/gloda/noun_tag.js"); const {TagNoun} = ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
const {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm"); const {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
var nsMsgMessageFlags_Replied = Ci.nsMsgMessageFlags.Replied;
var nsMsgMessageFlags_Forwarded = Ci.nsMsgMessageFlags.Forwarded;
var EXT_BUILTIN = "built-in"; var EXT_BUILTIN = "built-in";
/** /**
@ -140,8 +136,8 @@ var GlodaExplicitAttr = {
aGlodaMessage.read = aMsgHdr.isRead; aGlodaMessage.read = aMsgHdr.isRead;
let flags = aMsgHdr.flags; let flags = aMsgHdr.flags;
aGlodaMessage.repliedTo = Boolean(flags & nsMsgMessageFlags_Replied); aGlodaMessage.repliedTo = Boolean(flags & Ci.nsMsgMessageFlags.Replied);
aGlodaMessage.forwarded = Boolean(flags & nsMsgMessageFlags_Forwarded); aGlodaMessage.forwarded = Boolean(flags & Ci.nsMsgMessageFlags.Forwarded);
let tags = aGlodaMessage.tags = []; let tags = aGlodaMessage.tags = [];

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

@ -8,7 +8,6 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsMsgDatabase.h" #include "nsMsgDatabase.h"
#include "nsMsgMessageFlags.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsIDBChangeListener.h" #include "nsIDBChangeListener.h"

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

@ -8,6 +8,7 @@
#include "msgCore.h" #include "msgCore.h"
#include "nsImapMailDatabase.h" #include "nsImapMailDatabase.h"
#include "nsDBFolderInfo.h" #include "nsDBFolderInfo.h"
#include "nsMsgMessageFlags.h"
const char *kPendingHdrsScope = const char *kPendingHdrsScope =
"ns:msg:db:row:scope:pending:all"; // scope for all offine ops table "ns:msg:db:row:scope:pending:all"; // scope for all offine ops table

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

@ -8,6 +8,7 @@
#include "nsMsgHdr.h" #include "nsMsgHdr.h"
#include "nsMsgDatabase.h" #include "nsMsgDatabase.h"
#include "nsMsgUtils.h" #include "nsMsgUtils.h"
#include "nsMsgMessageFlags.h"
#include "nsIMsgThread.h" #include "nsIMsgThread.h"
#include "nsMsgMimeCID.h" #include "nsMsgMimeCID.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"

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

@ -7,6 +7,7 @@
#include "nsMsgDatabase.h" #include "nsMsgDatabase.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsMsgThread.h" #include "nsMsgThread.h"
#include "nsMsgMessageFlags.h"
#include "nsSimpleEnumerator.h" #include "nsSimpleEnumerator.h"
#include "MailNewsTypes2.h" #include "MailNewsTypes2.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"

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

@ -8,6 +8,7 @@
#include "nsIMsgThread.h" #include "nsIMsgThread.h"
#include "nsNewsDatabase.h" #include "nsNewsDatabase.h"
#include "nsMsgKeySet.h" #include "nsMsgKeySet.h"
#include "nsMsgMessageFlags.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "prlog.h" #include "prlog.h"

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

@ -9,6 +9,7 @@
#include "nsImapOfflineSync.h" #include "nsImapOfflineSync.h"
#include "nsImapMailFolder.h" #include "nsImapMailFolder.h"
#include "nsMsgFolderFlags.h" #include "nsMsgFolderFlags.h"
#include "nsMsgMessageFlags.h"
#include "nsMsgBaseCID.h" #include "nsMsgBaseCID.h"
#include "nsIMsgMailNewsUrl.h" #include "nsIMsgMailNewsUrl.h"
#include "nsIMsgAccountManager.h" #include "nsIMsgAccountManager.h"

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

@ -7,7 +7,6 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "msgCore.h" #include "msgCore.h"
#include "nsImapProtocol.h" #include "nsImapProtocol.h"
#include "nsMsgMessageFlags.h"
struct msgState { struct msgState {
uint32_t uid; uint32_t uid;

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

@ -7,7 +7,6 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "msgCore.h" #include "msgCore.h"
#include "nsImapProtocol.h" #include "nsImapProtocol.h"
#include "nsMsgMessageFlags.h"
// What to check // What to check
enum EHdrArrayCheck enum EHdrArrayCheck

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

@ -40,8 +40,6 @@ var gXGmMsgid2 = "1278455345230334555";
var gXGmThrid2 = "1266894639832287111"; var gXGmThrid2 = "1266894639832287111";
var gXGmLabels2 = '(\"\\\\Sent\")'; var gXGmLabels2 = '(\"\\\\Sent\")';
var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
var fooBox; var fooBox;
var fooFolder; var fooFolder;

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

@ -19,8 +19,6 @@ load("../../../resources/messageInjection.js");
setupIMAPPump(); setupIMAPPump();
var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
var gMsgFile1 = do_get_file("../../../data/bugmail10"); var gMsgFile1 = do_get_file("../../../data/bugmail10");
var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org"; var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";

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

@ -20,8 +20,6 @@ load("../../../resources/messageInjection.js");
var gMessageGenerator = new MessageGenerator(); var gMessageGenerator = new MessageGenerator();
var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator); var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
var gMsgFile1 = do_get_file("../../../data/bugmail10"); var gMsgFile1 = do_get_file("../../../data/bugmail10");
var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org"; var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
var gMsgFile2 = do_get_file("../../../data/image-attach-test"); var gMsgFile2 = do_get_file("../../../data/image-attach-test");
@ -127,7 +125,7 @@ var tests = [
}, },
function* select2ndMsg() { function* select2ndMsg() {
let msg1 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId1); let msg1 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId1);
Assert.notEqual(msg1.flags & nsMsgMessageFlags.Offline, 0); Assert.notEqual(msg1.flags & Ci.nsMsgMessageFlags.Offline, 0);
let db = IMAPPump.inbox.msgDatabase; let db = IMAPPump.inbox.msgDatabase;
let msg2 = db.getMsgHdrForMessageID(gMsgId2); let msg2 = db.getMsgHdrForMessageID(gMsgId2);
let url = new Object; let url = new Object;
@ -141,7 +139,7 @@ var tests = [
}, },
function* select3rdMsg() { function* select3rdMsg() {
let msg2 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId2); let msg2 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId2);
Assert.notEqual(msg2.flags & nsMsgMessageFlags.Offline, 0); Assert.notEqual(msg2.flags & Ci.nsMsgMessageFlags.Offline, 0);
let db = IMAPPump.inbox.msgDatabase; let db = IMAPPump.inbox.msgDatabase;
let msg3 = db.getMsgHdrForMessageID(gMsgId3); let msg3 = db.getMsgHdrForMessageID(gMsgId3);
let url = new Object; let url = new Object;
@ -156,7 +154,7 @@ var tests = [
function verify3rdMsg() { function verify3rdMsg() {
let msg3 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId3); let msg3 = IMAPPump.inbox.msgDatabase.getMsgHdrForMessageID(gMsgId3);
// can't turn this on because our fake server doesn't support body structure. // can't turn this on because our fake server doesn't support body structure.
// do_check_eq(msg3.flags & nsMsgMessageFlags.Offline, 0); // do_check_eq(msg3.flags & Ci.nsMsgMessageFlags.Offline, 0);
}, },
function* addNewMsgs() { function* addNewMsgs() {
let mbox = IMAPPump.daemon.getMailbox("INBOX") let mbox = IMAPPump.daemon.getMailbox("INBOX")

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

@ -16,8 +16,6 @@ var {PromiseTestUtils} = ChromeUtils.import("resource://testing-common/mailnews/
load("../../../resources/logHelper.js"); load("../../../resources/logHelper.js");
var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
var gMsgFile1 = do_get_file("../../../data/bugmail10"); var gMsgFile1 = do_get_file("../../../data/bugmail10");
var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org"; var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
var gMsgFile2 = do_get_file("../../../data/image-attach-test"); var gMsgFile2 = do_get_file("../../../data/image-attach-test");

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

@ -14,7 +14,6 @@
#include "nsIMsgMailNewsUrl.h" #include "nsIMsgMailNewsUrl.h"
#include "nsIMsgFolder.h" #include "nsIMsgFolder.h"
#include "nsICopyMsgStreamListener.h" #include "nsICopyMsgStreamListener.h"
#include "nsMsgMessageFlags.h"
#include "prtime.h" #include "prtime.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/SlicedInputStream.h" #include "mozilla/SlicedInputStream.h"

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

@ -12,6 +12,7 @@
#include "nsMsgBrkMBoxStore.h" #include "nsMsgBrkMBoxStore.h"
#include "nsIMsgFolder.h" #include "nsIMsgFolder.h"
#include "nsMsgFolderFlags.h" #include "nsMsgFolderFlags.h"
#include "nsMsgMessageFlags.h"
#include "nsIMsgLocalMailFolder.h" #include "nsIMsgLocalMailFolder.h"
#include "nsCOMArray.h" #include "nsCOMArray.h"
#include "nsIFile.h" #include "nsIFile.h"

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

@ -16,6 +16,7 @@
#include "nsLocalUtils.h" #include "nsLocalUtils.h"
#include "nsMsgLocalFolderHdrs.h" #include "nsMsgLocalFolderHdrs.h"
#include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later... #include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
#include "nsMsgMessageFlags.h"
#include "nsMailHeaders.h" #include "nsMailHeaders.h"
#include "nsIMsgAccountManager.h" #include "nsIMsgAccountManager.h"
#include "nsIPop3Protocol.h" #include "nsIPop3Protocol.h"

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

@ -10,7 +10,6 @@
#include "plstr.h" #include "plstr.h"
#include "mimebuf.h" #include "mimebuf.h"
#include "mimemoz2.h" #include "mimemoz2.h"
#include "nsMsgMessageFlags.h"
#include "comi18n.h" #include "comi18n.h"
#include "nsMailHeaders.h" #include "nsMailHeaders.h"
#include "msgCore.h" #include "msgCore.h"

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

@ -39,7 +39,7 @@
#include "nsMsgUtils.h" #include "nsMsgUtils.h"
#include "nsMsgDatabase.h" #include "nsMsgDatabase.h"
#include "nsMsgMessageFlags.h"
#include "nsIDBFolderInfo.h" #include "nsIDBFolderInfo.h"
#include "nsNewsUtils.h" #include "nsNewsUtils.h"