[Commits] ldap-plugin.c 1.9 1.10

miras at claws-mail.org miras at claws-mail.org
Mon Nov 28 18:52:16 CET 2011


Update of /home/claws-mail/contacts/plugins/ldap
In directory claws-mail:/tmp/cvs-serv7749/plugins/ldap

Modified Files:
	ldap-plugin.c 
Log Message:
2011-11-28 [mir]	0.6.0cvs29

	* configure.ac
	* plugins/ldap/ldap-plugin.c
	* src/about.c
	* src/callbacks.c
	* src/contactwindow.c
	    Mostly code cleaning.
	    - Fix one memory leak.
	    - Fix building on systems with GTK+2 < 2.24 

Index: ldap-plugin.c
===================================================================
RCS file: /home/claws-mail/contacts/plugins/ldap/ldap-plugin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ldap-plugin.c	28 Nov 2011 07:34:49 -0000	1.9
+++ ldap-plugin.c	28 Nov 2011 17:52:14 -0000	1.10
@@ -950,8 +950,7 @@
         contact = contact_new();
         value = ldap_get_dn(server->ldap, entry);
         debug_print("Found: DN->%s\n", value);
-		AttribDef* attr = pack_data(ATTRIB_TYPE_STRING, "dn", value);
-		g_hash_table_insert(contact->data, g_strdup("dn"), attr);
+		swap_data(contact->data, "dn", value);
         ldap_memfree(value);
         /* Process attributes */
         for (attribute = ldap_first_attribute(server->ldap, entry, &ber);
@@ -974,8 +973,7 @@
                     value = g_strndup(vals[0]->bv_val, vals[0]->bv_len);
                     debug_print("Found (other): %s->%s\n", attribute, value);
                     const gchar* key = ldap2native(attribute);
-					AttribDef* attr = pack_data(ATTRIB_TYPE_STRING, key, value);
-                    g_hash_table_insert(contact->data, g_strdup(key), attr);
+					swap_data(contact->data, key, value);
                     g_free(value);
                 }
             }
@@ -986,7 +984,6 @@
             ber_free(ber, 0);
         }
         ber = NULL;
-        //contact_dump(contact, stderr);
         result = g_list_prepend(result, contact);
     }
     if (count)
@@ -1771,7 +1768,6 @@
 						break;
 					case ATTRIBUTE_DELETE:
 						if (c->type == CONTACT_CHANGE_EMAIL) {							
-							/* email equal dn (make dummy) */
 							SETMOD(mods[row], modarr[row], LDAP_MOD_REPLACE, \
 								g_strdup("mail"), attr[row], extract_email_from_dn(dn));
 							row++;
@@ -2238,7 +2234,6 @@
 	}
 
 	feature->support = PLUGIN_READ_WRITE | PLUGIN_ADVANCED_SEARCH;
-	//feature->support = PLUGIN_READ_ONLY | PLUGIN_ADVANCED_SEARCH;
 	feature->subtype = subtype;
 
 	return feature;



More information about the Commits mailing list