aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/mbox.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libsylph/mbox.c b/libsylph/mbox.c
index 34aad016..cbc461d1 100644
--- a/libsylph/mbox.c
+++ b/libsylph/mbox.c
@@ -69,13 +69,18 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
FILE *mbox_fp;
gchar buf[BUFFSIZE], from_line[BUFFSIZE];
gchar *tmp_file;
- gint msgs = 0;
+ gint new_msgs = 0;
+ gint count = 0;
+ Folder *folder;
g_return_val_if_fail(dest != NULL, -1);
+ g_return_val_if_fail(dest->folder != NULL, -1);
g_return_val_if_fail(mbox != NULL, -1);
debug_print(_("Getting messages from %s into %s...\n"), mbox, dest->path);
+ folder = dest->folder;
+
if ((mbox_fp = g_fopen(mbox, "rb")) == NULL) {
FILE_OP_ERROR(mbox, "fopen");
return -1;
@@ -114,6 +119,10 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
gboolean is_junk = FALSE;
FilterInfo *fltinfo;
+ count++;
+ if (folder->ui_func)
+ folder->ui_func(folder, dest, folder->ui_func_data ? dest->folder->ui_func_data : GINT_TO_POINTER(count));
+
if ((tmp_fp = g_fopen(tmp_file, "wb")) == NULL) {
FILE_OP_ERROR(tmp_file, "fopen");
g_warning(_("can't open temporary file\n"));
@@ -268,7 +277,7 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
if (!is_junk &&
fltinfo->actions[FLT_ACTION_DELETE] == FALSE &&
fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE)
- msgs++;
+ new_msgs++;
filter_info_free(fltinfo);
g_unlink(tmp_file);
@@ -276,9 +285,9 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
g_free(tmp_file);
fclose(mbox_fp);
- debug_print("%d new messages found.\n", msgs);
+ debug_print("%d new messages found.\n", new_msgs);
- return msgs;
+ return new_msgs;
}
gint lock_mbox(const gchar *base, LockType type)