firemail
标题:
folder database hd等相关关系
[打印本页]
作者:
hechengjin
时间:
2015-11-12 23:24
标题:
folder database hd等相关关系
emptyJunk: function ftc_emptyJunk(aFolder) {
const Ci = Components.interfaces;
let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
if (!folder || !folder.getFlag(nsMsgFolderFlags.Junk))
return;
if (!this._checkConfirmationPrompt("emptyJunk", folder))
return;
// Delete any subfolders this folder might have
let iter = folder.subFolders;
while (iter.hasMoreElements())
folder.propagateDelete(iter.getNext(), true, msgWindow);
// Now delete the messages
iter = fixIterator(folder.messages);
let messages = [m for (m in iter)];
let children = toXPCOMArray(messages, Ci.nsIMutableArray);
folder.deleteMessages(children, msgWindow, true, false, null, false);
},
复制代码
作者:
hechengjin
时间:
2015-12-31 14:22
/*
let accountManager = Cc["@mozilla.org/messenger/account-manager;1"]
.getService(Ci.nsIMsgAccountManager);
let accounts = accountManager.accounts;
console.log("accounts.length:" + accounts.length);
for (let i = 0; i < accounts.length; i++) {
let account = accounts.queryElementAt(i, Ci.nsIMsgAccount);
let allfolders = account.incomingServer.rootFolder.subFolders;
while(allfolders.hasMoreElements())
{
let folder = allfolders.getNext();
folder = folder.QueryInterface(Ci.nsIMsgFolder);
console.log(folder.folderURL)
let folderMsgHdrs = [];
let enumerator = folder.msgDatabase.EnumerateMessages();
while (enumerator.hasMoreElements())
{
let hdr = enumerator.getNext();
folderMsgHdrs.push(hdr);
}
//console.log("folderMsgHdrs.length:"+folderMsgHdrs.length)
if( folderMsgHdrs.length > 0 ){
let array = toXPCOMArray(folderMsgHdrs, Ci.nsIMutableArray);
//这种删除方法也没把数据库里的给删除
//folder.deleteMessages(array, null,
// true, // delete storage
// false,//is move?
// null, //asyncCopyListener
// false // do not allow undo, currently leaks
// );
//Gloda.msgsDeleted(folderMsgHdrs);
//GlodaDatastore.markMessagesDeletedByIDs(folderMsgHdrs);
//for( let itemhdr of folderMsgHdrs ){
// yield* deleteMsgIndexerByHeader(itemhdr);
//}
}
}
}
*/
/*
let accountManager = Cc["@mozilla.org/messenger/account-manager;1"]
.getService(Ci.nsIMsgAccountManager);
let accounts = accountManager.accounts;
console.log("accounts.length:" + accounts.length);
for (let i = 0; i < accounts.length; i++) {
let account = accounts.queryElementAt(i, Ci.nsIMsgAccount);
MailServices.accounts.removeAccount(account); //数据库中依然存在
}
*/
复制代码
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3