comparison src/protocols/oscar/oscar.c @ 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 f5c72fd691ee
children 20f5daedcccb
comparison
equal deleted inserted replaced
12713:d7043c3c793d 12714:668067774cf5
2641 /* 2641 /*
2642 * Called by the Gaim core to determine whether or not we're allowed to send a file 2642 * Called by the Gaim core to determine whether or not we're allowed to send a file
2643 * to this user. 2643 * to this user.
2644 */ 2644 */
2645 static gboolean oscar_can_receive_file(GaimConnection *gc, const char *who) { 2645 static gboolean oscar_can_receive_file(GaimConnection *gc, const char *who) {
2646 gboolean can_receive = FALSE;
2647 OscarData *od = gc->proto_data; 2646 OscarData *od = gc->proto_data;
2648 2647
2649 if (od != NULL) { 2648 if (od != NULL) {
2650 aim_userinfo_t *userinfo; 2649 aim_userinfo_t *userinfo;
2651 userinfo = aim_locate_finduserinfo(od->sess, who); 2650 userinfo = aim_locate_finduserinfo(od->sess, who);
2652 if (userinfo && userinfo->capabilities & AIM_CAPS_SENDFILE) 2651
2653 can_receive = TRUE; 2652 /*
2654 } 2653 * Don't allowing sending a file to a user that does not support
2655 2654 * file transfer, and don't allow sending to ourselves.
2656 return can_receive; 2655 */
2656 if (userinfo && (userinfo->capabilities & AIM_CAPS_SENDFILE) &&
2657 strcmp(who, gc->display_name))
2658 {
2659 return TRUE;
2660 }
2661 }
2662
2663 return FALSE;
2657 } 2664 }
2658 2665
2659 static GaimXfer* 2666 static GaimXfer*
2660 oscar_new_xfer(GaimConnection *gc, const char *who) { 2667 oscar_new_xfer(GaimConnection *gc, const char *who) {
2661 OscarData *od; 2668 OscarData *od;