changeset 30133:0665d7eff0a3

gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676 committer: Paul Aurich <paul@darkrain42.org>
author kkszysiu@gmail.com
date Tue, 13 Apr 2010 06:03:35 +0000
parents 098ee47b858c
children 0c764778c765 62cc2156961f
files libpurple/protocols/gg/gg.c libpurple/protocols/gg/lib/events.c libpurple/protocols/gg/lib/libgadu.c
diffstat 3 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/gg/gg.c	Tue Apr 13 04:33:47 2010 +0000
+++ b/libpurple/protocols/gg/gg.c	Tue Apr 13 06:03:35 2010 +0000
@@ -1000,7 +1000,6 @@
 				       int status, const char *descr)
 {
 	gchar *from;
-	gchar *msg;
 	const char *st;
 	gchar *avatarurl;
 	PurpleUtilFetchUrlData *url_data;
@@ -1048,11 +1047,14 @@
 
 	purple_debug_info("gg", "st = %s\n", st);
 	//msg = charset_convert(descr, "CP1250", "UTF-8");
-	msg = g_strdup_printf("%s", descr);
-	purple_prpl_got_user_status(purple_connection_get_account(gc),
-				  from, st, "message", msg, NULL);
+	if (descr == NULL) {
+		purple_prpl_got_user_status(purple_connection_get_account(gc),
+		      from, st, NULL);
+	} else {
+		purple_prpl_got_user_status(purple_connection_get_account(gc),
+		    from, st, "message", descr, NULL);
+	}
 	g_free(from);
-	g_free(msg);
 }
 
 static void ggp_sr_close_cb(gpointer user_data)
@@ -1608,12 +1610,12 @@
 				purple_debug_info("gg",
 					"notify60: (%d) status=%d; version=%d; descr=%s\n",
 					ev->event.notify60[i].uin,
-					ev->event.notify60[i].status,
+					GG_S(ev->event.notify60[i].status),
 					ev->event.notify60[i].version,
 					ev->event.notify60[i].descr ? ev->event.notify60[i].descr : "(null)");
 
 				ggp_generic_status_handler(gc, ev->event.notify60[i].uin,
-					ev->event.notify60[i].status,
+					GG_S(ev->event.notify60[i].status),
 					ev->event.notify60[i].descr);
 			}
 			break;
@@ -1623,7 +1625,7 @@
 					ev->event.status.descr ? ev->event.status.descr : "(null)");
 
 			ggp_generic_status_handler(gc, ev->event.status.uin,
-				ev->event.status.status, ev->event.status.descr);
+				GG_S(ev->event.status.status), ev->event.status.descr);
 			break;
 		case GG_EVENT_STATUS60:
 			purple_debug_info("gg",
--- a/libpurple/protocols/gg/lib/events.c	Tue Apr 13 04:33:47 2010 +0000
+++ b/libpurple/protocols/gg/lib/events.c	Tue Apr 13 06:03:35 2010 +0000
@@ -1143,7 +1143,7 @@
 		case GG_NOTIFY_REPLY80:
 		{
 			struct gg_notify_reply80 *n = (void*) p;
-			int length = h->length, i = 0;
+			unsigned int length = h->length, i = 0;
 
 			gg_debug_session(sess, GG_DEBUG_MISC, "// gg_watch_fd_connected() received a notify reply\n");
 
--- a/libpurple/protocols/gg/lib/libgadu.c	Tue Apr 13 04:33:47 2010 +0000
+++ b/libpurple/protocols/gg/lib/libgadu.c	Tue Apr 13 06:03:35 2010 +0000
@@ -412,7 +412,8 @@
 {
 	struct gg_header h;
 	char *buf = NULL;
-	int ret = 0, offset, size = 0;
+	int ret = 0;
+	unsigned int offset, size = 0;
 
 	gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_recv_packet(%p);\n", sess);
 
@@ -609,7 +610,7 @@
 	h->length = gg_fix32(tmp_length - sizeof(struct gg_header));
 
 	if ((gg_debug_level & GG_DEBUG_DUMP)) {
-		int i;
+		unsigned int i;
 
 		gg_debug_session(sess, GG_DEBUG_DUMP, "// gg_send_packet(0x%.2x)", gg_fix32(h->type));
 		for (i = 0; i < tmp_length; ++i)