Changeset 2670

Show
Ignore:
Timestamp:
09/03/07 13:04:38
Author:
pvanhoof
Message:

* Date, Received, INTERNALDATE: fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r2668 r2670  
    66        really recognizable anymore so it shouldn't copy the copyright of the 
    77        original as this is not a copy anymore. 
     8        * Date, Received, INTERNALDATE: fixes  
    89 
    9102007-09-03  Javier Fernandez Garcia-Boente  <jfernandez@igalia.com> 
  • trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.c

    r2667 r2670  
    20882088                mi->cc = camel_pstring_add (g_strdup (""), TRUE); 
    20892089 
    2090         mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), &tzone); 
    2091         mi->date_sent += (tzone / 100) * 60 * 60; 
    2092         mi->date_sent += (tzone % 100) * 60; 
    2093  
     2090        mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL); 
    20942091        received = camel_header_raw_find(&h, "received", NULL); 
    20952092 
    20962093        if (received) 
    2097                 r = strrchr(received, ';'); 
    2098         if (r) { 
    2099                 mi->date_received = camel_header_decode_date(r + 1, &tzone); 
    2100                 mi->date_received += (tzone / 100) * 60 * 60; 
    2101                 mi->date_received += (tzone % 100) * 60; 
    2102         } else if (received) { 
    2103                 mi->date_received = camel_header_decode_date(received, &tzone); 
    2104                 mi->date_received += (tzone / 100) * 60 * 60; 
    2105                 mi->date_received += (tzone % 100) * 60; 
    2106         } else  
    2107                 mi->date_received = mi->date_sent; 
     2094                received = strrchr(received, ';'); 
     2095        if (received) 
     2096                mi->date_received = camel_header_decode_date(received + 1, NULL); 
     2097        else  
     2098                mi->date_received = time (&mi->date_received); 
    21082099 
    21092100        msgid = camel_header_msgid_decode(camel_header_raw_find(&h, "message-id", NULL)); 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c

    r2482 r2670  
    28882888        /* ... it does */ 
    28892889 
    2890         if ((idate = g_datalist_get_data (&data, "INTERNALDATE"))) 
     2890        if ((idate = g_datalist_get_data (&data, "INTERNALDATE")))  
    28912891                mi->info.date_received = decode_internaldate ((const unsigned char *) idate); 
    2892          
    2893         if (mi->info.date_received == -1) 
    2894                 mi->info.date_received = mi->info.date_sent; 
    28952892 
    28962893        return mi; 
     
    31703167                        uidset = imap_uid_array_to_set (folder->summary, needheaders, uid, UID_SET_LIMIT, &uid); 
    31713168                        if (!camel_imap_command_start (store, folder, ex, 
    3172                                                        "UID FETCH %s (FLAGS RFC822.SIZE BODY.PEEK[%s])", 
     3169                                                       "UID FETCH %s (FLAGS RFC822.SIZE INTERNALDATE BODY.PEEK[%s])", 
    31733170                                                       uidset, header_spec))  
    31743171                        { 
  • trunk/tests/c-demo/tny-demoui-summary-view.c

    r2620 r2670  
    9494        GtkTreeView *mailbox_view, *header_view; 
    9595        TnyMsgView *msg_view; 
    96         GtkWidget *status, *progress, *online_button, *poke_button, *sync_button; 
     96        GtkWidget *status, *progress, *online_button, *poke_button,  
     97                  *sync_button, *killacc_button; 
    9798        guint status_id; 
    9899        gulong mailbox_select_sid; 
     
    438439        g_object_unref (a_iter); 
    439440        g_object_unref (accounts); 
     441} 
     442 
     443 
     444 
     445static void  
     446killacc_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) 
     447{ 
     448        TnySummaryView *self = user_data; 
     449        TnyDemouiSummaryViewPriv *priv = TNY_DEMOUI_SUMMARY_VIEW_GET_PRIVATE (self); 
     450        TnyList *accounts = tny_simple_list_new (); 
     451        TnyIterator *a_iter; 
     452 
     453        tny_account_store_get_accounts (priv->account_store, accounts,  
     454                TNY_ACCOUNT_STORE_STORE_ACCOUNTS); 
     455 
     456        a_iter = tny_list_create_iterator (accounts); 
     457 
     458        GObject *a_cur = TNY_ACCOUNT (tny_iterator_get_current (a_iter)); 
     459 
     460        g_object_unref (a_iter); 
     461        g_object_unref (accounts); 
     462 
     463        printf ("%d\n", a_cur->ref_count); 
     464 
     465        g_object_unref (a_cur); 
     466        g_object_unref (a_cur); 
     467        g_object_unref (a_cur); 
     468        g_object_unref (a_cur); 
     469        g_object_unref (a_cur); 
     470 
    440471} 
    441472 
     
    16691700        priv->poke_button = gtk_button_new_with_label ("Poke status"); 
    16701701        priv->sync_button = gtk_button_new_with_label ("Sync"); 
     1702        priv->killacc_button = gtk_button_new_with_label ("Kill account"); 
     1703 
    16711704        priv->current_accounts = NULL; 
    16721705 
     
    16791712        g_signal_connect (G_OBJECT (priv->sync_button), "clicked",  
    16801713                G_CALLBACK (sync_button_clicked), self); 
     1714 
     1715        g_signal_connect (G_OBJECT (priv->killacc_button), "clicked",  
     1716                G_CALLBACK (killacc_button_toggled), self); 
    16811717 
    16821718#if PLATFORM==1 
     
    17081744        gtk_box_pack_start (GTK_BOX (priv->status), priv->poke_button, FALSE, FALSE, 0); 
    17091745        gtk_box_pack_start (GTK_BOX (priv->status), priv->sync_button, FALSE, FALSE, 0); 
     1746        gtk_box_pack_start (GTK_BOX (priv->status), priv->killacc_button, FALSE, FALSE, 0); 
    17101747 
    17111748        gtk_widget_show (priv->online_button); 
    17121749        gtk_widget_show (priv->poke_button); 
     1750        gtk_widget_show (priv->killacc_button); 
    17131751        gtk_widget_show (priv->sync_button); 
    17141752        gtk_widget_show (priv->status);