From 5bbf9458afb6dd27037b2dd9e3b9b65252f9025e Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 5 Sep 2013 22:38:03 +0200 Subject: [PATCH] imap gui import counter fix --- src/imap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/imap.c b/src/imap.c index 98fd69ab..81da0e0b 100644 --- a/src/imap.c +++ b/src/imap.c @@ -23,6 +23,9 @@ #include +void update_import_job_stat(struct session_data *sdata, struct __data *data); + + int get_message_length_from_imap_answer(char *s, int *_1st_line_bytes){ char *p, *q; int len=0; @@ -204,6 +207,13 @@ int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sda if(dryrun == 0) rc = import_message(filename, sdata, data, cfg); else rc = OK; + + if(data->import->processed_messages % 100 == 0){ + time(&(data->import->updated)); + update_import_job_stat(sdata, data); + } + + if(rc == ERR) printf("error importing '%s'\n", filename); else unlink(filename); }