|
地板
楼主 |
发表于 2016-3-8 14:25:49
|
只看该作者
- 数据floderID判断是不是特定邮件夹
- const { GlodaDatastore } = Cu.import('resource:///modules/gloda/datastore.js', {})
- const { Gloda } = Cu.import('resource:///modules/gloda/public.js', {})
- exports.getXPCOMFolderFromFolderID = (folderID) => {
- let glodaFolder = GlodaDatastore._mapFolderID(folderID)
- return glodaFolder.getXPCOMFolder()
- }
- exports.isConversationFolder = (folderID) => {
- try {
- let folder = exports.getXPCOMFolderFromFolderID(folderID)
- folder.QueryInterface(Ci.nsIMsgFolder)
- if (folder.isSpecialFolder(Ci.nsMsgFolderFlags.Trash, true)) {
- return false
- }
- if (folder.isSpecialFolder(Ci.nsMsgFolderFlags.Drafts, true)) {
- return false
- }
- } catch (e) {
- console.log(e + e.stack)
- }
- return true
- }
- // 根据邮件夹获取当前账号所有folderID
- function getAccountFolderIDs (folder) {
- let account = folder.server
- let AccountFolderIDs = []
- let allfolders = account.rootFolder.subFolders
- while (allfolders.hasMoreElements()) {
- let folder = allfolders.getNext()
- folder = folder.QueryInterface(Ci.nsIMsgFolder)
- let accountFolderID = getFolderID(folder)
- AccountFolderIDs.push(accountFolderID)
- }
- return AccountFolderIDs
- }
复制代码 |
|