* src/addrindex.[ch]
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 21 Mar 2004 22:34:13 +0000 (22:34 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 21 Mar 2004 22:34:13 +0000 (22:34 +0000)
  src/addr_compl.c
complete addresses on nicks and aliases

ChangeLog.claws
configure.ac
src/addr_compl.c
src/addrindex.c
src/addrindex.h

index 63ace10..31c829d 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-21 [alfons]    0.9.10claws27
+
+       * src/addrindex.[ch]
+         src/addr_compl.c
+               complete addresses on nicks and aliases
+
 2004-03-21 [alfons]    0.9.10claws26
 
        * src/import.c
index e38e4bf..fa17dd1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=26
+EXTRA_VERSION=27
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 603da29..d549e3c 100644 (file)
@@ -179,7 +179,8 @@ static void add_address1(const char *str, address_entry *ae)
  * \return <code>0</code> if entry appended successfully, or <code>-1</code>
  *         if failure.
  */
-static gint add_address(const gchar *name, const gchar *address, const gchar *alias)
+static gint add_address(const gchar *name, const gchar *address, 
+                       const gchar *nick, const gchar *alias)
 {
        address_entry    *ae;
 
@@ -196,7 +197,11 @@ static gint add_address(const gchar *name, const gchar *address, const gchar *al
 
        add_address1(name, ae);
        add_address1(address, ae);
-       if( alias != NULL ) {
+       
+       if (nick != NULL)
+               add_address1(nick, ae);
+       
+       if ( alias != NULL ) {
                add_address1(alias, ae);
        }
 
index 4c19f26..76f0293 100644 (file)
@@ -2805,13 +2805,14 @@ void addrindex_remove_results( AddressDataSource *ds, ItemFolder *folder ) {
  * \return <i>TRUE</i> if data loaded, <i>FALSE</i> if address index not loaded.
  */
 gboolean addrindex_load_completion(
-               gint (*callBackFunc) ( const gchar *, const gchar *, const gchar * ) )
+               gint (*callBackFunc) ( const gchar *, const gchar *, 
+                                      const gchar *, const gchar * ) )
 {
        AddressDataSource *ds;
        GList *nodeIf, *nodeDS;
        GList *listP, *nodeP;
        GList *nodeM;
-       gchar *sName, *sAddress, *sAlias, *sFriendly;
+       gchar *sName;
 
        nodeIf = addrindex_get_interface_list( _addressIndex_ );
        while( nodeIf ) {
@@ -2853,18 +2854,10 @@ gboolean addrindex_load_completion(
                                /* Process each E-Mail address */
                                while( nodeM ) {
                                        ItemEMail *email = nodeM->data;
-                                       /* Have mail */
-                                       sFriendly = sName;
-                                       sAddress = email->address;
-                                       if( sAddress || *sAddress != '\0' ) {
-                                               sAlias = person->nickName;
-                                               // if( sAlias && *sAlias != '\0' ) {
-                                               if( sFriendly == NULL || *sFriendly == '\0' ) {
-                                                       sFriendly = sAlias;
-                                               }
-                                               ( callBackFunc ) ( sFriendly, sAddress, sAlias );
-                                       }
-
+                                       
+                                       callBackFunc( sName, email->address, person->nickName, 
+                                                     ADDRITEM_NAME(email) );
+                                       
                                        nodeM = g_list_next( nodeM );
                                }
                                nodeP = g_list_next( nodeP );
index ef928d0..d58d42f 100644 (file)
@@ -175,7 +175,8 @@ void addrindex_remove_results               ( AddressDataSource *ds,
 
 gboolean addrindex_load_completion(
                gint (*callBackFunc)
-                       ( const gchar *, const gchar *, const gchar * ) );
+                       ( const gchar *, const gchar *, 
+                         const gchar *, const gchar * ) );
 
 #endif /* __ADDRINDEX_H__ */