Default Outlook accounts to not save sent mail

See #65
This commit is contained in:
Michael Gratton 2019-02-20 14:06:02 +11:00
parent 5475290272
commit 4d57ab9b62
3 changed files with 13 additions and 25 deletions

View file

@ -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.
*

View file

@ -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) {

View file

@ -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,