Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 7650:6db061321ec4
[gaim-migrate @ 8293]
I completely reverted the dnd sendfile stuff. I thought most of it was
pretty decent. The parts for adding the sendfile option to the conv
window looked good to me. I can't comment on the dnd stuff.
In oscar.c, I didn't see a need to duplicate the oscar_ask_sendfile
function. I also don't think the right click->send file option
should have been removed... but that's just one man's opinion.
Sean, could you please talk to Chip and/or the author of this patch
and work towards making it acceptable by you?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 28 Nov 2003 19:30:45 +0000 |
parents | 6a4d65df3f1c |
children | 8a826b27fcfb |
comparison
equal
deleted
inserted
replaced
7649:7762b3bdfe09 | 7650:6db061321ec4 |
---|---|
1023 | 1023 |
1024 /* Now perform the request */ | 1024 /* Now perform the request */ |
1025 gaim_xfer_request(xfer); | 1025 gaim_xfer_request(xfer); |
1026 } | 1026 } |
1027 | 1027 |
1028 static void oscar_sendfile(GaimConnection *gc, const char *destsn, const char *file) { | |
1029 OscarData *od = (OscarData *)gc->proto_data; | |
1030 GaimXfer *xfer; | |
1031 struct aim_oft_info *oft_info; | |
1032 | |
1033 /* You want to send a file to someone else, you're so generous */ | |
1034 | |
1035 /* Build the file transfer handle */ | |
1036 xfer = gaim_xfer_new(gaim_connection_get_account(gc), GAIM_XFER_SEND, destsn); | |
1037 xfer->local_port = 5190; | |
1038 | |
1039 /* Create the oscar-specific data */ | |
1040 oft_info = aim_oft_createinfo(od->sess, NULL, destsn, xfer->local_ip, xfer->local_port, 0, 0, NULL); | |
1041 xfer->data = oft_info; | |
1042 | |
1043 /* Setup our I/O op functions */ | |
1044 gaim_xfer_set_init_fnc(xfer, oscar_xfer_init); | |
1045 gaim_xfer_set_start_fnc(xfer, oscar_xfer_start); | |
1046 gaim_xfer_set_end_fnc(xfer, oscar_xfer_end); | |
1047 gaim_xfer_set_cancel_send_fnc(xfer, oscar_xfer_cancel_send); | |
1048 gaim_xfer_set_cancel_recv_fnc(xfer, oscar_xfer_cancel_recv); | |
1049 gaim_xfer_set_ack_fnc(xfer, oscar_xfer_ack); | |
1050 | |
1051 /* Keep track of this transfer for later */ | |
1052 od->file_transfers = g_slist_append(od->file_transfers, xfer); | |
1053 | |
1054 /* We don't need to request, since it has already been accepted */ | |
1055 gaim_xfer_request_accepted (xfer, g_strdup(file)); | |
1056 } | |
1057 | |
1058 static gboolean oscar_has_sendfile (GaimConnection *gc, const char *who) | |
1059 { | |
1060 GaimBuddy *b = NULL; | |
1061 aim_userinfo_t *userinfo; | |
1062 OscarData *od = gc->proto_data; | |
1063 | |
1064 if(who) | |
1065 b = gaim_find_buddy(gc->account, who); | |
1066 | |
1067 if (b) | |
1068 userinfo = aim_locate_finduserinfo(od->sess, b->name); | |
1069 | |
1070 if(userinfo) { | |
1071 /* True if we can send files to this dude, false if we can't */ | |
1072 return userinfo->capabilities & AIM_CAPS_SENDFILE; | |
1073 } | |
1074 else | |
1075 return FALSE; | |
1076 | |
1077 } | |
1078 | |
1079 static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { | 1028 static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { |
1080 GaimConnection *gc = sess->aux_data; | 1029 GaimConnection *gc = sess->aux_data; |
1081 OscarData *od = gc->proto_data; | 1030 OscarData *od = gc->proto_data; |
1082 GaimAccount *account = gc->account; | 1031 GaimAccount *account = gc->account; |
1083 aim_conn_t *bosconn; | 1032 aim_conn_t *bosconn; |
6276 pbm->label = _("Direct IM"); | 6225 pbm->label = _("Direct IM"); |
6277 pbm->callback = oscar_ask_direct_im; | 6226 pbm->callback = oscar_ask_direct_im; |
6278 pbm->gc = gc; | 6227 pbm->gc = gc; |
6279 m = g_list_append(m, pbm); | 6228 m = g_list_append(m, pbm); |
6280 } | 6229 } |
6230 | |
6231 if (userinfo->capabilities & AIM_CAPS_SENDFILE) { | |
6232 pbm = g_new0(struct proto_buddy_menu, 1); | |
6233 pbm->label = _("Send File"); | |
6234 pbm->callback = oscar_ask_sendfile; | |
6235 pbm->gc = gc; | |
6236 m = g_list_append(m, pbm); | |
6237 } | |
6281 #if 0 | 6238 #if 0 |
6282 if (userinfo->capabilities & AIM_CAPS_GETFILE) { | 6239 if (userinfo->capabilities & AIM_CAPS_GETFILE) { |
6283 pbm = g_new0(struct proto_buddy_menu, 1); | 6240 pbm = g_new0(struct proto_buddy_menu, 1); |
6284 pbm->label = _("Get File"); | 6241 pbm->label = _("Get File"); |
6285 pbm->callback = oscar_ask_getfile; | 6242 pbm->callback = oscar_ask_getfile; |
6702 NULL, | 6659 NULL, |
6703 #endif | 6660 #endif |
6704 NULL, | 6661 NULL, |
6705 oscar_convo_closed, | 6662 oscar_convo_closed, |
6706 NULL, | 6663 NULL, |
6707 oscar_set_icon, | 6664 oscar_set_icon |
6708 NULL, | |
6709 NULL, | |
6710 oscar_ask_sendfile, | |
6711 oscar_sendfile, | |
6712 oscar_has_sendfile | |
6713 }; | 6665 }; |
6714 | 6666 |
6715 static GaimPluginInfo info = | 6667 static GaimPluginInfo info = |
6716 { | 6668 { |
6717 2, /**< api_version */ | 6669 2, /**< api_version */ |