[geary/wip/no-drafts-724395: 1/2] Fix support for gmail drafts



commit 1c1970ce1d074ae1ccbd6b944b03c72e0cbd5f4c
Author: Charles Lindsay <chaz yorba org>
Date:   Fri Feb 14 17:44:37 2014 -0800

    Fix support for gmail drafts

 po/POTFILES.in                                     |    1 +
 src/CMakeLists.txt                                 |    1 +
 .../gmail/imap-engine-gmail-account.vala           |    4 ++++
 .../gmail/imap-engine-gmail-drafts-folder.vala     |   17 +++++++++++++++++
 .../gmail/imap-engine-gmail-folder.vala            |    9 ++++++++-
 5 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 361fce6..84db1af 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -188,6 +188,7 @@ src/engine/imap-db/outbox/smtp-outbox-folder-properties.vala
 src/engine/imap-db/outbox/smtp-outbox-folder-root.vala
 src/engine/imap-db/outbox/smtp-outbox-folder.vala
 src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
+src/engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala
 src/engine/imap-engine/gmail/imap-engine-gmail-folder.vala
 src/engine/imap-engine/gmail/imap-engine-gmail-search-folder.vala
 src/engine/imap-engine/imap-engine-account-synchronizer.vala
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b992514..8a8f601 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -189,6 +189,7 @@ engine/imap-engine/imap-engine-replay-operation.vala
 engine/imap-engine/imap-engine-replay-queue.vala
 engine/imap-engine/imap-engine-send-replay-operation.vala
 engine/imap-engine/gmail/imap-engine-gmail-account.vala
+engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala
 engine/imap-engine/gmail/imap-engine-gmail-folder.vala
 engine/imap-engine/gmail/imap-engine-gmail-search-folder.vala
 engine/imap-engine/other/imap-engine-other-account.vala
diff --git a/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala 
b/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
index cf0c3d0..bde3360 100644
--- a/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
+++ b/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
@@ -84,6 +84,10 @@ private class Geary.ImapEngine.GmailAccount : Geary.ImapEngine.GenericAccount {
                 return new MinimalFolder(this, remote_account, local_account, local_folder,
                     special_folder_type);
             
+            case SpecialFolderType.DRAFTS:
+                return new GmailDraftsFolder(this, remote_account, local_account, local_folder,
+                    special_folder_type);
+            
             default:
                 return new GmailFolder(this, remote_account, local_account, local_folder, 
special_folder_type);
         }
diff --git a/src/engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala 
b/src/engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala
new file mode 100644
index 0000000..3516e87
--- /dev/null
+++ b/src/engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+private class Geary.ImapEngine.GmailDraftsFolder : GmailFolder, FolderSupport.Remove {
+    public GmailDraftsFolder(GmailAccount account, Imap.Account remote, ImapDB.Account local,
+        ImapDB.Folder local_folder, SpecialFolderType special_folder_type) {
+        base (account, remote, local, local_folder, special_folder_type);
+    }
+    
+    public async void remove_email_async(Gee.List<Geary.EmailIdentifier> email_ids,
+        Cancellable? cancellable = null) throws Error {
+        yield expunge_email_async(email_ids, cancellable);
+    }
+}
diff --git a/src/engine/imap-engine/gmail/imap-engine-gmail-folder.vala 
b/src/engine/imap-engine/gmail/imap-engine-gmail-folder.vala
index 3151c3b..e8839c0 100644
--- a/src/engine/imap-engine/gmail/imap-engine-gmail-folder.vala
+++ b/src/engine/imap-engine/gmail/imap-engine-gmail-folder.vala
@@ -4,12 +4,19 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
-private class Geary.ImapEngine.GmailFolder : MinimalFolder, FolderSupport.Archive {
+private class Geary.ImapEngine.GmailFolder : MinimalFolder, FolderSupport.Archive,
+    FolderSupport.Create {
     public GmailFolder(GmailAccount account, Imap.Account remote, ImapDB.Account local,
         ImapDB.Folder local_folder, SpecialFolderType special_folder_type) {
         base (account, remote, local, local_folder, special_folder_type);
     }
     
+    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);
+    }
+    
     public async void archive_email_async(Gee.List<Geary.EmailIdentifier> email_ids,
         Cancellable? cancellable = null) throws Error {
         yield expunge_email_async(email_ids, cancellable);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]