2005-07-06 [colin] 1.9.12cvs24
[claws.git] / src / etpan / imap-thread.c
index 4d76e07d1c82a25c8a8ef5a866f53b225ac3c91d..b7d00265bef84f14c5ecd2610f58a05ff226f2fb 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef HAVE_LIBETPAN
+
 #include "imap-thread.h"
 
 #include <sys/types.h>
@@ -35,7 +41,7 @@ void imap_main_init(void)
        mailstream_network_delay.tv_sec = ETPAN_DEFAULT_NETWORK_TIMEOUT;
        mailstream_network_delay.tv_usec = 0;
 
-#if 0  
+#if 0
        mailstream_debug = 1;
 #endif
        imap_hash = chash_new(CHASH_COPYKEY, CHASH_DEFAULTSIZE);
@@ -517,17 +523,26 @@ static void noop_run(struct etpan_thread_op * op)
        debug_print("imap noop run - end %i\n", r);
 }
 
-int imap_threaded_noop(Folder * folder)
+int imap_threaded_noop(Folder * folder, unsigned int * p_exists)
 {
        struct noop_param param;
        struct noop_result result;
+       mailimap * imap;
        
        debug_print("imap noop - begin\n");
        
-       param.imap = get_imap(folder);
+       imap = get_imap(folder);
+       param.imap = imap;
        
        threaded_run(folder, &param, &result, noop_run);
        
+       if (imap->imap_selection_info != NULL) {
+               * p_exists = imap->imap_selection_info->sel_exists;
+       }
+       else {
+               * p_exists = 0;
+       }
+       
        debug_print("imap noop - end\n");
        
        return result.error;
@@ -2158,3 +2173,16 @@ int imap_threaded_connect_cmd(Folder * folder, const char * command,
        
        return result.error;
 }
+#else
+
+void imap_main_init(void)
+{
+}
+void imap_main_done(void)
+{
+}
+void imap_main_set_timeout(int sec)
+{
+}
+
+#endif