libpurple/protocols/yahoo/yahoo_filexfer.c

branch
cpw.rekkanoryo.yahoop15ft
changeset 22401
5fe1761a4a15
parent 22323
ef5a1f7861b4
child 22966
35fe689e09a6
equal deleted inserted replaced
22397:ce4724bf245c 22401:5fe1761a4a15
1031 1031
1032 1032
1033 void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file) 1033 void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file)
1034 { 1034 {
1035 struct yahoo_xfer_data *xfer_data; 1035 struct yahoo_xfer_data *xfer_data;
1036 struct yahoo_data *yd; 1036 struct yahoo_data *yd = gc->proto_data;
1037 int ver = 0; 1037 int ver = 0;
1038 PurpleXfer *xfer = yahoo_new_xfer(gc, who); 1038 PurpleXfer *xfer = yahoo_new_xfer(gc, who);
1039 YahooFriend *yf = yahoo_friend_find(gc, who); 1039 YahooFriend *yf = yahoo_friend_find(gc, who);
1040 1040
1041 /* To determine whether client uses ymsg 15 i.e. client is higher than YM 7 */ 1041 /* To determine if we should use yahoo p15 for transfer. Check other user's
1042 if(yf && yf->version_id > 500000) 1042 * reported version, but if we're on Yahoo Japan, ignore it. */
1043 ver=15; 1043 if(yf && yf->version_id > 500000 && !yd->jp)
1044 ver = 15;
1045
1044 g_return_if_fail(xfer != NULL); 1046 g_return_if_fail(xfer != NULL);
1045 1047
1046 if(ver == 15) { 1048 if(ver == 15) {
1047 yd = gc->proto_data;
1048 xfer_data = xfer->data; 1049 xfer_data = xfer->data;
1049 xfer_data->status_15 = STARTED; 1050 xfer_data->status_15 = STARTED;
1050 purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15); 1051 purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15);
1051 xfer_data->version = 15; 1052 xfer_data->version = 15;
1052 xfer_data->xfer_peer_idstring = yahoo_xfer_new_xfer_id(); 1053 xfer_data->xfer_peer_idstring = yahoo_xfer_new_xfer_id();
1318 xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, 1319 xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map,
1319 xfer_peer_idstring); 1320 xfer_peer_idstring);
1320 if(!xfer) 1321 if(!xfer)
1321 return; 1322 return;
1322 /* 1323 /*
1323 * In the file trans info packet tht we must reply with , we are supposed to mention the ip address... 1324 * In the file trans info packet that we must reply with, we are
1325 * supposed to mention the ip address...
1324 * purple connect does not give me a way of finding the ip address... 1326 * purple connect does not give me a way of finding the ip address...
1325 * so, purple dnsquery is used... but retries, trying with next ip address etc. is not implemented..TODO 1327 * so, purple dnsquery is used... but retries, trying with next ip
1328 * address etc. is not implemented..TODO
1326 */ 1329 */
1327 if (yd->jp) 1330 if (yd->jp)
1328 { 1331 {
1329 purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer); 1332 purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT,
1333 yahoo_xfer_dns_connected_15, xfer);
1330 } 1334 }
1331 else 1335 else
1332 { 1336 {
1333 purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer); 1337 purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT,
1338 yahoo_xfer_dns_connected_15, xfer);
1334 } 1339 }
1335 return; 1340 return;
1336 } 1341 }
1337 1342
1338 /*processing for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/ 1343 /*processing for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/

mercurial