/cpw/tomkiewicz/gg11: 923e68d55690: Gadu-Gadu: we are not allowe...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Wed Nov 7 12:45:01 EST 2012


Changeset: 923e68d55690336eaed66579b1ac0452c0f6640f
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-11-07 18:44 +0100
Branch:	 default
URL: http://hg.pidgin.im/cpw/tomkiewicz/gg11/rev/923e68d55690

Description:

Gadu-Gadu: we are not allowed to send files to everyone

diffstat:

 libpurple/protocols/gg/edisc.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (23 lines):

diff --git a/libpurple/protocols/gg/edisc.c b/libpurple/protocols/gg/edisc.c
--- a/libpurple/protocols/gg/edisc.c
+++ b/libpurple/protocols/gg/edisc.c
@@ -351,7 +351,18 @@ static void ggp_edisc_xfer_send_done(Pur
 gboolean ggp_edisc_xfer_can_receive_file(PurpleConnection *gc,
 	const char *who)
 {
-	return TRUE; /* TODO: only online, buddies (?) */
+	PurpleBuddy *buddy;
+
+	g_return_val_if_fail(gc != NULL, FALSE);
+	g_return_val_if_fail(who != NULL, FALSE);
+
+	buddy = purple_find_buddy(purple_connection_get_account(gc), who);
+	if (buddy == NULL)
+		return FALSE;
+
+	/* TODO: check, if this buddy have us on his list */
+
+	return PURPLE_BUDDY_IS_ONLINE(buddy);
 }
 
 static void ggp_edisc_xfer_send_init(PurpleXfer *xfer)



More information about the Commits mailing list