зеркало из https://github.com/mozilla/pjs.git
more work on 225158, turn on unsubscribe, sr=sspitzer
This commit is contained in:
Родитель
6863f3c55d
Коммит
9bdf1ae706
|
@ -190,6 +190,7 @@ FeedItem.prototype.isStored = function() {
|
|||
}
|
||||
if (!folder) {
|
||||
debug(this.feed.name + " folder doesn't exist; creating");
|
||||
debug("creating " + this.feed.name + "as child of " + server.rootMsgFolder + "\n");
|
||||
server.rootMsgFolder.createSubfolder(this.feed.name, getMessageWindow());
|
||||
debug(this.identity + " not stored (folder didn't exist)");
|
||||
return false;
|
||||
|
|
|
@ -237,23 +237,14 @@ function getAccount() {
|
|||
if (gFzAccount)
|
||||
return gFzAccount;
|
||||
|
||||
var accounts = accountManager.accounts;
|
||||
accounts = accounts.QueryInterface(Components.interfaces.nsICollection);
|
||||
|
||||
for ( var i=0 ; i<accounts.Count() ; i++ ) {
|
||||
var account = accounts.GetElementAt(i);
|
||||
account = account.QueryInterface(Components.interfaces.nsIMsgAccount);
|
||||
if (account.incomingServer.prettyName == SERVER_NAME) {
|
||||
gFzAccount = account;
|
||||
return gFzAccount;
|
||||
}
|
||||
}
|
||||
|
||||
// If we made it this far there's no "Feeds" account yet, so let's create one.
|
||||
debug("no account; creating one...");
|
||||
gFzAccount = createAccount();
|
||||
|
||||
return gFzAccount;
|
||||
try {
|
||||
gFzAccount = accountManager.FindAccountForServer(getIncomingServer());
|
||||
}
|
||||
catch (ex) {
|
||||
debug("no incoming server or account; creating account...");
|
||||
gFzAccount = createAccount();
|
||||
}
|
||||
return gFzAccount;
|
||||
}
|
||||
|
||||
function createAccount() {
|
||||
|
|
|
@ -47,6 +47,7 @@ function doAdd() {
|
|||
// If we're here, it's probably because the folder doesn't exist yet,
|
||||
// so create it.
|
||||
debug("folder for new feed " + feed.title + " doesn't exist; creating");
|
||||
debug("creating " + feed.name + "as child of " + server.rootMsgFolder + "\n");
|
||||
server.rootMsgFolder.createSubfolder(feed.name, getMessageWindow());
|
||||
folder = server.rootMsgFolder.FindSubFolder(feed.name);
|
||||
var msgdb = folder.getMsgDatabase(null);
|
||||
|
@ -178,20 +179,21 @@ function doRemove() {
|
|||
// XXX Should we check for other feeds using the folder and delete it
|
||||
// if there aren't any? What if the user is using the folder
|
||||
// for other purposes?
|
||||
//var server = getIncomingServer();
|
||||
//var openerResource = server.rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
//var folderResource = server.rootMsgFolder.getChildNamed(title.Value).QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
//var foo = window.opener.messenger.DeleteFolders(window.opener.GetFolderDatasource(), openerResource, folderResource);
|
||||
//try {
|
||||
// // If the folder still exists, then it wasn't deleted,
|
||||
// // which means the user answered "no" to the question of whether
|
||||
// // they wanted to move the folder into the trash. That probably
|
||||
// // means they changed their minds about removing the feed,
|
||||
// // so don't remove it.
|
||||
// folder = server.rootMsgFolder.getChildNamed(feed.name);
|
||||
// if (folder) return;
|
||||
//}
|
||||
//catch (e) {}
|
||||
var server = getIncomingServer();
|
||||
var openerResource = server.rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
var folderResource = server.rootMsgFolder.getChildNamed(title.Value).QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
var foo = window.opener.messenger.DeleteFolders(window.opener.GetFolderDatasource(), openerResource, folderResource);
|
||||
try {
|
||||
// If the folder still exists, then it wasn't deleted,
|
||||
// which means the user answered "no" to the question of whether
|
||||
// they wanted to move the folder into the trash. That probably
|
||||
// means they changed their minds about removing the feed,
|
||||
// so don't remove it.
|
||||
folder = server.rootMsgFolder.getChildNamed(feed.name);
|
||||
if (folder)
|
||||
return;
|
||||
}
|
||||
catch (e) {}
|
||||
ds.Unassert(resource, DC_TITLE, title, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#button-newsandblogs {
|
||||
-moz-box-orient:vertical;
|
||||
/* from http://www.aaa-clipart.com/data/icons/mail/mail1.gif */
|
||||
list-style-image: url("chrome://forumzilla/content/icon.gif");
|
||||
list-style-image: url("chrome://messenger-newsblog/content/icon.gif");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче