changeset 12714:668067774cf5

[gaim-migrate @ 15058] A patch from Jonathan Clark to not allow sending files to ourselves on AIM/ICQ committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 04 Jan 2006 04:37:53 +0000
parents d7043c3c793d
children 3dedbe04a684
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Wed Jan 04 04:19:23 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Jan 04 04:37:53 2006 +0000
@@ -2643,17 +2643,24 @@
  * to this user.
  */
 static gboolean oscar_can_receive_file(GaimConnection *gc, const char *who) {
-	gboolean can_receive = FALSE;
 	OscarData *od = gc->proto_data;
 
 	if (od != NULL) {
 		aim_userinfo_t *userinfo;
 		userinfo = aim_locate_finduserinfo(od->sess, who);
-		if (userinfo && userinfo->capabilities & AIM_CAPS_SENDFILE)
-			can_receive = TRUE;
-	}
-
-	return can_receive;
+
+		/*
+		 * Don't allowing sending a file to a user that does not support
+		 * file transfer, and don't allow sending to ourselves.
+		 */
+		if (userinfo && (userinfo->capabilities & AIM_CAPS_SENDFILE) &&
+			strcmp(who, gc->display_name))
+		{
+			return TRUE;
+		}
+	}
+
+	return FALSE;
 }
 
 static GaimXfer*