im.pidgin.pidgin.2.2.2: 64c3a017ca5284dc55af3ffe7f9dad00a5a28b95

lschiere at pidgin.im lschiere at pidgin.im
Fri Oct 19 17:12:26 EDT 2007


-----------------------------------------------------------------
Revision: 64c3a017ca5284dc55af3ffe7f9dad00a5a28b95
Ancestor: 34e9ce04ae92189b671fca4e29302f691c01c65d
Author: lschiere at pidgin.im
Date: 2007-10-19T17:09:19
Branch: im.pidgin.pidgin.2.2.2

Modified files:
        libpurple/protocols/gg/buddylist.c

ChangeLog: 

applied changes from 45b8a011cd84e0e69d7ac5a6fb84f55cdb0809cb
             through c180c5d69d4c73b8c1f08f48824d93fbeb3b44e8

-------------- next part --------------
============================================================
--- libpurple/protocols/gg/buddylist.c	aa1eb8a29f943a90c6fb14c0f6934123fc6b8730
+++ libpurple/protocols/gg/buddylist.c	353535de7d31ded3a69e0486d86d6d22604f31e6
@@ -27,6 +27,13 @@
 #include "gg-utils.h"
 #include "buddylist.h"
 
+#define F_FIRSTNAME 0
+#define F_LASTNAME 1
+/* #define F_ 2 */
+#define F_NICKNAME 3
+#define F_PHONE 4
+#define F_GROUP 5
+#define F_UIN 6
 
 /* void ggp_buddylist_send(PurpleConnection *gc) {{{ */
 void ggp_buddylist_send(PurpleConnection *gc)
@@ -90,7 +97,7 @@ void ggp_buddylist_load(PurpleConnection
 	gchar **users_tbl;
 	int i;
 
-	/* Don't limit a number of records in a buddylist. */
+	/* Don't limit the number of records in a buddylist. */
 	users_tbl = g_strsplit(buddylist, "\r\n", -1);
 
 	for (i = 0; users_tbl[i] != NULL; i++) {
@@ -108,8 +115,8 @@ void ggp_buddylist_load(PurpleConnection
 			continue;
 		}
 
-		show = charset_convert(data_tbl[3], "CP1250", "UTF-8");
-		name = data_tbl[6];
+		show = charset_convert(data_tbl[F_NICKNAME], "CP1250", "UTF-8");
+		name = data_tbl[F_UIN];
 		if ('\0' == *name) {
 			purple_debug_warning("gg",
 				"Something is wrong on line %d of the buddylist. Skipping.\n",
@@ -121,7 +128,7 @@ void ggp_buddylist_load(PurpleConnection
 			show = g_strdup(name);
 		}
 
-		purple_debug_info("gg", "got buddy: name=%s show=%s\n", name, show);
+		purple_debug_info("gg", "got buddy: name=%s; show=%s\n", name, show);
 
 		if (purple_find_buddy(purple_connection_get_account(gc), name)) {
 			g_free(show);
@@ -131,19 +138,19 @@ void ggp_buddylist_load(PurpleConnection
 
 		g = g_strdup("Gadu-Gadu");
 
-		if ('\0' != data_tbl[5]) {
+		if ('\0' != data_tbl[F_GROUP]) {
 			/* XXX: Probably buddy should be added to all the groups. */
 			/* Hard limit to at most 50 groups */
-			gchar **group_tbl = g_strsplit(data_tbl[5], ",", 50);
+			gchar **group_tbl = g_strsplit(data_tbl[F_GROUP], ",", 50);
 			if (ggp_array_size(group_tbl) > 0) {
 				g_free(g);
-				g = g_strdup(group_tbl[0]);
+				g = charset_convert(group_tbl[0], "CP1250", "UTF-8");
 			}
 			g_strfreev(group_tbl);
 		}
 
 		buddy = purple_buddy_new(purple_connection_get_account(gc), name,
-				       strlen(show) ? show : NULL);
+					 strlen(show) ? show : NULL);
 
 		if (!(group = purple_find_group(g))) {
 			group = purple_group_new(g);
@@ -159,7 +166,6 @@ void ggp_buddylist_load(PurpleConnection
 	g_strfreev(users_tbl);
 
 	ggp_buddylist_send(gc);
-
 }
 /* }}} */
 
@@ -192,8 +198,7 @@ void ggp_buddylist_offline(PurpleConnect
 					continue;
 
 				purple_prpl_got_user_status(
-					purple_connection_get_account(gc),
-					buddy->name, "offline", NULL);
+					account, buddy->name, "offline", NULL);
 
 				purple_debug_info("gg",
 					"ggp_buddylist_offline: gone: %s\n",


More information about the Commits mailing list