[geary] Change Geary.Folder and Geary.Account to abstract classes



commit a3fb0a364a2682f475b84a60c60814e21ad7114b
Author: Jim Nelson <jim yorba org>
Date:   Fri Jan 9 17:50:19 2015 -0800

    Change Geary.Folder and Geary.Account to abstract classes
    
    Since the dawn of time, Folder and Account were interfaces.  It's
    become obvious over time nothing was gained by making them interfaces,
    only a duplication of effort when changing their API to update the
    interface and then the abstract base class all other classes derive
    from.
    
    This makes both abstract classes, cleaning up the code a bit and
    reducing complexity.

 src/CMakeLists.txt                                 |    4 +-
 src/engine/abstract/geary-abstract-account.vala    |  138 -----------------
 src/engine/abstract/geary-abstract-folder.vala     |  122 ---------------
 .../geary-abstract-local-folder.vala               |    8 +-
 src/engine/api/geary-account.vala                  |  158 +++++++++++---------
 src/engine/api/geary-engine.vala                   |   11 ++
 src/engine/api/geary-folder.vala                   |  104 +++++++++++---
 .../imap-engine/imap-engine-generic-account.vala   |    2 +-
 .../imap-engine/imap-engine-minimal-folder.vala    |   32 ++++-
 .../imap-engine-abstract-list-email.vala           |    4 +-
 .../replay-ops/imap-engine-fetch-email.vala        |    4 +-
 .../replay-ops/imap-engine-mark-email.vala         |    2 +-
 .../replay-ops/imap-engine-move-email.vala         |    8 +-
 .../replay-ops/imap-engine-remove-email.vala       |    8 +-
 14 files changed, 234 insertions(+), 371 deletions(-)
---
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 64fb8d6..b0db690 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,10 +2,8 @@
 # Copyright 2011-2014 Yorba Foundation
 
 set(ENGINE_SRC
-engine/abstract/geary-abstract-account.vala
-engine/abstract/geary-abstract-folder.vala
-engine/abstract/geary-abstract-local-folder.vala
 
+engine/api/geary-abstract-local-folder.vala
 engine/api/geary-account.vala
 engine/api/geary-account-information.vala
 engine/api/geary-aggregated-folder-properties.vala
diff --git a/src/engine/abstract/geary-abstract-local-folder.vala 
b/src/engine/api/geary-abstract-local-folder.vala
similarity index 82%
rename from src/engine/abstract/geary-abstract-local-folder.vala
rename to src/engine/api/geary-abstract-local-folder.vala
index bbc64c9..f78dcab 100644
--- a/src/engine/abstract/geary-abstract-local-folder.vala
+++ b/src/engine/api/geary-abstract-local-folder.vala
@@ -7,11 +7,13 @@
 /**
  * Handles open/close for local folders.
  */
-public abstract class Geary.AbstractLocalFolder : Geary.AbstractFolder {
+public abstract class Geary.AbstractLocalFolder : Geary.Folder {
     private int open_count = 0;
     
-    public AbstractLocalFolder() {
-        opening_monitor = new Geary.SimpleProgressMonitor(Geary.ProgressType.ACTIVITY);
+    private ProgressMonitor _opening_monitor = new 
Geary.ReentrantProgressMonitor(Geary.ProgressType.ACTIVITY);
+    public override Geary.ProgressMonitor opening_monitor { get { return _opening_monitor; } }
+    
+    protected AbstractLocalFolder() {
     }
     
     public override Geary.Folder.OpenState get_open_state() {
diff --git a/src/engine/api/geary-account.vala b/src/engine/api/geary-account.vala
index 152508e..41d1b1a 100644
--- a/src/engine/api/geary-account.vala
+++ b/src/engine/api/geary-account.vala
@@ -4,7 +4,23 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
-public interface Geary.Account : BaseObject {
+/**
+ * Account is the basic interface to the user's email account, { link Folder}s, and various signals,
+ * monitors, and notifications of account activity.
+ *
+ * In addition to providing an interface to the various Folders, Account offers aggregation signals
+ * indicating changes to all Folders as they're discovered.  Because some mail interfaces don't
+ * provide account-wide notification, these signals may only be fired when the Folder is open,
+ * which sometimes happens in the background as background synchronization occurs.
+ *
+ * Accounts must be opened and closed with { link open_async} and { link close_async}.  Most
+ * methods only work if the Account is opened (if not, that will be mentioned in their
+ * documentation).
+ *
+ * A list of all Accounts may be retrieved from the { link Engine} singleton.
+ */
+
+public abstract class Geary.Account : BaseObject {
     public enum Problem {
         RECV_EMAIL_LOGIN_FAILED,
         SEND_EMAIL_LOGIN_FAILED,
@@ -15,13 +31,13 @@ public interface Geary.Account : BaseObject {
         SAVE_SENT_MAIL_FAILED,
     }
     
-    public abstract Geary.AccountInformation information { get; protected set; }
+    public Geary.AccountInformation information { get; protected set; }
     
-    public abstract Geary.ProgressMonitor search_upgrade_monitor { get; protected set; }
-    public abstract Geary.ProgressMonitor db_upgrade_monitor { get; protected set; }
-    public abstract Geary.ProgressMonitor db_vacuum_monitor { get; protected set; }
-    public abstract Geary.ProgressMonitor opening_monitor { get; protected set; }
-    public abstract Geary.ProgressMonitor sending_monitor { get; protected set; }
+    public Geary.ProgressMonitor search_upgrade_monitor { get; protected set; }
+    public Geary.ProgressMonitor db_upgrade_monitor { get; protected set; }
+    public Geary.ProgressMonitor db_vacuum_monitor { get; protected set; }
+    public Geary.ProgressMonitor opening_monitor { get; protected set; }
+    public Geary.ProgressMonitor sending_monitor { get; protected set; }
     
     /**
      * HACK: for now, only certain account types support folders with
@@ -29,7 +45,7 @@ public interface Geary.Account : BaseObject {
      * archive because the button is hidden for accounts that will never
      * support it.
      */
-    public abstract bool can_support_archive { get; protected set; }
+    public bool can_support_archive { get; protected set; }
     
     public signal void opened();
     
@@ -108,75 +124,70 @@ public interface Geary.Account : BaseObject {
     public signal void email_flags_changed(Geary.Folder folder,
         Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags> map);
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_opened();
+    private string name;
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_closed();
+    protected Account(string name, AccountInformation information, bool can_support_archive) {
+        this.name = name;
+        this.information = information;
+        this.can_support_archive = can_support_archive;
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_sent(Geary.RFC822.Message rfc822);
+    protected virtual void notify_folders_available_unavailable(Gee.List<Geary.Folder>? available,
+        Gee.List<Geary.Folder>? unavailable) {
+        folders_available_unavailable(available, unavailable);
+    }
+
+    protected virtual void notify_folders_added_removed(Gee.List<Geary.Folder>? added,
+        Gee.List<Geary.Folder>? removed) {
+        folders_added_removed(added, removed);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_report_problem(Geary.Account.Problem problem, Error? err);
+    protected virtual void notify_folders_contents_altered(Gee.Collection<Geary.Folder> altered) {
+        folders_contents_altered(altered);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_folders_available_unavailable(Gee.List<Geary.Folder>? available,
-        Gee.List<Geary.Folder>? unavailable);
+    protected virtual void notify_email_appended(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids) {
+        email_appended(folder, ids);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_folders_added_removed(Gee.List<Geary.Folder>? added,
-        Gee.List<Geary.Folder>? removed);
+    protected virtual void notify_email_inserted(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids) {
+        email_inserted(folder, ids);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_folders_contents_altered(Gee.Collection<Geary.Folder> altered);
+    protected virtual void notify_email_removed(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids) {
+        email_removed(folder, ids);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_appended(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids);
+    protected virtual void notify_email_locally_complete(Geary.Folder folder,
+        Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_locally_complete(folder, ids);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_inserted(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids);
+    protected virtual void notify_email_discovered(Geary.Folder folder,
+        Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_discovered(folder, ids);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_removed(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> 
ids);
+    protected virtual void notify_email_flags_changed(Geary.Folder folder,
+        Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags> flag_map) {
+        email_flags_changed(folder, flag_map);
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_locally_complete(Geary.Folder folder,
-        Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_opened() {
+        opened();
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_discovered(Geary.Folder folder,
-        Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_closed() {
+        closed();
+    }
     
-    /**
-     * Signal notification method for subclasses to use.
-     */
-    protected abstract void notify_email_flags_changed(Geary.Folder folder,
-        Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags> flag_map);
+    protected virtual void notify_email_sent(RFC822.Message message) {
+        email_sent(message);
+    }
+    
+    protected virtual void notify_report_problem(Geary.Account.Problem problem, Error? err) {
+        report_problem(problem, err);
+    }
     
     /**
      * A utility method to sort a Gee.Collection of { link Folder}s by their { link FolderPath}s
@@ -205,7 +216,11 @@ public interface Geary.Account : BaseObject {
     public abstract async void open_async(Cancellable? cancellable = null) throws Error;
     
     /**
+     * Closes the { link Account}, which makes most its operations unavailable.
+     *
+     * This does not delete the Account, merely closes database and network channels.
      *
+     * Returns without error if the Account is already closed.
      */
     public abstract async void close_async(Cancellable? cancellable = null) throws Error;
     
@@ -240,8 +255,8 @@ public interface Geary.Account : BaseObject {
      * Folders.  This is important when thinking of opening and closing folders and signal
      * notifications.
      */
-    public abstract Gee.Collection<Geary.Folder> list_matching_folders(
-        Geary.FolderPath? parent) throws Error;
+    public abstract Gee.Collection<Geary.Folder> list_matching_folders(Geary.FolderPath? parent)
+        throws Error;
     
     /**
      * Lists all currently-available folders.  See caveats under
@@ -278,7 +293,10 @@ public interface Geary.Account : BaseObject {
      * Returns the folder representing the given special folder type.  If no such folder exists,
      * null is returned.
      */
-    public abstract Geary.Folder? get_special_folder(Geary.SpecialFolderType special) throws Error;
+    public virtual Geary.Folder? get_special_folder(Geary.SpecialFolderType special) throws Error {
+        return traverse<Folder>(list_folders())
+            .first_matching(f => f.special_folder_type == special);
+    }
     
     /**
      * Returns the Folder object with the given special folder type.  The folder will be
@@ -371,6 +389,8 @@ public interface Geary.Account : BaseObject {
     /**
      * Used only for debugging.  Should not be used for user-visible strings.
      */
-    public abstract string to_string();
+    public virtual string to_string() {
+        return name;
+    }
 }
 
diff --git a/src/engine/api/geary-engine.vala b/src/engine/api/geary-engine.vala
index 58ce176..ae807e9 100644
--- a/src/engine/api/geary-engine.vala
+++ b/src/engine/api/geary-engine.vala
@@ -4,6 +4,17 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
+/**
+ * The Geary email engine initial entry points.
+ *
+ * Engine represents and contains interfaces into the rest of the email library.  It's a singleton
+ * class (see { link instance}) with various signals for event notification.  Engine is initialized
+ * by calling { link open_async} and closed with { link close_async}.
+ *
+ * Engine can list existing { link Account} objects and create/delete them.  It can also validate
+ * changes to Accounts prior to saving those changes.
+ */
+
 public class Geary.Engine : BaseObject {
     [Flags]
     public enum ValidationOption {
diff --git a/src/engine/api/geary-folder.vala b/src/engine/api/geary-folder.vala
index 69c6d30..bf5b1cf 100644
--- a/src/engine/api/geary-folder.vala
+++ b/src/engine/api/geary-folder.vala
@@ -4,7 +4,27 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
-public interface Geary.Folder : BaseObject {
+/**
+ * Folder represents the basic unit of organization for email.
+ *
+ * Each { link Account} offers a hierarcichal listing of Folders.  Folders must be opened (with
+ * { link open_async} before using most of its methods and should be closed with
+ * { link close_async} when completed, even if a method has failed with an IOError.
+ *
+ * Folder offers various open states indicating when its "local" (disk or database) connection and
+ * "remote" (network) connections are ready.  Generally the local connection opens first and the
+ * remote connection takes time to establish.  When in this state, Folder's methods still operate,
+ * but will only return locally stored information.
+ *
+ * Folder only offers a small selection of guaranteed functionality (in particular, the ability
+ * to list its { link Email}).  Additional functionality for Folders is indicated by the presence
+ * of { link FolderSupport} interfaces, include { link FolderSupport.Remove},
+ * { link FolderSupport.Copy}, and so forth.
+ *
+ * @see Geary.SpecialFolderType
+ */
+
+public abstract class Geary.Folder : BaseObject {
     public enum OpenState {
         CLOSED,
         OPENING,
@@ -143,7 +163,7 @@ public interface Geary.Folder : BaseObject {
     
     public abstract Geary.SpecialFolderType special_folder_type { get; }
     
-    public abstract Geary.ProgressMonitor opening_monitor { get; protected set; }
+    public abstract Geary.ProgressMonitor opening_monitor { get; }
     
     /**
      * Fired when the folder is successfully opened by a caller.
@@ -286,38 +306,82 @@ public interface Geary.Folder : BaseObject {
      */
     public signal void display_name_changed();
     
-    protected abstract void notify_opened(OpenState state, int count);
+    protected Folder() {
+    }
+    
+    protected virtual void notify_opened(Geary.Folder.OpenState state, int count) {
+        opened(state, count);
+    }
     
-    protected abstract void notify_open_failed(OpenFailed failure, Error? err);
+    protected virtual void notify_open_failed(Geary.Folder.OpenFailed failure, Error? err) {
+        open_failed(failure, err);
+    }
     
-    protected abstract void notify_closed(CloseReason reason);
+    protected virtual void notify_closed(Geary.Folder.CloseReason reason) {
+        closed(reason);
+    }
     
-    protected abstract void notify_email_appended(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_appended(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_appended(ids);
+    }
     
-    protected abstract void notify_email_locally_appended(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_locally_appended(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_locally_appended(ids);
+    }
     
-    protected abstract void notify_email_inserted(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_inserted(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_inserted(ids);
+    }
     
-    protected abstract void notify_email_locally_inserted(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_locally_inserted(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_locally_inserted(ids);
+    }
     
-    protected abstract void notify_email_removed(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_removed(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_removed(ids);
+    }
     
-    protected abstract void notify_email_count_changed(int new_count, CountChangeReason reason);
+    protected virtual void notify_email_count_changed(int new_count, Folder.CountChangeReason reason) {
+        email_count_changed(new_count, reason);
+    }
     
-    protected abstract void notify_email_flags_changed(Gee.Map<Geary.EmailIdentifier,
-        Geary.EmailFlags> flag_map);
+    protected virtual void notify_email_flags_changed(Gee.Map<Geary.EmailIdentifier,
+        Geary.EmailFlags> flag_map) {
+        email_flags_changed(flag_map);
+    }
     
-    protected abstract void notify_email_locally_complete(Gee.Collection<Geary.EmailIdentifier> ids);
+    protected virtual void notify_email_locally_complete(Gee.Collection<Geary.EmailIdentifier> ids) {
+        email_locally_complete(ids);
+    }
     
-    protected abstract void notify_special_folder_type_changed(Geary.SpecialFolderType old_type,
-        Geary.SpecialFolderType new_type);
+    /**
+     * In its default implementation, this will also call { link notify_display_name_changed} since
+     * that's often the case; if not, subclasses should override.
+     */
+    protected virtual void notify_special_folder_type_changed(Geary.SpecialFolderType old_type,
+        Geary.SpecialFolderType new_type) {
+        special_folder_type_changed(old_type, new_type);
+        
+        // in default implementation, this may also mean the display name changed; subclasses may
+        // override this behavior, but no way to detect this, so notify
+        if (special_folder_type != Geary.SpecialFolderType.NONE)
+            notify_display_name_changed();
+    }
     
-    protected abstract void notify_display_name_changed();
+    protected virtual void notify_display_name_changed() {
+        display_name_changed();
+    }
     
     /**
      * Returns a name suitable for displaying to the user.
+     *
+     * Default is to display the basename of the Folder's path, unless it's a special folder,
+     * in which case { link SpecialFolderType.get_display_name} is returned.
      */
-    public abstract string get_display_name();
+    public virtual string get_display_name() {
+        return (special_folder_type == Geary.SpecialFolderType.NONE)
+            ? path.basename : special_folder_type.get_display_name();
+    }
     
     /**
      * Returns the state of the Folder's connections to the local and remote stores.
@@ -477,6 +541,8 @@ public interface Geary.Folder : BaseObject {
     /**
      * Used for debugging.  Should not be used for user-visible labels.
      */
-    public abstract string to_string();
+    public virtual string to_string() {
+        return "%s:%s".printf(account.to_string(), path.to_string());
+    }
 }
 
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index c7b0f4d..ff441f2 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -4,7 +4,7 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
-private abstract class Geary.ImapEngine.GenericAccount : Geary.AbstractAccount {
+private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
     private const int REFRESH_FOLDER_LIST_SEC = 2 * 60;
     private const int REFRESH_UNSEEN_SEC = 1;
     
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index eedf05b..62bd816 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -4,7 +4,7 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
-private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.FolderSupport.Copy,
+private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport.Copy,
     Geary.FolderSupport.Mark, Geary.FolderSupport.Move {
     private const int FORCE_OPEN_REMOTE_TIMEOUT_SEC = 10;
     private const int DEFAULT_REESTABLISH_DELAY_MSEC = 10;
@@ -27,6 +27,9 @@ private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.Folde
         }
     }
     
+    private ProgressMonitor _opening_monitor = new 
Geary.ReentrantProgressMonitor(Geary.ProgressType.ACTIVITY);
+    public override Geary.ProgressMonitor opening_monitor { get { return _opening_monitor; } }
+    
     internal ImapDB.Folder local_folder  { get; protected set; }
     internal Imap.Folder? remote_folder { get; protected set; default = null; }
     internal EmailPrefetcher email_prefetcher { get; private set; }
@@ -55,8 +58,6 @@ private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.Folde
         _special_folder_type = special_folder_type;
         _properties.add(local_folder.get_properties());
         
-        opening_monitor = new Geary.ReentrantProgressMonitor(Geary.ProgressType.ACTIVITY);
-        
         email_flag_watcher = new EmailFlagWatcher(this);
         email_flag_watcher.email_flags_changed.connect(on_email_flags_changed);
         
@@ -72,6 +73,31 @@ private class Geary.ImapEngine.MinimalFolder : Geary.AbstractFolder, Geary.Folde
         local_folder.email_complete.disconnect(on_email_complete);
     }
     
+    /*
+     * These signal notifiers are marked public (note this is a private class) so the various
+     * ReplayOperations can directly fire the associated signals while within the queue.
+     */
+    
+    public void replay_notify_email_inserted(Gee.Collection<Geary.EmailIdentifier> ids) {
+        notify_email_inserted(ids);
+    }
+    
+    public void replay_notify_email_locally_inserted(Gee.Collection<Geary.EmailIdentifier> ids) {
+        notify_email_locally_inserted(ids);
+    }
+    
+    public void replay_notify_email_removed(Gee.Collection<Geary.EmailIdentifier> ids) {
+        notify_email_removed(ids);
+    }
+    
+    public void replay_notify_email_count_changed(int new_count, Folder.CountChangeReason reason) {
+        notify_email_count_changed(new_count, reason);
+    }
+    
+    public void replay_notify_email_flags_changed(Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags> flag_map) 
{
+        notify_email_flags_changed(flag_map);
+    }
+    
     public void set_special_folder_type(SpecialFolderType new_type) {
         SpecialFolderType old_type = _special_folder_type;
         _special_folder_type = new_type;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
index e9de104..758c29b 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
@@ -165,8 +165,8 @@ private abstract class Geary.ImapEngine.AbstractListEmail : Geary.ImapEngine.Sen
         
         // signal
         if (created_ids.size > 0) {
-            owner.notify_email_inserted(created_ids);
-            owner.notify_email_locally_inserted(created_ids);
+            owner.replay_notify_email_inserted(created_ids);
+            owner.replay_notify_email_locally_inserted(created_ids);
         }
         
         return ReplayOperation.Status.COMPLETED;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
index a1c6f78..a6090fd 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
@@ -109,8 +109,8 @@ private class Geary.ImapEngine.FetchEmail : Geary.ImapEngine.SendReplayOperation
         if (created_or_merged.get(email)) {
             Gee.Collection<Geary.EmailIdentifier> ids
                 = Geary.iterate<Geary.EmailIdentifier>(email.id).to_array_list();
-            engine.notify_email_inserted(ids);
-            engine.notify_email_locally_inserted(ids);
+            engine.replay_notify_email_inserted(ids);
+            engine.replay_notify_email_locally_inserted(ids);
         }
         
         // if remote_email doesn't fulfill all required, pull from local database, which should now
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
index 0965920..35b51c2 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-mark-email.vala
@@ -53,7 +53,7 @@ private class Geary.ImapEngine.MarkEmail : Geary.ImapEngine.SendReplayOperation
         Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags>? map = yield 
engine.local_folder.get_email_flags_async(
             original_flags.keys, cancellable);
         if (map != null && map.size > 0)
-            engine.notify_email_flags_changed(map);
+            engine.replay_notify_email_flags_changed(map);
         
         return ReplayOperation.Status.CONTINUE;
     }
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-move-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-move-email.vala
index 4fc13b2..6be265d 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-move-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-move-email.vala
@@ -45,9 +45,9 @@ private class Geary.ImapEngine.MoveEmail : Geary.ImapEngine.SendReplayOperation
         if (moved_ids == null || moved_ids.size == 0)
             return ReplayOperation.Status.COMPLETED;
         
-        engine.notify_email_removed(moved_ids);
+        engine.replay_notify_email_removed(moved_ids);
         
-        engine.notify_email_count_changed(Numeric.int_floor(original_count - to_move.size, 0),
+        engine.replay_notify_email_count_changed(Numeric.int_floor(original_count - to_move.size, 0),
             Geary.Folder.CountChangeReason.REMOVED);
         
         return ReplayOperation.Status.CONTINUE;
@@ -80,8 +80,8 @@ private class Geary.ImapEngine.MoveEmail : Geary.ImapEngine.SendReplayOperation
     public override async void backout_local_async() throws Error {
         yield engine.local_folder.mark_removed_async(moved_ids, false, cancellable);
         
-        engine.notify_email_inserted(moved_ids);
-        engine.notify_email_count_changed(original_count, Geary.Folder.CountChangeReason.INSERTED);
+        engine.replay_notify_email_inserted(moved_ids);
+        engine.replay_notify_email_count_changed(original_count, Geary.Folder.CountChangeReason.INSERTED);
     }
 
     public override string describe_state() {
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
index f1ee2d3..95cbed8 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-remove-email.vala
@@ -43,9 +43,9 @@ private class Geary.ImapEngine.RemoveEmail : Geary.ImapEngine.SendReplayOperatio
         if (removed_ids == null || removed_ids.size == 0)
             return ReplayOperation.Status.COMPLETED;
         
-        engine.notify_email_removed(removed_ids);
+        engine.replay_notify_email_removed(removed_ids);
         
-        engine.notify_email_count_changed(Numeric.int_floor(original_count - removed_ids.size, 0),
+        engine.replay_notify_email_count_changed(Numeric.int_floor(original_count - removed_ids.size, 0),
             Geary.Folder.CountChangeReason.REMOVED);
         
         return ReplayOperation.Status.CONTINUE;
@@ -70,10 +70,10 @@ private class Geary.ImapEngine.RemoveEmail : Geary.ImapEngine.SendReplayOperatio
     public override async void backout_local_async() throws Error {
         if (removed_ids != null && removed_ids.size > 0) {
             yield engine.local_folder.mark_removed_async(removed_ids, false, cancellable);
-            engine.notify_email_inserted(removed_ids);
+            engine.replay_notify_email_inserted(removed_ids);
         }
         
-        engine.notify_email_count_changed(original_count, Geary.Folder.CountChangeReason.INSERTED);
+        engine.replay_notify_email_count_changed(original_count, Geary.Folder.CountChangeReason.INSERTED);
     }
     
     public override string describe_state() {


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