diff libpurple/protocols/jabber/si.c @ 23354:d33fcdbd6ebc

Add a can_receive_file function to the xmpp prpl so that we disable the menu item when it is not going to succeed. References #6078.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 13 Jun 2008 01:08:31 +0000
parents dd195003288a
children bc3ecda40397
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c	Thu Jun 12 16:34:53 2008 +0000
+++ b/libpurple/protocols/jabber/si.c	Fri Jun 13 01:08:31 2008 +0000
@@ -1205,6 +1205,13 @@
 	return xfer;
 }
 
+gboolean jabber_si_xfer_can_receive_file(PurpleConnection *conn, const char *who)
+{
+	JabberStream *js = conn->proto_data;
+
+	return purple_find_buddy(conn->account, who) && jabber_buddy_find(js, who, FALSE);
+}
+	
 void jabber_si_xfer_send(PurpleConnection *gc, const char *who, const char *file)
 {
 	JabberStream *js;
@@ -1213,7 +1220,7 @@
 
 	js = gc->proto_data;
 
-	if(!purple_find_buddy(gc->account, who) || !jabber_buddy_find(js, who, FALSE))
+	if (!jabber_si_xfer_can_receive_file(gc, who))
 		return;
 
 	xfer = jabber_si_new_xfer(gc, who);