parent
5475290272
commit
4d57ab9b62
3 changed files with 13 additions and 25 deletions
|
|
@ -127,18 +127,18 @@ public class Geary.AccountInformation : BaseObject {
|
|||
get; set; default = DEFAULT_PREFETCH_PERIOD_DAYS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies if the user has requested that sent mail be saved.
|
||||
*
|
||||
* Note that Geary will only actively push sent mail when this AND
|
||||
* {@link allow_save_sent} are both true.
|
||||
*/
|
||||
/** Specifies if sent email should be saved to the Sent folder. */
|
||||
public bool save_sent {
|
||||
// If we aren't allowed to save sent mail due to account type, we want
|
||||
// to return true here on the assumption that the account will save
|
||||
// sent mail for us, and thus the user can't disable sent mail from
|
||||
// being saved.
|
||||
get { return (allow_save_sent() ? this._save_sent : true); }
|
||||
get {
|
||||
bool save = _save_sent;
|
||||
switch (this.service_provider) {
|
||||
case GMAIL:
|
||||
case OUTLOOK:
|
||||
save = false;
|
||||
break;
|
||||
}
|
||||
return save;
|
||||
}
|
||||
set { this._save_sent = value; }
|
||||
}
|
||||
private bool _save_sent = true;
|
||||
|
|
@ -355,18 +355,6 @@ public class Geary.AccountInformation : BaseObject {
|
|||
return removed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if {@link save_sent} property can be set.
|
||||
*
|
||||
* If not, that property will always be true and setting it will
|
||||
* be ignored.
|
||||
*/
|
||||
public bool allow_save_sent() {
|
||||
// We should never push mail to Gmail, since its servers
|
||||
// automatically push sent mail to the sent mail folder.
|
||||
return this.service_provider != ServiceProvider.GMAIL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configured path for a special folder type.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ private class Geary.ImapEngine.OutlookAccount : Geary.ImapEngine.GenericAccount
|
|||
|
||||
|
||||
public static void setup_account(AccountInformation account) {
|
||||
// noop
|
||||
account.save_sent = false;
|
||||
}
|
||||
|
||||
public static void setup_service(ServiceInformation service) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Geary.AccountInformationTest : TestCase {
|
|||
new RFC822.MailboxAddress(null, "test1@example.com")
|
||||
).save_sent
|
||||
);
|
||||
assert_true(
|
||||
assert_false(
|
||||
new AccountInformation(
|
||||
"test",
|
||||
ServiceProvider.OUTLOOK,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue