[geary/wip/create-folders-713492] Don't support Create from Outlook's drafts folder
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/create-folders-713492] Don't support Create from Outlook's drafts folder
- Date: Tue, 11 Feb 2014 01:57:46 +0000 (UTC)
commit 56bdf14cff9c737a2b62d1bc23695140f7d502b5
Author: Charles Lindsay <chaz yorba org>
Date: Mon Feb 10 17:55:59 2014 -0800
Don't support Create from Outlook's drafts folder
It doesn't support UIDPLUS and hangs for ~10s on expunge, so we can't
delete old versions of drafts. Instead, we just don't allow drafts to
be saved at all.
po/POTFILES.in | 1 +
src/CMakeLists.txt | 1 +
.../imap-engine/imap-engine-generic-folder.vala | 9 ++++++++-
.../imap-engine/imap-engine-minimal-folder.vala | 4 ++--
.../outlook/imap-engine-outlook-account.vala | 6 ++++--
.../outlook/imap-engine-outlook-drafts-folder.vala | 19 +++++++++++++++++++
6 files changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fac9ac9..361fce6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -206,6 +206,7 @@ src/engine/imap-engine/other/imap-engine-other-account.vala
src/engine/imap-engine/other/imap-engine-other-folder.vala
src/engine/imap-engine/outlook/imap-engine-outlook-account.vala
src/engine/imap-engine/outlook/imap-engine-outlook-folder.vala
+src/engine/imap-engine/outlook/imap-engine-outlook-drafts-folder.vala
src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
src/engine/imap-engine/replay-ops/imap-engine-copy-email.vala
src/engine/imap-engine/replay-ops/imap-engine-create-email.vala
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0b44ec8..b992514 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -195,6 +195,7 @@ engine/imap-engine/other/imap-engine-other-account.vala
engine/imap-engine/other/imap-engine-other-folder.vala
engine/imap-engine/outlook/imap-engine-outlook-account.vala
engine/imap-engine/outlook/imap-engine-outlook-folder.vala
+engine/imap-engine/outlook/imap-engine-outlook-drafts-folder.vala
engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
engine/imap-engine/replay-ops/imap-engine-copy-email.vala
engine/imap-engine/replay-ops/imap-engine-create-email.vala
diff --git a/src/engine/imap-engine/imap-engine-generic-folder.vala
b/src/engine/imap-engine/imap-engine-generic-folder.vala
index 25a62b3..b09f034 100644
--- a/src/engine/imap-engine/imap-engine-generic-folder.vala
+++ b/src/engine/imap-engine/imap-engine-generic-folder.vala
@@ -4,7 +4,8 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-private class Geary.ImapEngine.GenericFolder : MinimalFolder, Geary.FolderSupport.Remove {
+private class Geary.ImapEngine.GenericFolder : MinimalFolder, Geary.FolderSupport.Remove,
+ Geary.FolderSupport.Create {
public GenericFolder(GenericAccount account, Imap.Account remote, ImapDB.Account local,
ImapDB.Folder local_folder, SpecialFolderType special_folder_type) {
base (account, remote, local, local_folder, special_folder_type);
@@ -14,5 +15,11 @@ private class Geary.ImapEngine.GenericFolder : MinimalFolder, Geary.FolderSuppor
Cancellable? cancellable = null) throws Error {
yield expunge_email_async(email_ids, cancellable);
}
+
+ public new async Geary.EmailIdentifier? create_email_async(
+ RFC822.Message rfc822, Geary.EmailFlags? flags, DateTime? date_received,
+ Geary.EmailIdentifier? id, Cancellable? cancellable = null) throws Error {
+ return yield base.create_email_async(rfc822, flags, date_received, id, cancellable);
+ }
}
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index aea475b..f1e6297 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -5,7 +5,7 @@
*/
private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.FolderSupport.Copy,
- Geary.FolderSupport.Mark, Geary.FolderSupport.Move, Geary.FolderSupport.Create {
+ Geary.FolderSupport.Mark, Geary.FolderSupport.Move {
private const int FORCE_OPEN_REMOTE_TIMEOUT_SEC = 10;
private const int DEFAULT_REESTABLISH_DELAY_MSEC = 10;
private const int MAX_REESTABLISH_DELAY_MSEC = 1000;
@@ -1252,7 +1252,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.Folde
return earliest_id;
}
- public virtual async Geary.EmailIdentifier? create_email_async(
+ protected async Geary.EmailIdentifier? create_email_async(
RFC822.Message rfc822, Geary.EmailFlags? flags, DateTime? date_received,
Geary.EmailIdentifier? id, Cancellable? cancellable = null) throws Error {
check_open("create_email_async");
diff --git a/src/engine/imap-engine/outlook/imap-engine-outlook-account.vala
b/src/engine/imap-engine/outlook/imap-engine-outlook-account.vala
index 360a0ae..c40d0ea 100644
--- a/src/engine/imap-engine/outlook/imap-engine-outlook-account.vala
+++ b/src/engine/imap-engine/outlook/imap-engine-outlook-account.vala
@@ -46,8 +46,10 @@ private class Geary.ImapEngine.OutlookAccount : Geary.ImapEngine.GenericAccount
else
special_folder_type = local_folder.get_properties().attrs.get_special_folder_type();
- return new OutlookFolder(this, remote_account, local_account, local_folder,
- special_folder_type);
+ if (special_folder_type == Geary.SpecialFolderType.DRAFTS)
+ return new OutlookDraftsFolder(this, remote_account, local_account, local_folder,
special_folder_type);
+
+ return new OutlookFolder(this, remote_account, local_account, local_folder, special_folder_type);
}
}
diff --git a/src/engine/imap-engine/outlook/imap-engine-outlook-drafts-folder.vala
b/src/engine/imap-engine/outlook/imap-engine-outlook-drafts-folder.vala
new file mode 100644
index 0000000..605808d
--- /dev/null
+++ b/src/engine/imap-engine/outlook/imap-engine-outlook-drafts-folder.vala
@@ -0,0 +1,19 @@
+/* Copyright 2014 Yorba Foundation
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+/**
+ * Since Outlook doesn't support UIDPLUS, we can't delete old drafts before
+ * saving a new one. Instead of allowing their drafts folder to fill up with
+ * countless revisions of every message, we simply don't expose the
+ * Geary.FolderSupport.Create interface from the drafts folder, so nothing gets
+ * saved at all.
+ */
+private class Geary.ImapEngine.OutlookDraftsFolder : MinimalFolder {
+ public OutlookDraftsFolder(OutlookAccount account, Imap.Account remote, ImapDB.Account local,
+ ImapDB.Folder local_folder, SpecialFolderType special_folder_type) {
+ base (account, remote, local, local_folder, special_folder_type);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]