# HG changeset patch # User Mark Doliner # Date 1136349473 0 # Node ID 668067774cf565ff6fd95b2ace7f51fe6868fb21 # Parent d7043c3c793dbca22023d7e31e33fbbe2096c451 [gaim-migrate @ 15058] A patch from Jonathan Clark to not allow sending files to ourselves on AIM/ICQ committer: Tailor Script diff -r d7043c3c793d -r 668067774cf5 src/protocols/oscar/oscar.c --- 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*