Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 7621:bfe3a796b2c2
[gaim-migrate @ 8245]
Reverting the previous patch. Sorry, Juan.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 24 Nov 2003 03:05:16 +0000 |
parents | 3e0404393761 |
children | ea2d07ad05a9 |
comparison
equal
deleted
inserted
replaced
7620:4f41c4aa9913 | 7621:bfe3a796b2c2 |
---|---|
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 = gaim_find_buddy(gc->account, who); | |
1061 aim_userinfo_t *userinfo; | |
1062 OscarData *od = gc->proto_data; | |
1063 | |
1064 if (b) | |
1065 userinfo = aim_locate_finduserinfo(od->sess, b->name); | |
1066 else | |
1067 return FALSE; | |
1068 | |
1069 /* True if we can send files to this dude, false if we can't */ | |
1070 return userinfo->capabilities & AIM_CAPS_SENDFILE; | |
1071 } | |
1072 | |
1028 static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { | 1073 static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { |
1029 GaimConnection *gc = sess->aux_data; | 1074 GaimConnection *gc = sess->aux_data; |
1030 OscarData *od = gc->proto_data; | 1075 OscarData *od = gc->proto_data; |
1031 GaimAccount *account = gc->account; | 1076 GaimAccount *account = gc->account; |
1032 aim_conn_t *bosconn; | 1077 aim_conn_t *bosconn; |
6225 pbm->label = _("Direct IM"); | 6270 pbm->label = _("Direct IM"); |
6226 pbm->callback = oscar_ask_direct_im; | 6271 pbm->callback = oscar_ask_direct_im; |
6227 pbm->gc = gc; | 6272 pbm->gc = gc; |
6228 m = g_list_append(m, pbm); | 6273 m = g_list_append(m, pbm); |
6229 } | 6274 } |
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 } | |
6238 #if 0 | 6275 #if 0 |
6239 if (userinfo->capabilities & AIM_CAPS_GETFILE) { | 6276 if (userinfo->capabilities & AIM_CAPS_GETFILE) { |
6240 pbm = g_new0(struct proto_buddy_menu, 1); | 6277 pbm = g_new0(struct proto_buddy_menu, 1); |
6241 pbm->label = _("Get File"); | 6278 pbm->label = _("Get File"); |
6242 pbm->callback = oscar_ask_getfile; | 6279 pbm->callback = oscar_ask_getfile; |
6659 NULL, | 6696 NULL, |
6660 #endif | 6697 #endif |
6661 NULL, | 6698 NULL, |
6662 oscar_convo_closed, | 6699 oscar_convo_closed, |
6663 NULL, | 6700 NULL, |
6664 oscar_set_icon | 6701 oscar_set_icon, |
6702 NULL, | |
6703 NULL, | |
6704 oscar_ask_sendfile, | |
6705 oscar_sendfile, | |
6706 oscar_has_sendfile | |
6665 }; | 6707 }; |
6666 | 6708 |
6667 static GaimPluginInfo info = | 6709 static GaimPluginInfo info = |
6668 { | 6710 { |
6669 2, /**< api_version */ | 6711 2, /**< api_version */ |