pidgin: b499ce37: Add a can_receive_file function to the x...

datallah at pidgin.im datallah at pidgin.im
Thu Jun 12 21:10:48 EDT 2008


-----------------------------------------------------------------
Revision: b499ce3771edb822dda585ef37acbafcc48b71f4
Ancestor: de2e7e584bbcedb7ea72ba49adcc0d97c6af9589
Author: datallah at pidgin.im
Date: 2008-06-13T01:08:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b499ce3771edb822dda585ef37acbafcc48b71f4

Modified files:
        libpurple/protocols/jabber/libxmpp.c
        libpurple/protocols/jabber/si.c
        libpurple/protocols/jabber/si.h

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/libxmpp.c	b56db1a878a32e93e80e36ccaa343dc7422f18cf
+++ libpurple/protocols/jabber/libxmpp.c	5c61414de3bd23433393d6e3c1f59fed8ef5ade7
@@ -76,9 +76,9 @@ static PurplePluginProtocolInfo prpl_inf
 	jabber_roster_remove_buddy,		/* remove_buddy */
 	NULL,							/* remove_buddies */
 	NULL,							/* add_permit */
-	jabber_google_roster_add_deny,				/* add_deny */
+	jabber_google_roster_add_deny,	/* add_deny */
 	NULL,							/* rem_permit */
-	jabber_google_roster_rem_deny,				/* rem_deny */
+	jabber_google_roster_rem_deny,	/* rem_deny */
 	NULL,							/* set_permit_deny */
 	jabber_chat_join,				/* join_chat */
 	NULL,							/* reject_chat */
@@ -105,7 +105,7 @@ static PurplePluginProtocolInfo prpl_inf
 	jabber_roomlist_get_list,		/* roomlist_get_list */
 	jabber_roomlist_cancel,			/* roomlist_cancel */
 	NULL,							/* roomlist_expand_category */
-	NULL,							/* can_receive_file */
+	jabber_si_xfer_can_receive_file,/* can_receive_file */
 	jabber_si_xfer_send,			/* send_file */
 	jabber_si_new_xfer,				/* new_xfer */
 	jabber_offline_message,			/* offline_message */
============================================================
--- libpurple/protocols/jabber/si.c	f839bd5f0e4e8b0d5a11bce7a92f357ec1fc37fd
+++ libpurple/protocols/jabber/si.c	441145dd54aa6de5b02c19c76526ecd0f6a75a92
@@ -1205,6 +1205,13 @@ PurpleXfer *jabber_si_new_xfer(PurpleCon
 	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 @@ void jabber_si_xfer_send(PurpleConnectio
 
 	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);
============================================================
--- libpurple/protocols/jabber/si.h	5efdeacc163a9ff870a2234edc0678540596dc74
+++ libpurple/protocols/jabber/si.h	20dcb081bbd316991729ed78fd2974a846e486ec
@@ -28,6 +28,7 @@ void jabber_si_parse(JabberStream *js, x
 
 void jabber_bytestreams_parse(JabberStream *js, xmlnode *packet);
 void jabber_si_parse(JabberStream *js, xmlnode *packet);
+gboolean jabber_si_xfer_can_receive_file(PurpleConnection *conn, const char *who);
 PurpleXfer *jabber_si_new_xfer(PurpleConnection *gc, const char *who);
 void jabber_si_xfer_send(PurpleConnection *gc, const char *who, const char *file);
 


More information about the Commits mailing list