Improve address parsing.
authorMatch Grun <match@dimensional.com>
Mon, 8 Apr 2002 03:51:28 +0000 (03:51 +0000)
committerMatch Grun <match@dimensional.com>
Mon, 8 Apr 2002 03:51:28 +0000 (03:51 +0000)
13 files changed:
ChangeLog.claws
configure.in
src/addressbook.c
src/addressbook.h
src/addrgather.c
src/addrgather.h
src/addrharvest.c
src/addrharvest.h
src/addritem.c
src/addritem.h
src/mainwindow.c
src/summaryview.c
src/summaryview.h

index 4399ea6..9c7d375 100644 (file)
@@ -1,3 +1,18 @@
+2002-04-07 [match]     0.7.4claws72
+
+       * src/addrharvest.[ch]
+               fixed to read all addresses in header, regardless
+               of header size. improved name parsing. accommodate
+               harvest from folders and selected message.
+       * src/addritem.[ch]
+               included new address parsing function.
+       * src/addrgather.[ch]
+       * src/addressbook.[ch]
+       * src/summaryview.[ch]
+       * src/mainwindow.c
+               allow address harvest of folder as well as selected
+               messages.
+
 2002-04-07 [paul]      0.7.4claws71
 
        * src/esmtp.[ch]
index 4d366e1..13b5227 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws71
+EXTRA_VERSION=claws72
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 40a09eb..a0a7501 100644 (file)
@@ -3967,17 +3967,18 @@ static void addressbook_import_pine_cb() {
 }
 
 /*
-* Gather addresses.
-* Enter: folderItem Folder to import.
-*/
-void addressbook_gather( FolderItem *folderItem ) {
+ * Gather addresses.
+ * Enter: folderItem Folder to import.
+ *        msgList    List of message numbers, or NULL to process folder.
+ */
+void addressbook_gather( FolderItem *folderItem, GList *msgList ) {
        AddressDataSource *ds = NULL;
        AdapterDSource *ads = NULL;
        AddressBookFile *abf = NULL;
        AdapterInterface *adapter;
        GtkCTreeNode *newNode;
 
-       abf = addrgather_dlg_execute( folderItem, _addressIndex_ );
+       abf = addrgather_dlg_execute( folderItem, _addressIndex_, msgList );
        if( abf ) {
                ds = addrindex_index_add_datasource(
                        _addressIndex_, ADDR_IF_BOOK, abf );
index c894178..6d03c22 100644 (file)
@@ -40,6 +40,7 @@ gboolean addressbook_add_contact      ( const gchar   *name,
 
 gboolean addressbook_load_completion   ( gint (*callBackFunc) ( const gchar *, const gchar *, const gchar * ) );
 
-void addressbook_gather                        ( FolderItem *folderItem );
+void addressbook_gather                        ( FolderItem *folderItem,
+                                         GList *msgList );
 
 #endif /* __ADDRESSBOOK_H__ */
index 1000f61..7bf7c65 100644 (file)
@@ -104,6 +104,7 @@ static gchar *_harv_headerNames_[] = {
        HEADER_CC,
        HEADER_ERRORS_TO
 };
+static GList *_harv_messageList_;
 
 void addrgather_dlg_status_show( gchar *msg ) {
        if( addrgather_dlg.statusbar != NULL ) {
@@ -187,7 +188,8 @@ static gboolean addrgather_dlg_harvest() {
        g_free( name );
 
        /* Harvest addresses */
-       addrharvest_harvest( harvester, abf->addressCache );
+       addrharvest_harvest(
+               harvester, abf->addressCache, _harv_messageList_ );
        addrbook_save_data( abf );
        _harv_addressBook_ = abf;
 
@@ -450,7 +452,6 @@ static void addrgather_dlg_create( void ) {
        window = gtk_window_new( GTK_WINDOW_DIALOG );
        gtk_widget_set_usize( window, 380, -1 );
        gtk_container_set_border_width(GTK_CONTAINER(window), 0);
-       gtk_window_set_title( GTK_WINDOW(window), _("Gather E-Mail Addresses") );
        gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER );
        gtk_window_set_modal( GTK_WINDOW(window), TRUE );       
        gtk_signal_connect( GTK_OBJECT(window), "delete_event",
@@ -509,17 +510,21 @@ static void addrgather_dlg_create( void ) {
 }
 
 /*
-* Gather addresses main window.
-* Enter: folderItem Source folder.
-*        addrIndex  Address index.
-* Return: Populated address book file, or NULL if none created.
-*/
-AddressBookFile *addrgather_dlg_execute( FolderItem *folderItem, AddressIndex *addrIndex ) {
+ * Gather addresses main window.
+ * Enter: folderItem Source folder.
+ *        addrIndex  Address index.
+ *        msgList    List of message numbers, or NULL to process folder.
+ * Return: Populated address book file, or NULL if none created.
+ */
+AddressBookFile *addrgather_dlg_execute(
+       FolderItem *folderItem, AddressIndex *addrIndex, GList *msgList )
+{
        gboolean errFlag;
        gint i;
 
        _harv_addressIndex_ = addrIndex;
        _harv_addressBook_ = NULL;
+       _harv_messageList_ = msgList;
 
        /* Create dialog */
        if( ! addrgather_dlg.window ) {
@@ -560,6 +565,14 @@ AddressBookFile *addrgather_dlg_execute( FolderItem *folderItem, AddressIndex *a
                gtk_widget_grab_default( addrgather_dlg.btnCancel );
        }
 
+       if( msgList ) {
+               gtk_window_set_title( GTK_WINDOW(addrgather_dlg.window),
+                       _("Gather E-Mail Addresses - from Selected Messages") );
+       }
+       else {
+               gtk_window_set_title( GTK_WINDOW(addrgather_dlg.window),
+                       _("Gather E-Mail Addresses - from Folder") );
+       }
        addrgather_dlg_status_show( "" );
        gtk_widget_show( addrgather_dlg.window );
 
index 53aa2b3..c50d9ae 100644 (file)
@@ -26,7 +26,8 @@
 
 /* Function prototypes */
 AddressBookFile *addrgather_dlg_execute( FolderItem *folderItem,
-                                        AddressIndex *addrIndex );
+                                        AddressIndex *addrIndex,
+                                        GList *msgList );
 
 #endif /* __ADDR_GATHER_H__ */
 
index 9658362..c06d717 100644 (file)
@@ -41,7 +41,8 @@ static gchar *_headerCC_       = HEADER_CC;
 static gchar *_headerTo_       = HEADER_TO;
 
 #define ADDR_BUFFSIZE    1024
-#define MSG_BUFFSIZE     16384
+#define MSG_BUFFSIZE     2048
+#define MSGNUM_BUFFSIZE  32
 #define DFL_FOLDER_SIZE  20
 
 /* Noise strings included by some other E-Mail clients */
@@ -314,24 +315,12 @@ static void addrharvest_insert_cache(
                newFolder = TRUE;       /* Folder is full */
        }
 
-       if( newFolder ) {
-               cnt = 1 + ( entry->count / harvester->folderSize );
-               folderName = g_strdup_printf( "%s (%d)", entry->header, cnt );
-               folder = addritem_create_item_folder();
-               addritem_folder_set_name( folder, folderName );
-               addritem_folder_set_remarks( folder, "" );
-               addrcache_id_folder( cache, folder );
-               addrcache_add_folder( cache, folder );
-               entry->folder = folder;
-               g_free( folderName );
-       }
-
        /* Insert address */
        key = g_strdup( address );
        g_strdown( key );
        person = g_hash_table_lookup( harvester->dupTable, key );
        if( person ) {
-               /* Use longest name */
+               /* Update existing person to use longest name */
                value = ADDRITEM_NAME(person);
                if( strlen( name ) > strlen( value ) ) {
                        addritem_person_set_common_name( person, name );
@@ -339,26 +328,42 @@ static void addrharvest_insert_cache(
                g_free( key );
        }
        else {
+               /* Folder if required */
+               if( newFolder ) {
+                       cnt = 1 + ( entry->count / harvester->folderSize );
+                       folderName =g_strdup_printf( "%s (%d)",
+                                       entry->header, cnt );
+                       folder = addritem_create_item_folder();
+                       addritem_folder_set_name( folder, folderName );
+                       addritem_folder_set_remarks( folder, "" );
+                       addrcache_id_folder( cache, folder );
+                       addrcache_add_folder( cache, folder );
+                       entry->folder = folder;
+                       g_free( folderName );
+               }
+
                /* Insert entry */
                person = addrcache_add_contact(
                                cache, folder, name, address, "" );
                g_hash_table_insert( harvester->dupTable, key, person );
                entry->count++;
        }
+       addritem_parse_first_last( person );
 }
 
 /*
  * Remove specified string from name.
  * Enter: name Name.
- *        em   String to remove.
+ *        str  String to remove.
  */
-static void addrharvest_del_email( gchar *name, gchar *em ) {
+static void addrharvest_del_email( gchar *name, gchar *str ) {
        gchar *p;
-       gint ilen;
+       gint lenn, lenr;
 
-       ilen = strlen( em );
-       while( p = strcasestr( name, em )  ) {
-               memmove( p, p + ilen, ilen + 1 );
+       lenr = strlen( str );
+       while( p = strcasestr( name, str )  ) {
+               lenn = strlen( p );
+               memmove( p, p + lenr, lenn );
        }
 }
 
@@ -502,7 +507,7 @@ static void addrharvest_parse_address(
        gchar buffer[ ADDR_BUFFSIZE + 2 ];
        const gchar *bp;
        const gchar *ep;
-       gchar *atCh, *email, *p;
+       gchar *atCh, *email, *name;
        gint bufLen;
 
        /* Search for an address */
@@ -520,13 +525,6 @@ static void addrharvest_parse_address(
                buffer[ bufLen + 1 ] = '\0';
                buffer[ bufLen + 2 ] = '\0';
 
-               /* Make whitespace */
-               p = buffer;
-               while( *p ) {
-                       if( *p == '\r' || *p == '\n' || *p == '\t' ) *p = ' ';
-                       p++;
-               }
-
                /* Extract address from buffer */
                email = addrharvest_extract_address( buffer );
                if( email ) {
@@ -544,15 +542,115 @@ static void addrharvest_parse_address(
                        mgu_str_ltc2space( buffer, '(', ')' );
                        g_strstrip( buffer );
 
+                       if( g_strcasecmp( buffer, email ) == 0 ) {
+                               name = "";
+                       }
+                       else {
+                               name = buffer;
+                       }
+
                        /* Insert into address book */
                        addrharvest_insert_cache(
-                               harvester, entry, cache, buffer, email );
+                               harvester, entry, cache, name, email );
                        g_free( email );
                }
                hdrBuf = ep;
        }
 }
 
+/*
+ * Test whether buffer contains a header that appears in header list.
+ * Enter: listHdr Header list.
+ *        buf     Header buffer.
+ * Return: TRUE if header in list.
+ */
+static gboolean addrharvest_check_hdr( GList *listHdr, gchar *buf ) {
+       gboolean retVal;
+       GList *node;
+       gchar *p, *hdr, *nhdr;
+       gint len;
+
+       retVal = FALSE;
+       p = strchr( buf, ':' );
+       if( p ) {
+               len = ( size_t ) ( p - buf );
+               hdr = g_strndup( buf, len );
+               node = listHdr;
+               while( node ) {
+                       nhdr = node->data;
+                       if( g_strcasecmp( nhdr, hdr ) == 0 ) {
+                               retVal = TRUE;
+                               break;
+                       }
+                       node = g_list_next( node );
+               }
+               g_free( hdr );
+       }
+       return retVal;
+}
+
+/*
+ * Read header into a linked list of lines.
+ * Enter:  fp      File to read.
+ *         listHdr List of header lines of interest.
+ *         done    End of headers or end of file reached.
+ * Return: Linked list of lines.
+ */
+static GSList *addrharvest_get_header( FILE *fp, GList *listHdr, gboolean *done ) {
+       GSList *list;
+       gchar buf[ MSG_BUFFSIZE + 2 ];
+       gint ch;
+       gboolean foundHdr;
+
+       list = NULL;
+
+       /* Read line */
+       if( fgets( buf, MSG_BUFFSIZE, fp ) == NULL ) {
+               *done = TRUE;
+               return list;
+       }
+
+       /* Test for end of headers */
+       if( buf[0] == '\r' || buf[0] == '\n' ) {
+               *done = TRUE;
+               return list;
+       }
+
+       /* Test whether required header */
+       foundHdr = addrharvest_check_hdr( listHdr, buf );
+
+       /* Read all header lines. Only add reqd ones to list */
+       while( TRUE ) {
+               gchar *p;
+
+               if( foundHdr ) {
+                       p = g_strdup( buf );
+                       list = g_slist_append( list, p );
+               }
+
+               /* Read first character */
+               ch = fgetc( fp );
+               if( ch == ' ' || ch == '\t' ) {
+                       /* Continuation character - read into buffer */
+                       if( fgets( buf, MSG_BUFFSIZE, fp ) == NULL ) {
+                               break;
+                       }
+               }
+               else {
+                       if( ch == EOF ) {
+                               *done = TRUE;
+                       }
+                       else {
+                               /* Push back character for next header */
+                               ungetc( ch, fp );
+                       }
+                       break;
+               }
+       }
+
+       return list;
+}
+
 /*
  * Read specified file into address book.
  * Enter:  harvester Harvester object.
@@ -562,12 +660,14 @@ static void addrharvest_parse_address(
  */
 static gint addrharvest_readfile(
                AddressHarvester *harvester, const gchar *fileName,
-               AddressCache *cache )
+               AddressCache *cache, GList *listHdr )
 {
        gint retVal;
        FILE *msgFile;
-       gchar buf[ MSG_BUFFSIZE ], tmp[ MSG_BUFFSIZE ];
+       gchar *buf, *addr, *p;
        HeaderEntry *entry;
+       GSList *list;
+       gboolean done;
 
        msgFile = fopen( fileName, "rb" );
        if( ! msgFile ) {
@@ -576,27 +676,36 @@ static gint addrharvest_readfile(
                return retVal;
        }
 
-       for( ;; ) {
-               gint val;
-               gchar *p;
+       done = FALSE;
+       while( TRUE ) {
+               list = addrharvest_get_header( msgFile, listHdr, &done );
+               if( done ) break;
 
-               val = procheader_get_one_field(
-                       buf, sizeof(buf), msgFile, NULL );
-               if( val == -1 ) {
-                       break;
+               if( list == NULL ) {
+                       continue;
                }
-               conv_unmime_header( tmp, sizeof(tmp), buf, NULL );
-               if(( p = strchr( tmp, ':' ) ) != NULL ) {
-                       const gchar *hdr;
 
+               buf = mgu_list_coalesce( list );
+               mgu_free_list( list );
+
+               if(( p = strchr( buf, ':' ) ) != NULL ) {
+                       addr = p + 1;
                        *p = '\0';
-                       hdr = p + 1;
-                       entry = addrharvest_find( harvester, tmp );
+
+                       entry = addrharvest_find( harvester, buf );
                        if( entry && entry->selected ) {
+                               /* Sanitize control characters */
+                               p = addr;
+                               while( *p ) {
+                                       if( *p == '\r' || *p == '\n' || *p == '\t' )
+                                               *p = ' ';
+                                       p++;
+                               }
                                addrharvest_parse_address(
-                                       harvester, entry, cache, hdr );
+                                       harvester, entry, cache, addr );
                        }
                }
+               g_free( buf );
        }
 
        fclose( msgFile );
@@ -608,15 +717,21 @@ static gint addrharvest_readfile(
  * Read all files in specified directory into address book.
  * Enter:  harvester Harvester object.
  *         cache     Address cache to load.
+ *         msgList   List of message numbers, or NULL to process folder.
  * Return: Status.
  * ============================================================================
  */
-gint addrharvest_harvest( AddressHarvester *harvester, AddressCache *cache ) {
+gint addrharvest_harvest(
+       AddressHarvester *harvester, AddressCache *cache, GList *msgList )
+{
        gint retVal;
        DIR *dp;
        struct dirent *d;
        struct stat s;
        gint num;
+       GList *node;
+       GList *listHdr;
+       gchar msgNum[ MSGNUM_BUFFSIZE ];
 
        retVal = MGU_BAD_ARGS;
        g_return_val_if_fail( harvester != NULL, retVal );
@@ -637,15 +752,47 @@ gint addrharvest_harvest( AddressHarvester *harvester, AddressCache *cache ) {
                return retVal;
        }
 
-       while( ( d = readdir( dp ) ) != NULL ) {
-               stat( d->d_name, &s );
-               if( S_ISREG( s.st_mode ) ) {
-                       if( ( num = to_number( d->d_name ) ) >= 0 ) {
-                               addrharvest_readfile(
-                                       harvester, d->d_name, cache );
+       /* Build list of headers of interest */
+       listHdr = NULL;
+       node = harvester->headerTable;
+       while( node ) {
+               HeaderEntry *entry;
+
+               entry = node->data;
+               if( entry->selected ) {
+                       gchar *p;
+
+                       p = g_strdup( entry->header );
+                       g_strdown( p );
+                       listHdr = g_list_append( listHdr, p );
+               }
+               node = g_list_next( node );
+       }
+
+       if( msgList == NULL ) {
+               /* Process directory */
+               while( ( d = readdir( dp ) ) != NULL ) {
+                       stat( d->d_name, &s );
+                       if( S_ISREG( s.st_mode ) ) {
+                               if( ( num = to_number( d->d_name ) ) >= 0 ) {
+                                       addrharvest_readfile(
+                                               harvester, d->d_name, cache, listHdr );
+                               }
                        }
                }
        }
+       else {
+               /* Process message list */
+               node = msgList;
+               while( node ) {
+                       num = GPOINTER_TO_UINT( node->data );
+                       sprintf( msgNum, "%d", num );
+                       addrharvest_readfile(
+                               harvester, msgNum, cache, listHdr );
+                       node = g_list_next( node );
+               }
+       }
+       mgu_free_dlist( listHdr );
 
        closedir( dp );
 
index ff639a1..061fcce 100644 (file)
@@ -61,7 +61,8 @@ gint addrharvest_get_count            ( AddressHarvester* harvester,
 void addrharvest_print                 ( AddressHarvester *harvester,
                                          FILE *stream );
 gint addrharvest_harvest               ( AddressHarvester *harvester,
-                                         AddressCache *cache );
+                                         AddressCache *cache,
+                                         GList *msgList );
 gboolean addrharvest_check_header      ( AddressHarvester *harvester );
 
 #endif /* __ADDRHARVEST_H__ */
index 0f12f24..84e92e7 100644 (file)
@@ -1071,6 +1071,60 @@ ItemEMail *addritem_move_email_after( ItemPerson *person, ItemEMail *itemMove, I
        return itemMove;
 }
 
+/**
+ * Parse first and last names for person from common name.
+ * Enter: person Person to process.
+ */
+void addritem_parse_first_last( ItemPerson *person ) {
+       gchar *name;
+       gchar *fName, *lName;
+       gchar *p;
+       gint len, i;
+
+       g_return_if_fail( person != NULL );
+
+       name = ADDRITEM_NAME(person);
+       if( name == NULL ) return;
+
+       fName = NULL;
+       lName = NULL;
+       p = strchr( name, ',' );
+       if( p ) {
+               len = ( size_t ) ( p - name );
+               lName = g_strndup( name, len );
+               fName = g_strdup( p + 1 );
+       }
+       else {
+               /* Other way around */
+               i = strlen( name );
+               while( i >= 0 ) {
+                       if( name[i] == ' ' ) {
+                               fName = g_strndup( name, i );
+                               lName = g_strdup( &name[i] );
+                               break;
+                       }
+                       i--;
+               }
+               if( fName == NULL ) {
+                       fName = g_strdup( name );
+               }
+       }
+
+       if( person->firstName ) {
+               g_free( person->firstName );
+       }
+       person->firstName = fName;
+       if( person->firstName )
+               g_strstrip( person->firstName );
+
+       if( person->lastName ) {
+               g_free( person->lastName );
+       }
+       person->lastName = lName;
+       if( person->lastName )
+               g_strstrip( person->lastName );
+}
+
 /*
 * End of Source.
 */
index a90495f..5b494e8 100644 (file)
@@ -174,4 +174,6 @@ GList *addritem_folder_get_group_list       ( ItemFolder *folder );
 ItemEMail *addritem_move_email_before  ( ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget );
 ItemEMail *addritem_move_email_after   ( ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget );
 
+void addritem_parse_first_last         ( ItemPerson *person );
+
 #endif /* __ADDRITEM_H__ */
index d5fc813..2e6af4c 100644 (file)
@@ -461,6 +461,10 @@ static void addr_gather_cb  ( MainWindow  *mainwin,
                                   guint       action,
                                   GtkWidget   *widget );
 
+static void addr_gather_msg_cb  ( MainWindow  *mainwin,
+                                  guint       action,
+                                  GtkWidget   *widget );
+
 #define  SEPARATE_ACTION  667
 
 static GtkItemFactoryEntry mainwin_entries[] =
@@ -677,7 +681,9 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Tools/_Address book..."),        "<shift><control>A", addressbook_open_cb, 0, NULL},
        {N_("/_Tools/Add sender to address boo_k"),
                                                NULL, add_address_cb, 0, NULL},
-       {N_("/_Tools/_Gather addresses..."),    NULL, addr_gather_cb, 0, NULL},
+       {N_("/_Tools/_Gather addresses"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_Tools/_Gather addresses/from _Folder..."),       NULL, addr_gather_cb, 0, NULL},
+       {N_("/_Tools/_Gather addresses/from _Messages..."),     NULL, addr_gather_msg_cb, 0, NULL},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/_Filter messages"),                NULL, filter_cb, 0, NULL},
        {N_("/_Tools/_Create filter rule"),     NULL, NULL, 0, "<Branch>"},
@@ -1601,7 +1607,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
                {"/Tools/Selective download..."     , M_HAVE_ACCOUNT|M_UNLOCKED},
                {"/Tools/Add sender to address book", M_SINGLE_TARGET_EXIST},
-               {"/Tools/Gather addresses..."       , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
+               {"/Tools/Gather addresses"          , M_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Filter messages"           , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
                {"/Tools/Create filter rule"        , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Execute"                   , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
@@ -3103,11 +3109,24 @@ static void set_toolbar_style(MainWindow *mainwin)
        }
 }
 
+/*
+ * Gather addresses for selected folder.
+ */
 static void addr_gather_cb( MainWindow *mainwin,
                            guint action,
                            GtkWidget *widget )
 {
-       addressbook_gather( mainwin->summaryview->folder_item );
+       addressbook_gather( mainwin->summaryview->folder_item, NULL );
+}
+
+/*
+ * Gather addresses for selected messages in summary view.
+ */
+static void addr_gather_msg_cb( MainWindow *mainwin,
+                           guint action,
+                           GtkWidget *widget )
+{
+       summary_gather_address( mainwin->summaryview );
 }
 
 /*
index fff0c19..5e8410a 100644 (file)
@@ -5292,6 +5292,23 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
        folderview_select(summaryview->folderview, summaryview->folder_item);
 }
 
+/*
+ * Gather addresses for selected messages in summary view.
+ */
+void summary_gather_address( SummaryView *summaryview ) {
+       GtkCTree *ctree = GTK_CTREE( summaryview->ctree );
+       GList *cur;
+       GList *msgList;
+       MsgInfo *msginfo;
+
+       msgList = NULL;
+       for( cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next ) {
+               msginfo = gtk_ctree_node_get_row_data( ctree, GTK_CTREE_NODE(cur->data) );
+               msgList = g_list_append( msgList, GUINT_TO_POINTER( msginfo->msgnum ) );
+       }
+       addressbook_gather( summaryview->folder_item, msgList );
+       g_list_free( msgList );
+}
 
 /*
  * End of Source.
index eb7084c..79214dd 100644 (file)
@@ -262,4 +262,7 @@ void summary_toggle_show_read_messages (SummaryView *summaryview);
 void summary_toggle_view_real  (SummaryView    *summaryview);
 
 void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview);
+
+void summary_gather_address    ( SummaryView *summaryview );
+
 #endif /* __SUMMARY_H__ */