changeset 15142:66c857a355b4

[gaim-migrate @ 17927] Stephen Pope in #gaim found a bug in our perl stuff where we were creating some hash tables that used g_direct_hash instead of g_str_hash committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 09 Dec 2006 20:11:43 +0000
parents 05c55c2b6c25
children 4b319b19aa24
files COPYRIGHT libgaim/blist.h libgaim/plugins/perl/common/BuddyList.xs libgaim/plugins/perl/common/Server.xs libgaim/server.h
diffstat 5 files changed, 26 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sat Dec 09 07:39:29 2006 +0000
+++ b/COPYRIGHT	Sat Dec 09 20:11:43 2006 +0000
@@ -241,6 +241,7 @@
 Julien Pivotto
 Ari Pollak
 Robey Pointer
+Stephen Pope
 Nathan Poznick
 Jory A. Pratt
 Brent Priddy
--- a/libgaim/blist.h	Sat Dec 09 07:39:29 2006 +0000
+++ b/libgaim/blist.h	Sat Dec 09 20:11:43 2006 +0000
@@ -314,7 +314,9 @@
  *
  * @param account    The account this chat will get added to
  * @param alias      The alias of the new chat
- * @param components The info the prpl needs to join the chat
+ * @param components The info the prpl needs to join the chat.  The
+ *                   hash function should be g_str_hash() and the
+ *                   equal function should be g_str_equal().
  * @return           A newly allocated chat
  */
 GaimChat *gaim_chat_new(GaimAccount *account, const char *alias, GHashTable *components);
--- a/libgaim/plugins/perl/common/BuddyList.xs	Sat Dec 09 07:39:29 2006 +0000
+++ b/libgaim/plugins/perl/common/BuddyList.xs	Sat Dec 09 20:11:43 2006 +0000
@@ -310,7 +310,7 @@
 	char *t_key, *t_value;
 CODE:
 	t_HV =  (HV *)SvRV(components);
-	t_GHash = g_hash_table_new(NULL, NULL);
+	t_GHash = g_hash_table_new(g_str_hash, g_str_equal);
 
 	for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) {
 		t_key = hv_iterkey(t_HE, &len);
--- a/libgaim/plugins/perl/common/Server.xs	Sat Dec 09 07:39:29 2006 +0000
+++ b/libgaim/plugins/perl/common/Server.xs	Sat Dec 09 20:11:43 2006 +0000
@@ -80,7 +80,7 @@
 	char *t_key, *t_value;
 CODE:
 	t_HV =  (HV *)SvRV(components);
-	t_GHash = g_hash_table_new(NULL, NULL);
+	t_GHash = g_hash_table_new(g_str_hash, g_str_equal);
 
 	for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) {
 		t_key = hv_iterkey(t_HE, &len);
@@ -135,7 +135,7 @@
 	char *t_key, *t_value;
 CODE:
 	t_HV =  (HV *)SvRV(components);
-	t_GHash = g_hash_table_new(NULL, NULL);
+	t_GHash = g_hash_table_new(g_str_hash, g_str_equal);
 
 	for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) {
 		t_key = hv_iterkey(t_HE, &len);
@@ -165,7 +165,7 @@
 	char *t_key, *t_value;
 CODE:
 	t_HV =  (HV *)SvRV(components);
-	t_GHash = g_hash_table_new(NULL, NULL);
+	t_GHash = g_hash_table_new(g_str_hash, g_str_equal);
 
 	for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) {
 		t_key = hv_iterkey(t_HE, &len);
--- a/libgaim/server.h	Sat Dec 09 07:39:29 2006 +0000
+++ b/libgaim/server.h	Sat Dec 09 20:11:43 2006 +0000
@@ -59,8 +59,6 @@
 void serv_rem_permit(GaimConnection *, const char *);
 void serv_rem_deny(GaimConnection *, const char *);
 void serv_set_permit_deny(GaimConnection *);
-void serv_join_chat(GaimConnection *, GHashTable *);
-void serv_reject_chat(GaimConnection *, GHashTable *);
 void serv_chat_invite(GaimConnection *, int, const char *, const char *);
 void serv_chat_leave(GaimConnection *, int);
 void serv_chat_whisper(GaimConnection *, int, const char *, const char *);
@@ -91,9 +89,27 @@
 
 void serv_got_im(GaimConnection *gc, const char *who, const char *msg,
 				 GaimMessageFlags flags, time_t mtime);
+
+/**
+ * @param data The hash function should be g_str_hash() and the equal
+ *             function should be g_str_equal().
+ */
+void serv_join_chat(GaimConnection *, GHashTable *);
+
+/**
+ * @param data The hash function should be g_str_hash() and the equal
+ *             function should be g_str_equal().
+ */
+void serv_reject_chat(GaimConnection *, GHashTable *);
+
+/**
+ * @param data The hash function should be g_str_hash() and the equal
+ *             function should be g_str_equal().
+ */
 void serv_got_chat_invite(GaimConnection *gc, const char *name,
 						  const char *who, const char *message,
 						  GHashTable *data);
+
 GaimConversation *serv_got_joined_chat(GaimConnection *gc,
 									   int id, const char *name);
 void serv_got_chat_left(GaimConnection *g, int id);