2006-02-06 [colin] 2.0.0cvs21
[claws.git] / src / inc.c
index 475eeaec7ea4fe50aa22466f08424a8d3a2bafb2..a550e1f4fc46969dc67b273783641b1750411d67 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -637,6 +637,11 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                        if (!pop3_session->ac_prefs->filter_on_recv || 
                            !procmsg_msginfo_filter(msginfo))
                                folder_item_move_msg(inbox, msginfo);
+               }
+               filtering_move_and_copy_msgs(msglist);
+               for(msglist_element = msglist; msglist_element != NULL; 
+                   msglist_element = msglist_element->next) {
+                       MsgInfo *msginfo = (MsgInfo *)msglist_element->data;
                        procmsg_msginfo_free(msginfo);
                }
                folder_item_update_thaw();
@@ -1244,8 +1249,8 @@ static gint inc_spool_account(PrefsAccount *account)
        gchar *mbox;
        gint result;
 
-       if (account->inbox) {
-               inbox = folder_find_item_from_path(account->inbox);
+       if (account->local_inbox) {
+               inbox = folder_find_item_from_identifier(account->local_inbox);
                if (!inbox)
                        inbox = folder_get_default_inbox();
        } else
@@ -1428,29 +1433,39 @@ gboolean inc_offline_should_override(void)
 {
        static time_t overridden_yes = 0;
        static time_t overridden_no  = 0;
-       int length = 600;
-       gboolean answer = TRUE;
+       int length = 10; /* minutes */
+       gint answer = G_ALERTDEFAULT;
        
        if (prefs_common.autochk_newmail)
-               length = prefs_common.autochk_itv;
+               length = prefs_common.autochk_itv; /* minutes */
 
        if (prefs_common.work_offline) {
-               gchar *tmp = g_strdup_printf(
-                               _("You're working offline. Override for %d minutes?"),
-                               length);
-               if (time(NULL) - overridden_yes < length * 10)
+               gchar *tmp = NULL;
+               
+               if (time(NULL) - overridden_yes < length * 60) /* seconds */
                         return TRUE;
-               else if (time(NULL) - overridden_no < length * 10)
+               else if (time(NULL) - overridden_no < length * 60) /* seconds */
                         return FALSE;
-               
-               answer = (alertpanel(_("Offline warning"), 
+
+               tmp = g_strdup_printf(
+                               _("You're working offline. Override for %d minutes?"),
+                               length);
+
+               answer = alertpanel(_("Offline warning"), 
                               tmp,
-                              GTK_STOCK_YES, GTK_STOCK_NO, NULL) == G_ALERTDEFAULT);
+                              GTK_STOCK_NO, "+" GTK_STOCK_YES, _("On_ly once"));
                g_free(tmp);
-               if (answer == TRUE)
+               if (answer == G_ALERTALTERNATE) {
                        overridden_yes = time(NULL);
-               else
+                       return TRUE;
+               } else if (answer == G_ALERTDEFAULT) {
                        overridden_no  = time(NULL);
+                       return FALSE;
+               } else {
+                       overridden_yes = (time_t)0;
+                       overridden_no  = (time_t)0;
+                       return TRUE;
+               }
        }
-       return answer;
+       return TRUE;
 }