[evolution-data-server] CamelFolder: Remove unused fetch_messages_sync() method.



commit c1a59862dbba0178e12a715d0f060c3c9d879a7b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Nov 28 11:10:33 2013 -0500

    CamelFolder: Remove unused fetch_messages_sync() method.
    
    The method is not used by Evolution and was partially broken anyway.
    The boolean return value was overloaded to mean both whether an error
    occurred AND whether there were more messages to fetch.  That's more
    than two possible states and would have required an additional "out"
    parameter to clarify, but I'm not going to bother with it.

 camel/camel-folder.c                       |  163 -------------------
 camel/camel-folder.h                       |   22 ---
 camel/providers/imapx/camel-imapx-folder.c |   46 ------
 camel/providers/imapx/camel-imapx-server.c |  238 +---------------------------
 camel/providers/imapx/camel-imapx-server.h |    8 -
 camel/providers/pop3/camel-pop3-folder.c   |   48 ------
 docs/reference/camel/camel-sections.txt    |    4 -
 7 files changed, 8 insertions(+), 521 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5ffa4f3..d33e73f 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -84,8 +84,6 @@ struct _AsyncContext {
        gchar *message_uid;         /* also a result */
        gboolean delete_originals;
        gboolean expunge;
-       CamelFetchType fetch_type;
-       gint limit;
        gchar *start_uid;
        gchar *end_uid;
 
@@ -2949,167 +2947,6 @@ camel_folder_expunge_finish (CamelFolder *folder,
 }
 
 /**
- * camel_folder_fetch_messages_sync :
- * @folder: a #CamelFolder
- * @type: Type to specify fetch old or new messages.
- * @limit: Limit to specify the number of messages to download.
- * @cancellable: optional #GCancellable object, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Downloads old or new specified number of messages from the server. It is
- * optimized for mobile client usage. Desktop clients should keep away from
- * this api and use @camel_folder_refresh_info.
- *
- * Returns: %TRUE on success, %FALSE on failure
- *
- * Since: 3.4
- **/
-gboolean
-camel_folder_fetch_messages_sync (CamelFolder *folder,
-                                  CamelFetchType type,
-                                  gint limit,
-                                  GCancellable *cancellable,
-                                  GError **error)
-{
-       CamelFolderClass *class;
-       gboolean success = TRUE;
-
-       g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
-
-       class = CAMEL_FOLDER_GET_CLASS (folder);
-
-       /* Some backends that wont support mobile
-        * mode, won't have this method implemented. */
-       if (class->fetch_messages_sync == NULL)
-               return FALSE;
-
-       camel_folder_lock (folder);
-
-       /* Check for cancellation after locking. */
-       if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
-               camel_folder_unlock (folder);
-               return FALSE;
-       }
-
-       success = class->fetch_messages_sync (
-               folder, type, limit, cancellable, error);
-       CAMEL_CHECK_GERROR (folder, fetch_messages_sync, success, error);
-
-       camel_folder_unlock (folder);
-
-       return success;
-}
-
-/* Helper for camel_folder_fetch_messages() */
-static void
-folder_fetch_messages_thread (GSimpleAsyncResult *simple,
-                              GObject *object,
-                              GCancellable *cancellable)
-{
-       AsyncContext *async_context;
-       GError *error = NULL;
-
-       async_context = g_simple_async_result_get_op_res_gpointer (simple);
-
-       camel_folder_fetch_messages_sync (
-               CAMEL_FOLDER (object),
-               async_context->fetch_type,
-               async_context->limit,
-               cancellable, &error);
-
-       if (error != NULL)
-               g_simple_async_result_take_error (simple, error);
-}
-
-/**
- * camel_folder_fetch_messages:
- * @folder: a #CamelFolder
- * @type: Type to specify fetch old or new messages.
- * @limit: Limit to specify the number of messages to download.
- * @io_priority: the I/O priority of the request
- * @cancellable: optional #GCancellable object, or %NULL
- * @callback: a #GAsyncReadyCallback to call when the request is satisfied
- * @user_data: data to pass to the callback function
- *
- * Asynchronously download new or old messages from the server. It is assumes
- * that the client has only a window of interested messages of what server has.
- * And old/new type helps to expand that window.
- *
- * type = CAMEL_FETCH_OLD_MESSAGES: Downloads messages older than what the
- * client already has.
- * type = CAMEL_FETCH_NEW_MESSAGES: Downloads messages newer than what the
- * client already has.
- *
- * When the operation is finished, @callback will be called.  You can then
- * call camel_folder_fetch_messages_finish() to get the result of the operation.
- *
- * Since: 3.4
- **/
-void
-camel_folder_fetch_messages (CamelFolder *folder,
-                             CamelFetchType type,
-                             gint limit,
-                             gint io_priority,
-                             GCancellable *cancellable,
-                             GAsyncReadyCallback callback,
-                             gpointer user_data)
-{
-       GSimpleAsyncResult *simple;
-       AsyncContext *async_context;
-
-       g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
-       async_context = g_slice_new0 (AsyncContext);
-       async_context->fetch_type = type;
-       async_context->limit = limit;
-
-       simple = g_simple_async_result_new (
-               G_OBJECT (folder), callback, user_data,
-               camel_folder_fetch_messages);
-
-       g_simple_async_result_set_check_cancellable (simple, cancellable);
-
-       g_simple_async_result_set_op_res_gpointer (
-               simple, async_context, (GDestroyNotify) async_context_free);
-
-       g_simple_async_result_run_in_thread (
-               simple, folder_fetch_messages_thread,
-               io_priority, cancellable);
-
-       g_object_unref (simple);
-}
-
-/**
- * camel_folder_fetch_messages_finish:
- * @folder: a #CamelFolder
- * @result: a #GAsyncResult
- * @error: return location for a #GError, or %NULL
- *
- * Finishes the operation started with camel_folder_fetch_messages().
- *
- * Returns: %TRUE on success, %FALSE on failure
- *
- * Since: 3.4
- **/
-gboolean
-camel_folder_fetch_messages_finish (CamelFolder *folder,
-                                    GAsyncResult *result,
-                                    GError **error)
-{
-       GSimpleAsyncResult *simple;
-
-       g_return_val_if_fail (
-               g_simple_async_result_is_valid (
-               result, G_OBJECT (folder),
-               camel_folder_fetch_messages), FALSE);
-
-       simple = G_SIMPLE_ASYNC_RESULT (result);
-
-       /* Assume success unless a GError is set. */
-       return !g_simple_async_result_propagate_error (simple, error);
-}
-
-/**
  * camel_folder_get_message_sync:
  * @folder: a #CamelFolder
  * @message_uid: the message UID
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index fca2e4f..b1331aa 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -219,11 +219,6 @@ struct _CamelFolderClass {
        gboolean        (*expunge_sync)         (CamelFolder *folder,
                                                 GCancellable *cancellable,
                                                 GError **error);
-       gboolean        (*fetch_messages_sync)  (CamelFolder *folder,
-                                                CamelFetchType type,
-                                                gint limit,
-                                                GCancellable *cancellable,
-                                                GError **error);
        CamelMimeMessage *
                        (*get_message_sync)     (CamelFolder *folder,
                                                 const gchar *message_uid,
@@ -426,23 +421,6 @@ void               camel_folder_expunge            (CamelFolder *folder,
 gboolean       camel_folder_expunge_finish     (CamelFolder *folder,
                                                 GAsyncResult *result,
                                                 GError **error);
-gboolean       camel_folder_fetch_messages_sync
-                                               (CamelFolder *folder,
-                                                CamelFetchType type,
-                                                gint limit,
-                                                GCancellable *cancellable,
-                                                GError **error);
-void           camel_folder_fetch_messages     (CamelFolder *folder,
-                                                CamelFetchType type,
-                                                gint limit,
-                                                gint io_priority,
-                                                GCancellable *cancellable,
-                                                GAsyncReadyCallback callback,
-                                                gpointer user_data);
-gboolean       camel_folder_fetch_messages_finish
-                                               (CamelFolder *folder,
-                                                GAsyncResult *result,
-                                                GError **error);
 CamelMimeMessage *
                camel_folder_get_message_sync   (CamelFolder *folder,
                                                 const gchar *message_uid,
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index b0fa7d8..791a34e 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -504,51 +504,6 @@ exit:
        return success;
 }
 
-static gboolean
-imapx_fetch_messages_sync (CamelFolder *folder,
-                           CamelFetchType type,
-                           gint limit,
-                           GCancellable *cancellable,
-                           GError **error)
-{
-       CamelStore *store;
-       CamelIMAPXStore *imapx_store;
-       CamelIMAPXServer *imapx_server;
-       CamelIMAPXMailbox *mailbox = NULL;
-       CamelFolderChangeInfo *changes;
-       gboolean success = FALSE;
-
-       store = camel_folder_get_parent_store (folder);
-
-       imapx_store = CAMEL_IMAPX_STORE (store);
-       imapx_server = camel_imapx_store_ref_server (imapx_store, error);
-
-       if (imapx_server == NULL)
-               goto exit;
-
-       mailbox = camel_imapx_folder_list_mailbox (
-               CAMEL_IMAPX_FOLDER (folder), cancellable, error);
-
-       if (mailbox == NULL)
-               goto exit;
-
-       changes = camel_imapx_server_fetch_messages (
-               imapx_server, mailbox, type, limit, cancellable, error);
-
-       if (changes != NULL) {
-               if (camel_folder_change_info_changed (changes))
-                       camel_folder_changed (folder, changes);
-               camel_folder_change_info_free (changes);
-               success = TRUE;
-       }
-
-exit:
-       g_clear_object (&mailbox);
-       g_clear_object (&imapx_server);
-
-       return success;
-}
-
 static CamelMimeMessage *
 imapx_get_message_sync (CamelFolder *folder,
                         const gchar *uid,
@@ -1145,7 +1100,6 @@ camel_imapx_folder_class_init (CamelIMAPXFolderClass *class)
        folder_class->get_filename = imapx_get_filename;
        folder_class->append_message_sync = imapx_append_message_sync;
        folder_class->expunge_sync = imapx_expunge_sync;
-       folder_class->fetch_messages_sync = imapx_fetch_messages_sync;
        folder_class->get_message_sync = imapx_get_message_sync;
        folder_class->get_quota_info_sync = imapx_get_quota_info_sync;
        folder_class->purge_message_cache_sync = imapx_purge_message_cache_sync;
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 6a9d385..56cbdce 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -416,9 +416,8 @@ enum {
        IMAPX_JOB_RENAME_MAILBOX = 1 << 12,
        IMAPX_JOB_SUBSCRIBE_MAILBOX = 1 << 13,
        IMAPX_JOB_UNSUBSCRIBE_MAILBOX = 1 << 14,
-       IMAPX_JOB_FETCH_MESSAGES = 1 << 15,
-       IMAPX_JOB_UPDATE_QUOTA_INFO = 1 << 16,
-       IMAPX_JOB_UID_SEARCH = 1 << 17
+       IMAPX_JOB_UPDATE_QUOTA_INFO = 1 << 15,
+       IMAPX_JOB_UID_SEARCH = 1 << 16
 };
 
 /* Mailbox management operations have highest priority
@@ -1170,8 +1169,7 @@ imapx_is_duplicate_fetch_or_refresh (CamelIMAPXServer *is,
        /* Job types to match. */
        job_types =
                IMAPX_JOB_FETCH_NEW_MESSAGES |
-               IMAPX_JOB_REFRESH_INFO |
-               IMAPX_JOB_FETCH_MESSAGES;
+               IMAPX_JOB_REFRESH_INFO;
 
        job = camel_imapx_command_get_job (ic);
 
@@ -2047,8 +2045,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
 
                job = imapx_match_active_job (
                        is, IMAPX_JOB_FETCH_NEW_MESSAGES |
-                       IMAPX_JOB_REFRESH_INFO |
-                       IMAPX_JOB_FETCH_MESSAGES, NULL);
+                       IMAPX_JOB_REFRESH_INFO, NULL);
 
                if (job != NULL) {
                        data = camel_imapx_job_get_data (job);
@@ -2153,8 +2150,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
 
                job = imapx_match_active_job (
                        is, IMAPX_JOB_FETCH_NEW_MESSAGES |
-                       IMAPX_JOB_REFRESH_INFO |
-                       IMAPX_JOB_FETCH_MESSAGES, NULL);
+                       IMAPX_JOB_REFRESH_INFO, NULL);
 
                if (job != NULL) {
                        CamelIMAPXMailbox *mailbox;
@@ -5937,149 +5933,6 @@ imapx_job_fetch_new_messages_start (CamelIMAPXJob *job,
 }
 
 static gboolean
-imapx_job_fetch_messages_start (CamelIMAPXJob *job,
-                                CamelIMAPXServer *is,
-                                GCancellable *cancellable,
-                                GError **error)
-{
-       CamelIMAPXCommand *ic;
-       CamelFolder *folder;
-       CamelIMAPXMailbox *mailbox;
-       guint32 total;
-       gchar *start_uid = NULL, *end_uid = NULL;
-       CamelFetchType ftype;
-       gint fetch_limit;
-       CamelSortType fetch_order;
-       CamelIMAPXSettings *settings;
-       guint uidset_size;
-       RefreshInfoData *data;
-
-       data = camel_imapx_job_get_data (job);
-       g_return_val_if_fail (data != NULL, FALSE);
-
-       mailbox = camel_imapx_job_ref_mailbox (job);
-       g_return_val_if_fail (mailbox != NULL, FALSE);
-
-       folder = imapx_server_ref_folder (is, mailbox);
-       g_return_val_if_fail (folder != NULL, FALSE);
-
-       settings = camel_imapx_server_ref_settings (is);
-       fetch_order = camel_imapx_settings_get_fetch_order (settings);
-       uidset_size = camel_imapx_settings_get_batch_fetch_count (settings);
-       g_object_unref (settings);
-
-       total = camel_folder_summary_count (folder->summary);
-
-       ftype = data->fetch_type;
-       fetch_limit = data->fetch_msg_limit;
-
-       if (ftype == CAMEL_FETCH_NEW_MESSAGES ||
-               (ftype ==  CAMEL_FETCH_OLD_MESSAGES && total <=0 )) {
-
-               gchar *uid;
-
-               if (total > 0) {
-                       /* This means that we are fetching limited number of new mails */
-                       uid = g_strdup_printf ("%d", total);
-               } else {
-                       /* For empty accounts, we always fetch the specified number of new mails independent 
of
-                        * being asked to fetch old or new.
-                        */
-                       uid = g_strdup ("1");
-               }
-
-               if (ftype == CAMEL_FETCH_NEW_MESSAGES) {
-                       gboolean success;
-
-                       /* We need to issue Status command to get the total unread count */
-                       ic = camel_imapx_command_new (
-                               is, "STATUS", NULL, "STATUS %M (%t)",
-                               mailbox, is->priv->status_data_items);
-                       camel_imapx_command_set_job (ic, job);
-                       ic->pri = job->pri;
-
-                       success = imapx_command_run_sync (
-                               is, ic, cancellable, error);
-
-                       camel_imapx_command_unref (ic);
-
-                       if (!success) {
-                               g_prefix_error (
-                                       error, "%s: ",
-                                       _("Error while fetching messages"));
-                               g_object_unref (folder);
-                               return FALSE;
-                       }
-               }
-
-               camel_operation_push_message (
-                       cancellable, dngettext (GETTEXT_PACKAGE,
-                       "Fetching summary information for %d message in '%s'",
-                       "Fetching summary information for %d messages in '%s'",
-                       data->fetch_msg_limit),
-                       data->fetch_msg_limit,
-                       camel_folder_get_display_name (folder));
-
-               /* New account and fetching old messages, we would return just the limited number of newest 
messages */
-               ic = camel_imapx_command_new (
-                       is, "FETCH", mailbox,
-                       "UID FETCH %s:* (UID FLAGS)", uid);
-
-               imapx_uidset_init (&data->uidset, uidset_size, 0);
-               refresh_info_data_infos_free (data);
-               data->infos = g_array_new (0, 0, sizeof (struct _refresh_info));
-               ic->pri = job->pri;
-
-               data->scan_changes = TRUE;
-
-               if (fetch_order == CAMEL_SORT_DESCENDING)
-                       ic->complete = imapx_command_fetch_new_uids_done;
-               else
-                       ic->complete = imapx_command_step_fetch_done;
-
-               g_free (uid);
-
-       } else if (ftype == CAMEL_FETCH_OLD_MESSAGES && total > 0) {
-               guint64 uidl;
-               start_uid = camel_imapx_dup_uid_from_summary_index (folder, 0);
-               uidl = strtoull (start_uid, NULL, 10);
-               end_uid = g_strdup_printf ("%" G_GINT64_MODIFIER "d", (((gint) uidl) - fetch_limit > 0) ? 
(uidl - fetch_limit) : 1);
-
-               camel_operation_push_message (
-                       cancellable, dngettext (GETTEXT_PACKAGE,
-                       "Fetching summary information for %d message in '%s'",
-                       "Fetching summary information for %d messages in '%s'",
-                       data->fetch_msg_limit),
-                       data->fetch_msg_limit,
-                       camel_folder_get_display_name (folder));
-
-               ic = camel_imapx_command_new (
-                       is, "FETCH", mailbox,
-                       "UID FETCH %s:%s (RFC822.SIZE RFC822.HEADER FLAGS)",
-                       start_uid, end_uid);
-               ic->pri = job->pri;
-               ic->complete = imapx_command_fetch_new_messages_done;
-
-               g_free (start_uid);
-               g_free (end_uid);
-
-       } else {
-               g_error ("Shouldn't reach here. Incorrect fetch type");
-       }
-
-       camel_imapx_command_set_job (ic, job);
-
-       imapx_command_queue (is, ic);
-
-       camel_imapx_command_unref (ic);
-
-       g_object_unref (folder);
-       g_object_unref (mailbox);
-
-       return TRUE;
-}
-
-static gboolean
 imapx_job_refresh_info_start (CamelIMAPXJob *job,
                               CamelIMAPXServer *is,
                               GCancellable *cancellable,
@@ -8521,12 +8374,11 @@ camel_imapx_server_refresh_info (CamelIMAPXServer *is,
 
        QUEUE_LOCK (is);
 
-       /* Both RefreshInfo and Fetch messages can't operate simultaneously */
+       /* Don't run concurrent refreshes on the same mailbox.
+        * If a refresh is already in progress, let it finish
+        * and return no changes for this refresh request. */
        job = imapx_is_job_in_queue (
                is, mailbox, IMAPX_JOB_REFRESH_INFO, NULL);
-       if (job == NULL)
-               job = imapx_is_job_in_queue (
-                       is, mailbox, IMAPX_JOB_FETCH_MESSAGES, NULL);
 
        if (job != NULL) {
                QUEUE_UNLOCK (is);
@@ -9094,80 +8946,6 @@ camel_imapx_server_unsubscribe_mailbox (CamelIMAPXServer *is,
        return success;
 }
 
-static gboolean
-imapx_job_fetch_messages_matches (CamelIMAPXJob *job,
-                                  CamelIMAPXMailbox *mailbox,
-                                  const gchar *uid)
-{
-       return camel_imapx_job_has_mailbox (job, mailbox);
-}
-
-CamelFolderChangeInfo *
-camel_imapx_server_fetch_messages (CamelIMAPXServer *is,
-                                   CamelIMAPXMailbox *mailbox,
-                                   CamelFetchType type,
-                                   gint limit,
-                                   GCancellable *cancellable,
-                                   GError **error)
-{
-       CamelIMAPXJob *job;
-       RefreshInfoData *data;
-       CamelFolderChangeInfo *changes = NULL;
-       gboolean registered = TRUE;
-       const gchar *mailbox_name;
-
-       g_return_val_if_fail (CAMEL_IS_IMAPX_SERVER (is), NULL);
-       g_return_val_if_fail (CAMEL_IS_IMAPX_MAILBOX (mailbox), NULL);
-
-       QUEUE_LOCK (is);
-
-       /* Both RefreshInfo and Fetch messages can't operate simultaneously */
-       job = imapx_is_job_in_queue (
-               is, mailbox, IMAPX_JOB_REFRESH_INFO, NULL);
-       if (job == NULL)
-               job = imapx_is_job_in_queue (
-                       is, mailbox, IMAPX_JOB_FETCH_MESSAGES, NULL);
-
-       if (job != NULL) {
-               QUEUE_UNLOCK (is);
-               return camel_folder_change_info_new ();
-       }
-
-       data = g_slice_new0 (RefreshInfoData);
-       data->changes = camel_folder_change_info_new ();
-       data->fetch_msg_limit = limit;
-       data->fetch_type = type;
-
-       job = camel_imapx_job_new (cancellable);
-       job->type = IMAPX_JOB_FETCH_MESSAGES;
-       job->start = imapx_job_fetch_messages_start;
-       job->matches = imapx_job_fetch_messages_matches;
-       job->pri = IMAPX_PRIORITY_NEW_MESSAGES;
-
-       camel_imapx_job_set_mailbox (job, mailbox);
-
-       mailbox_name = camel_imapx_mailbox_get_name (mailbox);
-
-       if (camel_imapx_mailbox_is_inbox (mailbox_name))
-               job->pri += 10;
-
-       camel_imapx_job_set_data (
-               job, data, (GDestroyNotify) refresh_info_data_free);
-
-       registered = imapx_register_job (is, job, error);
-
-       QUEUE_UNLOCK (is);
-
-       if (registered && camel_imapx_job_run (job, is, error)) {
-               changes = data->changes;
-               data->changes = NULL;
-       }
-
-       camel_imapx_job_unref (job);
-
-       return changes;
-}
-
 gboolean
 camel_imapx_server_update_quota_info (CamelIMAPXServer *is,
                                       CamelIMAPXMailbox *mailbox,
diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index 666ec38..80e169b 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -194,14 +194,6 @@ gboolean   camel_imapx_server_expunge      (CamelIMAPXServer *is,
                                                 CamelIMAPXMailbox *mailbox,
                                                 GCancellable *cancellable,
                                                 GError **error);
-CamelFolderChangeInfo *
-               camel_imapx_server_fetch_messages
-                                               (CamelIMAPXServer *is,
-                                                CamelIMAPXMailbox *mailbox,
-                                                CamelFetchType type,
-                                                gint limit,
-                                                GCancellable *cancellable,
-                                                GError **error);
 gboolean       camel_imapx_server_noop         (CamelIMAPXServer *is,
                                                 CamelIMAPXMailbox *mailbox,
                                                 GCancellable *cancellable,
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 1bb060c..5c305cd 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -885,53 +885,6 @@ pop3_folder_refresh_info_sync (CamelFolder *folder,
 }
 
 static gboolean
-pop3_fetch_messages_sync (CamelFolder *folder,
-                          CamelFetchType type,
-                          gint limit,
-                          GCancellable *cancellable,
-                          GError **error)
-{
-       CamelPOP3FolderInfo *fi;
-       CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *) folder;
-       gint old_len;
-       CamelStore *parent_store;
-       CamelService *service;
-       CamelSettings *settings;
-       gint batch_fetch_count;
-
-       parent_store = camel_folder_get_parent_store (folder);
-       service = (CamelService *) parent_store;
-
-       settings = camel_service_ref_settings (service);
-
-       batch_fetch_count = camel_pop3_settings_get_batch_fetch_count (
-               CAMEL_POP3_SETTINGS (settings));
-
-       g_object_unref (settings);
-
-       old_len = pop3_folder->uids->len;
-
-       /* If we have the first message already, then return FALSE */
-       fi = pop3_folder->uids->pdata[0];
-       if (type == CAMEL_FETCH_OLD_MESSAGES && fi->id == pop3_folder->first_id)
-               return FALSE;
-
-       pop3_folder->fetch_type = type;
-       pop3_folder->fetch_more = (limit > 0) ? limit : batch_fetch_count;
-       pop3_folder_refresh_info_sync (folder, cancellable, error);
-       pop3_folder->fetch_more = 0;
-
-       /* Even if we downloaded the first/oldest message, just now, return TRUE so that we wont waste 
another cycle */
-       fi = pop3_folder->uids->pdata[0];
-       if (type == CAMEL_FETCH_OLD_MESSAGES && fi->id == pop3_folder->first_id)
-               return FALSE;
-       else if (type == CAMEL_FETCH_NEW_MESSAGES && old_len == pop3_folder->uids->len)
-               return FALSE; /* We didnt fetch any new messages as there were none probably. */
-
-       return TRUE;
-}
-
-static gboolean
 pop3_folder_synchronize_sync (CamelFolder *folder,
                               gboolean expunge,
                               GCancellable *cancellable,
@@ -1077,7 +1030,6 @@ camel_pop3_folder_class_init (CamelPOP3FolderClass *class)
        object_class->dispose = pop3_folder_dispose;
 
        folder_class = CAMEL_FOLDER_CLASS (class);
-       folder_class->fetch_messages_sync = pop3_fetch_messages_sync;
        folder_class->get_message_count = pop3_folder_get_message_count;
        folder_class->get_uids = pop3_folder_get_uids;
        folder_class->free_uids = camel_folder_free_shallow;
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 75f5fac..9480f0b 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -424,9 +424,6 @@ camel_folder_expunge_sync
 camel_folder_expunge
 camel_folder_expunge_finish
 CamelFetchType
-camel_folder_fetch_messages_sync
-camel_folder_fetch_messages
-camel_folder_fetch_messages_finish
 camel_folder_get_message_sync
 camel_folder_get_message
 camel_folder_get_message_finish
@@ -3552,7 +3549,6 @@ camel_imapx_server_list
 camel_imapx_server_refresh_info
 camel_imapx_server_sync_changes
 camel_imapx_server_expunge
-camel_imapx_server_fetch_messages
 camel_imapx_server_noop
 camel_imapx_server_get_message
 camel_imapx_server_copy_message


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