Changes in protocols/yahoo/libyahoo2.c [99c8f13:823de9d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/libyahoo2.c
r99c8f13 r823de9d 69 69 #ifdef __MINGW32__ 70 70 # include <winsock2.h> 71 # define write(a,b,c) send(a,b,c,0) 72 # define read(a,b,c) recv(a,b,c,0) 71 73 #endif 72 74 … … 89 91 90 92 #include "base64.h" 91 #include "http_client.h"92 93 93 94 #ifdef USE_STRUCT_CALLBACKS … … 170 171 YAHOO_SERVICE_GOTGROUPRENAME, /* < 1, 36(old), 37(new) */ 171 172 YAHOO_SERVICE_SYSMESSAGE = 0x14, 172 YAHOO_SERVICE_SKINNAME = 0x15,173 173 YAHOO_SERVICE_PASSTHROUGH2 = 0x16, 174 174 YAHOO_SERVICE_CONFINVITE = 0x18, … … 194 194 YAHOO_SERVICE_LIST, 195 195 YAHOO_SERVICE_AUTH = 0x57, 196 YAHOO_SERVICE_AUTHBUDDY = 0x6d,197 196 YAHOO_SERVICE_ADDBUDDY = 0x83, 198 197 YAHOO_SERVICE_REMBUDDY, … … 200 199 YAHOO_SERVICE_REJECTCONTACT, 201 200 YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */ 202 YAHOO_SERVICE_Y7_PING = 0x8A, /* 0 - id and that's it?? */203 201 YAHOO_SERVICE_CHATONLINE = 0x96, /* > 109(id), 1, 6(abcde) < 0,1*/ 204 202 YAHOO_SERVICE_CHATGOTO, … … 206 204 YAHOO_SERVICE_CHATLEAVE, 207 205 YAHOO_SERVICE_CHATEXIT = 0x9b, 208 YAHOO_SERVICE_CHATADDINVITE = 0x9d,209 206 YAHOO_SERVICE_CHATLOGOUT = 0xa0, 210 207 YAHOO_SERVICE_CHATPING, … … 214 211 YAHOO_SERVICE_PICTURE = 0xbe, 215 212 YAHOO_SERVICE_PICTURE_UPDATE = 0xc1, 216 YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2, 217 YAHOO_SERVICE_Y6_VISIBILITY=0xc5, 218 YAHOO_SERVICE_Y6_STATUS_UPDATE=0xc6, 219 YAHOO_PHOTOSHARE_INIT=0xd2, 220 YAHOO_SERVICE_CONTACT_YMSG13=0xd6, 221 YAHOO_PHOTOSHARE_PREV=0xd7, 222 YAHOO_PHOTOSHARE_KEY=0xd8, 223 YAHOO_PHOTOSHARE_TRANS=0xda, 224 YAHOO_FILE_TRANSFER_INIT_YMSG13=0xdc, 225 YAHOO_FILE_TRANSFER_GET_YMSG13=0xdd, 226 YAHOO_FILE_TRANSFER_PUT_YMSG13=0xde, 227 YAHOO_SERVICE_YMSG15_STATUS=0xf0, 228 YAHOO_SERVICE_YMSG15_BUDDY_LIST=0xf1, 213 YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2 229 214 }; 230 215 … … 750 735 751 736 memcpy(data + pos, "YMSG", 4); pos += 4; 752 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER);737 pos += yahoo_put16(data + pos, 0x000c); 753 738 pos += yahoo_put16(data + pos, 0x0000); 754 739 pos += yahoo_put16(data + pos, pktlen + extra_pad); … … 764 749 yahoo_send_data(yid->fd, data, len); 765 750 else 766 751 yahoo_add_to_send_queue(yid, data, len); 767 752 FREE(data); 768 753 } … … 1484 1469 1485 1470 if (u->name != NULL) { 1486 if (pkt->service == YAHOO_SERVICE_LOGOFF ) { /* || u->flags == 0) { Not in YMSG16 */1471 if (pkt->service == YAHOO_SERVICE_LOGOFF || u->flags == 0) { 1487 1472 YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, u->name, YAHOO_STATUS_OFFLINE, NULL, 1, 0, 0); 1488 1473 } else { 1489 /* Key 47 always seems to be 1 for YMSG16 */1490 if(!u->state)1491 u->away = 0;1492 else1493 u->away = 1;1494 1495 1474 YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, u->name, u->state, u->msg, u->away, u->idle, u->mobile); 1496 1475 } … … 1500 1479 y_list_free_1(t); 1501 1480 FREE(u); 1502 }1503 }1504 1505 static void yahoo_process_buddy_list(struct yahoo_input_data *yid, struct yahoo_packet *pkt)1506 {1507 struct yahoo_data *yd = yid->yd;1508 YList *l;1509 int last_packet = 0;1510 char *cur_group = NULL;1511 struct yahoo_buddy *newbud = NULL;1512 1513 /* we could be getting multiple packets here */1514 for (l = pkt->hash; l; l = l->next) {1515 struct yahoo_pair *pair = l->data;1516 1517 switch(pair->key) {1518 case 300:1519 case 301:1520 case 302:1521 case 303:1522 if ( 315 == atoi(pair->value) )1523 last_packet = 1;1524 break;1525 case 65:1526 g_free(cur_group);1527 cur_group = strdup(pair->value);1528 break;1529 case 7:1530 newbud = y_new0(struct yahoo_buddy, 1);1531 newbud->id = strdup(pair->value);1532 if(cur_group)1533 newbud->group = strdup(cur_group);1534 else {1535 struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(1536 yd->buddies, y_list_length(yd->buddies)-1)->data;1537 newbud->group = strdup(lastbud->group);1538 }1539 1540 yd->buddies = y_list_append(yd->buddies, newbud);1541 1542 break;1543 }1544 }1545 1546 g_free(cur_group);1547 1548 /* we could be getting multiple packets here */1549 if (last_packet)1550 return;1551 1552 YAHOO_CALLBACK(ext_yahoo_got_buddies)(yd->client_id, yd->buddies);1553 1554 /*** We login at the very end of the packet communication */1555 if (!yd->logged_in) {1556 yd->logged_in = TRUE;1557 if(yd->current_status < 0)1558 yd->current_status = yd->initial_status;1559 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, YAHOO_LOGIN_OK, NULL);1560 1481 } 1561 1482 } … … 1630 1551 } 1631 1552 1632 if(yd->cookie_y && yd->cookie_t )1553 if(yd->cookie_y && yd->cookie_t && yd->cookie_c) 1633 1554 YAHOO_CALLBACK(ext_yahoo_got_cookies)(yd->client_id); 1634 1555 … … 2307 2228 } 2308 2229 2309 struct yahoo_https_auth_data2310 {2311 struct yahoo_input_data *yid;2312 char *token;2313 char *chal;2314 };2315 2316 static void yahoo_https_auth_token_init(struct yahoo_https_auth_data *had);2317 static void yahoo_https_auth_token_finish(struct http_request *req);2318 static void yahoo_https_auth_init(struct yahoo_https_auth_data *had);2319 static void yahoo_https_auth_finish(struct http_request *req);2320 2321 /* Extract a value from a login.yahoo.com response. Assume CRLF-linebreaks2322 and FAIL miserably if they're not there... */2323 static char *yahoo_ha_find_key(char *response, char *key)2324 {2325 char *s, *end;2326 int len = strlen(key);2327 2328 s = response;2329 do {2330 if (strncmp(s, key, len) == 0 && s[len] == '=') {2331 s += len + 1;2332 if ((end = strchr(s, '\r')))2333 return g_strndup(s, end - s);2334 else2335 return g_strdup(s);2336 }2337 2338 if ((s = strchr(s, '\n')))2339 s ++;2340 } while (s && *s);2341 2342 return NULL;2343 }2344 2345 static enum yahoo_status yahoo_https_status_parse(int code)2346 {2347 switch (code)2348 {2349 case 1212: return YAHOO_LOGIN_PASSWD;2350 case 1213: return YAHOO_LOGIN_LOCK;2351 case 1235: return YAHOO_LOGIN_UNAME;2352 default: return (enum yahoo_status) code;2353 }2354 }2355 2356 static void yahoo_process_auth_0x10(struct yahoo_input_data *yid, const char *seed, const char *sn)2357 {2358 struct yahoo_https_auth_data *had = g_new0(struct yahoo_https_auth_data, 1);2359 2360 had->yid = yid;2361 had->chal = g_strdup(seed);2362 2363 yahoo_https_auth_token_init(had);2364 }2365 2366 static void yahoo_https_auth_token_init(struct yahoo_https_auth_data *had)2367 {2368 struct yahoo_input_data *yid = had->yid;2369 struct yahoo_data *yd = yid->yd;2370 struct http_request *req;2371 char *login, *passwd, *chal;2372 char *url;2373 2374 login = g_strndup(yd->user, 3 * strlen(yd->user));2375 http_encode(login);2376 passwd = g_strndup(yd->password, 3 * strlen(yd->password));2377 http_encode(passwd);2378 chal = g_strndup(had->chal, 3 * strlen(had->chal));2379 http_encode(chal);2380 2381 url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=%d&login=%s&passwd=%s&chal=%s",2382 (int) time(NULL), login, passwd, chal);2383 2384 req = http_dorequest_url(url, yahoo_https_auth_token_finish, had);2385 2386 g_free(url);2387 g_free(chal);2388 g_free(passwd);2389 g_free(login);2390 }2391 2392 static void yahoo_https_auth_token_finish(struct http_request *req)2393 {2394 struct yahoo_https_auth_data *had = req->data;2395 struct yahoo_input_data *yid = had->yid;2396 struct yahoo_data *yd = yid->yd;2397 int st;2398 2399 if (req->status_code != 200) {2400 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 2000 + req->status_code, NULL);2401 goto fail;2402 }2403 2404 if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {2405 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, yahoo_https_status_parse(st), NULL);2406 goto fail;2407 }2408 2409 if ((had->token = yahoo_ha_find_key(req->reply_body, "ymsgr")) == NULL) {2410 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 3001, NULL);2411 goto fail;2412 }2413 2414 return yahoo_https_auth_init(had);2415 2416 fail:2417 g_free(had->token);2418 g_free(had->chal);2419 g_free(had);2420 }2421 2422 static void yahoo_https_auth_init(struct yahoo_https_auth_data *had)2423 {2424 struct http_request *req;2425 char *url;2426 2427 url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=%d&token=%s",2428 (int) time(NULL), had->token);2429 2430 req = http_dorequest_url(url, yahoo_https_auth_finish, had);2431 2432 g_free(url);2433 }2434 2435 static void yahoo_https_auth_finish(struct http_request *req)2436 {2437 struct yahoo_https_auth_data *had = req->data;2438 struct yahoo_input_data *yid = had->yid;2439 struct yahoo_data *yd = yid->yd;2440 struct yahoo_packet *pack;2441 char *crumb;2442 int st;2443 2444 md5_byte_t result[16];2445 md5_state_t ctx;2446 2447 unsigned char yhash[32];2448 2449 if (req->status_code != 200) {2450 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 2000 + req->status_code, NULL);2451 goto fail;2452 }2453 2454 if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {2455 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, yahoo_https_status_parse(st), NULL);2456 goto fail;2457 }2458 2459 if ((yd->cookie_y = yahoo_ha_find_key(req->reply_body, "Y")) == NULL ||2460 (yd->cookie_t = yahoo_ha_find_key(req->reply_body, "T")) == NULL ||2461 (crumb = yahoo_ha_find_key(req->reply_body, "crumb")) == NULL) {2462 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 3002, NULL);2463 goto fail;2464 }2465 2466 md5_init(&ctx);2467 md5_append(&ctx, (unsigned char*) crumb, 11);2468 md5_append(&ctx, (unsigned char*) had->chal, strlen(had->chal));2469 md5_finish(&ctx, result);2470 to_y64(yhash, result, 16);2471 2472 pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP, yd->initial_status, yd->session_id);2473 yahoo_packet_hash(pack, 1, yd->user);2474 yahoo_packet_hash(pack, 0, yd->user);2475 yahoo_packet_hash(pack, 277, yd->cookie_y);2476 yahoo_packet_hash(pack, 278, yd->cookie_t);2477 yahoo_packet_hash(pack, 307, (char*) yhash);2478 yahoo_packet_hash(pack, 244, "524223");2479 yahoo_packet_hash(pack, 2, yd->user);2480 yahoo_packet_hash(pack, 2, "1");2481 yahoo_packet_hash(pack, 98, "us");2482 yahoo_packet_hash(pack, 135, "7.5.0.647");2483 2484 yahoo_send_packet(yid, pack, 0);2485 2486 yahoo_packet_free(pack);2487 2488 fail:2489 g_free(crumb);2490 g_free(had->token);2491 g_free(had->chal);2492 g_free(had);2493 }2494 2495 2230 static void yahoo_process_auth(struct yahoo_input_data *yid, struct yahoo_packet *pkt) 2496 2231 { … … 2520 2255 case 1: 2521 2256 yahoo_process_auth_0x0b(yid, seed, sn); 2522 break;2523 case 2:2524 yahoo_process_auth_0x10(yid, seed, sn);2525 2257 break; 2526 2258 default: … … 2678 2410 2679 2411 yd->buddies = y_list_append(yd->buddies, bud); 2680 2412 2681 2413 /* Possibly called already, but at least the call above doesn't 2682 2414 seem to happen every time (not anytime I tried). */ … … 2685 2417 2686 2418 /* YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, who, status, NULL, (status==YAHOO_STATUS_AVAILABLE?0:1)); */ 2687 }2688 2689 static void yahoo_process_contact_ymsg13(struct yahoo_input_data *yid, struct yahoo_packet *pkt)2690 {2691 char* who=NULL;2692 char* me=NULL;2693 char* msg=NULL;2694 YList *l;2695 for (l = pkt->hash; l; l = l->next) {2696 struct yahoo_pair *pair = l->data;2697 if (pair->key == 4)2698 who = pair->value;2699 else if (pair->key == 5)2700 me = pair->value;2701 else2702 DEBUG_MSG(("unknown key: %d = %s", pair->key, pair->value));2703 }2704 2705 if(pkt->status==3)2706 YAHOO_CALLBACK(ext_yahoo_contact_auth_request)(yid->yd->client_id, me, who, msg);2707 2419 } 2708 2420 … … 2918 2630 2919 2631 YList *l; 2920 //yahoo_dump_unhandled(pkt);2632 yahoo_dump_unhandled(pkt); 2921 2633 for (l = pkt->hash; l; l = l->next) { 2922 2634 struct yahoo_pair *pair = l->data; … … 2940 2652 { 2941 2653 DEBUG_MSG(("yahoo_packet_process: 0x%02x", pkt->service)); 2942 yahoo_dump_unhandled(pkt);2943 2654 switch (pkt->service) 2944 2655 { … … 2952 2663 case YAHOO_SERVICE_IDACT: 2953 2664 case YAHOO_SERVICE_IDDEACT: 2954 case YAHOO_SERVICE_Y6_STATUS_UPDATE:2955 case YAHOO_SERVICE_YMSG15_STATUS:2956 2665 yahoo_process_status(yid, pkt); 2957 2666 break; … … 2967 2676 yahoo_process_mail(yid, pkt); 2968 2677 break; 2969 case YAHOO_SERVICE_REJECTCONTACT:2970 2678 case YAHOO_SERVICE_NEWCONTACT: 2971 2679 yahoo_process_contact(yid, pkt); … … 3008 2716 yahoo_process_buddyadd(yid, pkt); 3009 2717 break; 3010 case YAHOO_SERVICE_CONTACT_YMSG13:3011 yahoo_process_contact_ymsg13(yid,pkt);3012 break;3013 2718 case YAHOO_SERVICE_REMBUDDY: 3014 2719 yahoo_process_buddydel(yid, pkt); … … 3039 2744 case YAHOO_SERVICE_CHATLOGOFF: 3040 2745 case YAHOO_SERVICE_CHATMSG: 2746 case YAHOO_SERVICE_REJECTCONTACT: 3041 2747 case YAHOO_SERVICE_PEERTOPEER: 3042 2748 WARNING(("unhandled service 0x%02x", pkt->service)); … … 3052 2758 yahoo_process_picture_upload(yid, pkt); 3053 2759 break; 3054 case YAHOO_SERVICE_YMSG15_BUDDY_LIST: /* Buddy List */3055 yahoo_process_buddy_list(yid, pkt);3056 2760 default: 3057 2761 WARNING(("unknown service 0x%02x", pkt->service)); … … 3837 3541 yahoo_process_webcam_connection, 3838 3542 yahoo_process_chatcat_connection, 3839 yahoo_process_search_connection ,3543 yahoo_process_search_connection 3840 3544 }; 3841 3545 … … 3855 3559 } while(len == -1 && errno == EINTR); 3856 3560 3857 if(len == -1 && (errno == EAGAIN||errno == EINTR)) /* we'll try again later */3561 if(len == -1 && errno == EAGAIN) /* we'll try again later */ 3858 3562 return 1; 3859 3563 … … 4058 3762 4059 3763 yahoo_packet_hash(pkt, 5, who); 4060 yahoo_packet_hash(pkt, 1, from?from:yd->user);3764 yahoo_packet_hash(pkt, 4, from?from:yd->user); 4061 3765 yahoo_packet_hash(pkt, 14, " "); 4062 3766 yahoo_packet_hash(pkt, 13, typ ? "1" : "0"); … … 4073 3777 struct yahoo_data *yd; 4074 3778 struct yahoo_packet *pkt = NULL; 4075 int old_status;3779 int service; 4076 3780 char s[4]; 4077 3781 … … 4081 3785 yd = yid->yd; 4082 3786 4083 old_status = yd->current_status; 4084 4085 if (msg && strncmp(msg,"Invisible",9)) { 3787 if (msg) { 4086 3788 yd->current_status = YAHOO_STATUS_CUSTOM; 4087 3789 } else { … … 4089 3791 } 4090 3792 4091 /* Thank you libpurple :) */ 4092 if (yd->current_status == YAHOO_STATUS_INVISIBLE) { 4093 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0); 4094 yahoo_packet_hash(pkt, 13, "2"); 4095 yahoo_send_packet(yid, pkt, 0); 4096 yahoo_packet_free(pkt); 4097 4098 return; 4099 } 4100 4101 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, yd->current_status, yd->session_id); 4102 snprintf(s, sizeof(s), "%d", yd->current_status); 4103 yahoo_packet_hash(pkt, 10, s); 3793 if (yd->current_status == YAHOO_STATUS_AVAILABLE) 3794 service = YAHOO_SERVICE_ISBACK; 3795 else 3796 service = YAHOO_SERVICE_ISAWAY; 4104 3797 4105 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4106 yahoo_packet_hash(pkt, 19, msg); 4107 } else { 4108 yahoo_packet_hash(pkt, 19, ""); 4109 } 4110 4111 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3798 if ((away == 2) && (yd->current_status == YAHOO_STATUS_AVAILABLE)) { 3799 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_BRB, yd->session_id); 3800 yahoo_packet_hash(pkt, 10, "999"); 3801 yahoo_packet_hash(pkt, 47, "2"); 3802 }else { 3803 pkt = yahoo_packet_new(service, YAHOO_STATUS_AVAILABLE, yd->session_id); 3804 snprintf(s, sizeof(s), "%d", yd->current_status); 3805 yahoo_packet_hash(pkt, 10, s); 3806 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 3807 yahoo_packet_hash(pkt, 19, msg); 3808 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3809 } else { 3810 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3811 } 3812 3813 3814 3815 } 4112 3816 4113 3817 yahoo_send_packet(yid, pkt, 0); 4114 3818 yahoo_packet_free(pkt); 4115 4116 if(old_status == YAHOO_STATUS_INVISIBLE) {4117 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0);4118 yahoo_packet_hash(pkt, 13, "1");4119 yahoo_send_packet(yid, pkt, 0);4120 yahoo_packet_free(pkt);4121 }4122 3819 } 4123 3820 … … 4134 3831 LOG(("yahoo_logoff: current status: %d", yd->current_status)); 4135 3832 4136 if(yd->current_status != -1 && 0) { 4137 /* Meh. Don't send this. The event handlers are not going to 4138 get to do this so it'll just leak memory. And the TCP 4139 connection reset will hopefully be clear enough. */ 3833 if(yd->current_status != -1) { 4140 3834 pkt = yahoo_packet_new(YAHOO_SERVICE_LOGOFF, YAHOO_STATUS_AVAILABLE, yd->session_id); 4141 3835 yd->current_status = -1; … … 4370 4064 return; 4371 4065 4372 pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YPACKET_STATUS_DEFAULT, yd->session_id); 4373 4066 pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YAHOO_STATUS_AVAILABLE, yd->session_id); 4067 yahoo_packet_hash(pkt, 1, yd->user); 4068 yahoo_packet_hash(pkt, 7, who); 4069 yahoo_packet_hash(pkt, 65, group); 4374 4070 if (msg != NULL) /* add message/request "it's me add me" */ 4375 4071 yahoo_packet_hash(pkt, 14, msg); 4376 else4377 yahoo_packet_hash(pkt,14,"");4378 4379 yahoo_packet_hash(pkt, 65, group);4380 yahoo_packet_hash(pkt, 97, "1");4381 yahoo_packet_hash(pkt, 1, yd->user);4382 yahoo_packet_hash(pkt, 302, "319");4383 yahoo_packet_hash(pkt, 300, "319");4384 yahoo_packet_hash(pkt, 7, who);4385 yahoo_packet_hash(pkt, 334, "0");4386 yahoo_packet_hash(pkt, 301, "319");4387 yahoo_packet_hash(pkt, 303, "319");4388 4389 4390 4072 yahoo_send_packet(yid, pkt, 0); 4391 4073 yahoo_packet_free(pkt); … … 4409 4091 yahoo_send_packet(yid, pkt, 0); 4410 4092 yahoo_packet_free(pkt); 4411 }4412 4413 void yahoo_accept_buddy_ymsg13(int id,const char* me,const char* who){4414 struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);4415 struct yahoo_data *yd;4416 4417 if(!yid)4418 return;4419 yd = yid->yd;4420 4421 struct yahoo_packet* pkt=NULL;4422 pkt= yahoo_packet_new(YAHOO_SERVICE_CONTACT_YMSG13,YAHOO_STATUS_AVAILABLE,0);4423 4424 yahoo_packet_hash(pkt,1,me ?: yd->user);4425 yahoo_packet_hash(pkt,5,who);4426 yahoo_packet_hash(pkt,13,"1");4427 yahoo_packet_hash(pkt,334,"0");4428 yahoo_send_packet(yid, pkt, 0);4429 yahoo_packet_free(pkt);4430 }4431 4432 void yahoo_reject_buddy_ymsg13(int id,const char* me,const char* who,const char* msg){4433 struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);4434 struct yahoo_data *yd;4435 4436 if(!yid)4437 return;4438 yd = yid->yd;4439 4440 struct yahoo_packet* pkt=NULL;4441 pkt= yahoo_packet_new(YAHOO_SERVICE_CONTACT_YMSG13,YAHOO_STATUS_AVAILABLE,0);4442 4443 yahoo_packet_hash(pkt,1,me ?: yd->user);4444 yahoo_packet_hash(pkt,5,who);4445 // yahoo_packet_hash(pkt,241,YAHOO_PROTO_VER);4446 yahoo_packet_hash(pkt,13,"2");4447 yahoo_packet_hash(pkt,334,"0");4448 yahoo_packet_hash(pkt,97,"1");4449 yahoo_packet_hash(pkt,14,msg?:"");4450 4451 yahoo_send_packet(yid, pkt, 0);4452 yahoo_packet_free(pkt);4453 4454 4093 } 4455 4094
Note: See TracChangeset
for help on using the changeset viewer.