changeset 22832:4409f8a0d7aa

merge of 'ac789033b0d69b98d5985567ad5d3579bde9af12' and 'cce9dfe291731b6645ed3a637f1cf895cdeb57f3'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 07 May 2008 02:53:21 +0000
parents 28005860d2c9 (current diff) 9089d36d64c9 (diff)
children af577b5a6aac ac567757d236
files
diffstat 15 files changed, 87 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntrequest.c	Wed May 07 00:35:55 2008 +0000
+++ b/finch/gntrequest.c	Wed May 07 02:53:21 2008 +0000
@@ -104,7 +104,8 @@
 static GntWidget *
 setup_button_box(GntWidget *win, gpointer userdata, gpointer cb, gpointer data, ...)
 {
-	GntWidget *box, *button;
+	GntWidget *box;
+	GntWidget *button = NULL;
 	va_list list;
 	const char *text;
 	gpointer callback;
@@ -124,7 +125,8 @@
 		g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(cb), data);
 	}
 
-	g_object_set_data(G_OBJECT(button), "cancellation-function", GINT_TO_POINTER(TRUE));
+	if (button)
+		g_object_set_data(G_OBJECT(button), "cancellation-function", GINT_TO_POINTER(TRUE));
 
 	va_end(list);
 	return box;
--- a/finch/libgnt/gntwm.c	Wed May 07 00:35:55 2008 +0000
+++ b/finch/libgnt/gntwm.c	Wed May 07 02:53:21 2008 +0000
@@ -101,7 +101,9 @@
 static gboolean idle_update;
 static GList *act = NULL; /* list of WS with unseen activitiy */
 static gboolean ignore_keys = FALSE;
+#ifdef USE_PYTHON
 static gboolean started_python = FALSE;
+#endif
 
 static GList *
 g_list_bring_to_front(GList *list, gpointer data)
--- a/libpurple/protocols/oscar/family_admin.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_admin.c	Wed May 07 02:53:21 2008 +0000
@@ -28,16 +28,15 @@
 
 #include "oscar.h"
 
-/*
+/**
  * Subtype 0x0002 - Request a bit of account info.
  *
  * Info should be one of the following:
  * 0x0001 - Screen name formatting
  * 0x0011 - Email address
  * 0x0013 - Unknown
- *
  */
-int
+void
 aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info)
 {
 	ByteStream bs;
@@ -48,22 +47,19 @@
 	byte_stream_put16(&bs, info);
 	byte_stream_put16(&bs, 0x0000);
 
-	snacid = aim_cachesnac(od, 0x0007, 0x0002, 0x0000, NULL, 0);	
-	flap_connection_send_snac(od, conn, 0x0007, 0x0002, 0x0000, snacid, &bs);	
+	snacid = aim_cachesnac(od, 0x0007, 0x0002, 0x0000, NULL, 0);
+	flap_connection_send_snac(od, conn, 0x0007, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
-/*
+/**
  * Subtypes 0x0003 and 0x0005 - Parse account info.
  *
  * Called in reply to both an information request (subtype 0x0002) and
  * an information change (subtype 0x0004).
- *
  */
-static int
+static void
 infochange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -112,15 +108,12 @@
 	g_free(sn);
 	g_free(url);
 	g_free(email);
-
-	return 1;
 }
 
-/*
+/**
  * Subtype 0x0004 - Set screenname formatting.
- *
  */
-int
+void
 aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick)
 {
 	ByteStream bs;
@@ -138,15 +131,12 @@
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
-/*
+/**
  * Subtype 0x0004 - Change password.
- *
  */
-int
+void
 aim_admin_changepasswd(OscarData *od, FlapConnection *conn, const char *newpw, const char *curpw)
 {
 	ByteStream bs;
@@ -167,14 +157,13 @@
 	snacid = aim_cachesnac(od, 0x0007, 0x0004, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
-	return 0;
+	byte_stream_destroy(&bs);
 }
 
-/*
+/**
  * Subtype 0x0004 - Change email address.
- *
  */
-int
+void
 aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail)
 {
 	ByteStream bs;
@@ -192,8 +181,6 @@
 	flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-
-	return 0;
 }
 
 /*
@@ -210,9 +197,8 @@
 	aim_genericreq_n(od, conn, 0x0007, 0x0006);
 }
 
-/*
+/**
  * Subtype 0x0007 - Account confirmation request acknowledgement.
- *
  */
 static int
 accountconfirm(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
@@ -238,9 +224,10 @@
 static int
 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
 {
-	if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005))
-		return infochange(od, conn, mod, frame, snac, bs);
-	else if (snac->subtype == 0x0007)
+	if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005)) {
+		infochange(od, conn, mod, frame, snac, bs);
+		return 1;
+	} else if (snac->subtype == 0x0007)
 		return accountconfirm(od, conn, mod, frame, snac, bs);
 
 	return 0;
--- a/libpurple/protocols/oscar/family_bart.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_bart.c	Wed May 07 02:53:21 2008 +0000
@@ -57,9 +57,9 @@
 
 	snacid = aim_cachesnac(od, 0x0010, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0010, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_chat.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_chat.c	Wed May 07 02:53:21 2008 +0000
@@ -435,7 +435,7 @@
 	flap_connection_send_snac(od, conn, 0x000e, 0x0005, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_feedbag.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Wed May 07 02:53:21 2008 +0000
@@ -1690,7 +1690,7 @@
 	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG)) || !sn)
 		return -EINVAL;
 
-	byte_stream_new(&bs, 1+strlen(sn)+2+(msg ? strlen(msg)+1 : 0)+2);
+	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? strlen(msg)+1 : 0) + 2);
 
 	/* Screen name */
 	byte_stream_put8(&bs, strlen(sn));
@@ -1764,7 +1764,7 @@
 	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG)) || !sn)
 		return -EINVAL;
 
-	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? (strlen(msg)+1) : 0) + 2);
+	byte_stream_new(&bs, 1+strlen(sn) + 2+(msg ? strlen(msg)+1 : 0) + 2);
 
 	/* Screen name */
 	byte_stream_put8(&bs, strlen(sn));
@@ -1864,7 +1864,7 @@
 	flap_connection_send_snac(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_SENDAUTHREP, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_icbm.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_icbm.c	Wed May 07 02:53:21 2008 +0000
@@ -184,9 +184,9 @@
 
 	snacid = aim_cachesnac(od, 0x0004, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0004, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -520,7 +520,7 @@
 	aim_tlvlist_free(outer_tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 
 	return 0;
@@ -592,7 +592,7 @@
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -685,7 +685,7 @@
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -728,7 +728,7 @@
 	aim_tlvlist_write(&hdrbs, &inner_tlvlist);
 
 	aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data);
-	g_free(hdrbs.data);
+	byte_stream_destroy(&hdrbs);
 
 	aim_tlvlist_write(&bs, &outer_tlvlist);
 
@@ -772,7 +772,7 @@
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /**
@@ -945,20 +945,20 @@
 
 	if (filename != NULL)
 	{
-		ByteStream bs;
+		ByteStream inner_bs;
 
 		/* Begin TLV t(2711) */
-		byte_stream_new(&bs, 2+2+4+strlen(filename)+1);
-		byte_stream_put16(&bs, (numfiles > 1) ? 0x0002 : 0x0001);
-		byte_stream_put16(&bs, numfiles);
-		byte_stream_put32(&bs, size);
+		byte_stream_new(&inner_bs, 2+2+4+strlen(filename)+1);
+		byte_stream_put16(&inner_bs, (numfiles > 1) ? 0x0002 : 0x0001);
+		byte_stream_put16(&inner_bs, numfiles);
+		byte_stream_put32(&inner_bs, size);
 
 		/* Filename - NULL terminated, for some odd reason */
-		byte_stream_putstr(&bs, filename);
-		byte_stream_put8(&bs, 0x00);
-
-		aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, bs.len, bs.data);
-		byte_stream_destroy(&bs);
+		byte_stream_putstr(&inner_bs, filename);
+		byte_stream_put8(&inner_bs, 0x00);
+
+		aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, inner_bs.len, inner_bs.data);
+		byte_stream_destroy(&inner_bs);
 		/* End TLV t(2711) */
 	}
 
@@ -1163,7 +1163,7 @@
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -1232,7 +1232,7 @@
 	flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -2339,7 +2339,7 @@
 	aim_tlvlist_free(tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 
 	return 0;
@@ -2716,7 +2716,7 @@
 	flap_connection_send_snac(od, conn, 0x0004, 0x0014, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_icq.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_icq.c	Wed May 07 02:53:21 2008 +0000
@@ -260,9 +260,9 @@
 	byte_stream_putle32(&bs, atoi(uin));
 
 	flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	/* Keep track of this request and the ICQ number and request ID */
 	info = (struct aim_icq_info *)g_new0(struct aim_icq_info, 1);
 	info->reqid = snacid;
@@ -343,9 +343,9 @@
 	byte_stream_putraw(&bs, (guint8 *)xml, strlen(xml) + 1);
 
 	flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 #endif
--- a/libpurple/protocols/oscar/family_locate.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_locate.c	Wed May 07 02:53:21 2008 +0000
@@ -1353,7 +1353,7 @@
 	aim_tlvlist_free(tlvlist);
 
 	flap_connection_send_snac(od, conn, 0x0002, 0x000f, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 	return 0;
 }
--- a/libpurple/protocols/oscar/family_odir.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_odir.c	Wed May 07 02:53:21 2008 +0000
@@ -130,7 +130,7 @@
 	flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -165,9 +165,9 @@
 
 	snacid = aim_cachesnac(od, 0x000f, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_oservice.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_oservice.c	Wed May 07 02:53:21 2008 +0000
@@ -56,7 +56,7 @@
 
 	snacid = aim_cachesnac(od, 0x0001, 0x0002, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0002, 0x0000, snacid, &bs);
-	
+
 	byte_stream_destroy(&bs);
 }
 
@@ -150,7 +150,7 @@
 	flap_connection_send_snac(od, conn, 0x0001, 0x0004, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -392,7 +392,7 @@
 	snacid = aim_cachesnac(od, 0x0001, 0x0008, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0008, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /* Subtype 0x0009 - Delete Rate Parameter */
@@ -415,7 +415,7 @@
 	snacid = aim_cachesnac(od, 0x0001, 0x0009, 0x0000, NULL, 0);
 	flap_connection_send_snac(od, conn, 0x0001, 0x0009, 0x0000, snacid, &bs);
 
-	byte_stream_destroy(&bs);	
+	byte_stream_destroy(&bs);
 }
 
 /* Subtype 0x000a - Rate Change */
@@ -865,7 +865,7 @@
 	flap_connection_send_snac(od, conn, 0x0001, 0x001e, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
@@ -1016,7 +1016,7 @@
 	flap_connection_send_snac(od, conn, 0x0001, 0x0020, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/family_userlookup.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/family_userlookup.c	Wed May 07 02:53:21 2008 +0000
@@ -78,7 +78,7 @@
 	flap_connection_send_snac(od, conn, 0x000a, 0x0002, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
-	
+
 	return 0;
 }
 
--- a/libpurple/protocols/oscar/flap_connection.c	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/flap_connection.c	Wed May 07 02:53:21 2008 +0000
@@ -115,7 +115,7 @@
 	conn = data;
 	gettimeofday(&now, NULL);
 
-	purple_debug_info("oscar", "Attempting to send %i queued SNACs for %p\n", g_queue_get_length(conn->queued_snacs), conn);
+	purple_debug_info("oscar", "Attempting to send %u queued SNACs for %p\n", g_queue_get_length(conn->queued_snacs), conn);
 	while (!g_queue_is_empty(conn->queued_snacs))
 	{
 		QueuedSnac *queued_snac;
@@ -201,7 +201,7 @@
 			rateclass->last.tv_usec = now.tv_usec;
 		}
 	} else {
-		purple_debug_warning("oscar", "No rate class found for family %u subtype %u\n", family, subtype);
+		purple_debug_warning("oscar", "No rate class found for family %hu subtype %hu\n", family, subtype);
 	}
 
 	if (enqueue)
--- a/libpurple/protocols/oscar/oscar.h	Wed May 07 00:35:55 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.h	Wed May 07 02:53:21 2008 +0000
@@ -1350,11 +1350,11 @@
 
 /* 0x0017 - family_auth.c */
 void aim_sendcookie(OscarData *, FlapConnection *, const guint16 length, const guint8 *);
-int aim_admin_changepasswd(OscarData *, FlapConnection *, const char *newpw, const char *curpw);
+void aim_admin_changepasswd(OscarData *, FlapConnection *, const char *newpw, const char *curpw);
 void aim_admin_reqconfirm(OscarData *od, FlapConnection *conn);
-int aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info);
-int aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail);
-int aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick);
+void aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info);
+void aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail);
+void aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick);
 
 
 
--- a/pidgin/gtknotify.c	Wed May 07 00:35:55 2008 +0000
+++ b/pidgin/gtknotify.c	Wed May 07 02:53:21 2008 +0000
@@ -52,6 +52,7 @@
 	GtkWidget *label;
 	GtkTreeIter iter;
 	int count;
+	gboolean purple_has_handle;
 } PidginNotifyMailData;
 
 typedef struct
@@ -100,6 +101,8 @@
 									const char **froms, const char **tos,
 									const char **urls);
 
+static void pidgin_close_notify(PurpleNotifyType type, void *ui_handle);
+
 static void
 message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget)
 {
@@ -144,7 +147,10 @@
 				purple_notify_uri(NULL, data->url);
 
 			gtk_tree_store_remove(dialog->treemodel, &iter);
-			purple_notify_close(PURPLE_NOTIFY_EMAILS, data);
+			if (data->purple_has_handle)
+				purple_notify_close(PURPLE_NOTIFY_EMAILS, data);
+			else
+				pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data);
 		}
 	}
 	gtk_widget_destroy(dialog->dialog);
@@ -465,6 +471,7 @@
 
 	if (new_n) {
 		data = g_new0(PidginNotifyMailData, 1);
+		data->purple_has_handle = TRUE;
 		gtk_tree_store_append(treemodel, &iter, NULL);
 	}
 
@@ -479,6 +486,8 @@
 	data->iter = iter;              /* XXX: Do we use this for something? */
 	data->account = account;
 	data->count = count;
+
+	/* Why is this necessary?*/
 	gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter,
 						PIDGIN_MAIL_DATA, &data, -1);
 	if (icon)
@@ -540,6 +549,9 @@
 			g_free(from_text);
 			g_free(subject_text);
 
+			/* If we don't keep track of this, will leak "data" for each of the notifications except the last */
+			if (data)
+				data->purple_has_handle = FALSE;
 			data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE);
 			g_free(notification);
 
@@ -588,7 +600,7 @@
 	} else if (!GTK_WIDGET_HAS_FOCUS(dialog))
 		pidgin_set_urgent(GTK_WINDOW(dialog), TRUE);
 
-	return NULL;
+	return data;
 }
 
 static gboolean
@@ -807,6 +819,7 @@
 		col_types[i] = G_TYPE_STRING;
 	}
 	model = gtk_list_store_newv(col_num, col_types);
+	g_free(col_types);
 
 	/* Setup the scrolled window containing the treeview */
 	sw = gtk_scrolled_window_new(NULL, NULL);