Changeset 2945c6f for protocols/oscar/oscar.c
- Timestamp:
- 2010-07-24T21:16:18Z (15 years ago)
- Branches:
- master
- Children:
- f1f7b5e
- Parents:
- ef14a83 (diff), 593971d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
ref14a83 r2945c6f 254 254 255 255 u = t = g_strdup(s); 256 257 strcpy(t, s);258 256 g_strdown(t); 259 257 … … 290 288 odata = (struct oscar_data *)ic->proto_data; 291 289 292 if (condition & GAIM_INPUT_READ) {290 if (condition & B_EV_IO_READ) { 293 291 if (aim_get_command(odata->sess, conn) >= 0) { 294 292 aim_rxdispatch(odata->sess); … … 362 360 363 361 aim_conn_completeconnect(sess, conn); 364 ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,362 ic->inpa = b_input_add(conn->fd, B_EV_IO_READ, 365 363 oscar_callback, conn); 366 364 … … 493 491 494 492 aim_conn_completeconnect(sess, bosconn); 495 ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,493 ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ, 496 494 oscar_callback, bosconn); 497 495 imcb_log(ic, _("Connection established, cookie sent")); … … 652 650 struct im_connection *ic = sess->aux_data; 653 651 struct chat_connection *chatcon; 652 struct groupchat *c = NULL; 654 653 static int id = 1; 655 654 … … 664 663 chatcon = find_oscar_chat_by_conn(ic, fr->conn); 665 664 chatcon->id = id; 666 chatcon->cnv = imcb_chat_new(ic, chatcon->show); 665 666 c = bee_chat_by_title(ic->bee, ic, chatcon->show); 667 if (c && !c->data) 668 chatcon->cnv = c; 669 else 670 chatcon->cnv = imcb_chat_new(ic, chatcon->show); 667 671 chatcon->cnv->data = chatcon; 668 672 … … 703 707 704 708 aim_conn_completeconnect(sess, tstconn); 705 odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,709 odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ, 706 710 oscar_callback, tstconn); 707 711 … … 731 735 732 736 aim_conn_completeconnect(sess, tstconn); 733 odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,737 odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ, 734 738 oscar_callback, tstconn); 735 739 … … 767 771 aim_conn_completeconnect(sess, ccon->conn); 768 772 ccon->inpa = b_input_add(tstconn->fd, 769 GAIM_INPUT_READ,773 B_EV_IO_READ, 770 774 oscar_callback, tstconn); 771 775 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon); … … 934 938 tmp = normalize(info->sn); 935 939 imcb_buddy_status(ic, tmp, flags, state_string, NULL); 936 /* imcb_buddy_times(ic, tmp, signon, time_idle); */940 imcb_buddy_times(ic, tmp, signon, time_idle); 937 941 938 942 … … 1060 1064 aim_ssi_auth_reply(od->sess, od->conn, uin, 1, ""); 1061 1065 // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message); 1062 if(imcb_find_buddy(data->ic, uin) == NULL) 1063 imcb_ask_add(data->ic, uin, NULL); 1066 imcb_ask_add(data->ic, uin, NULL); 1064 1067 1065 1068 g_free(uin); … … 1822 1825 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 1823 1826 if (odata->icq) { 1827 /** FIXME(wilmer): Hmm, lost the ability to get away msgs here, do we care to get that back? 1824 1828 struct buddy *budlight = imcb_find_buddy(g, who); 1825 1829 if (budlight) … … 1827 1831 if (budlight->caps & AIM_CAPS_ICQSERVERRELAY) 1828 1832 aim_send_im_ch2_geticqmessage(odata->sess, who, (budlight->uc & 0xff80) >> 7); 1833 */ 1829 1834 } else 1830 1835 aim_getinfo(odata->sess, odata->conn, who, AIM_GETINFO_AWAYMESSAGE); … … 1953 1958 static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) { 1954 1959 struct im_connection *ic = sess->aux_data; 1955 struct aim_ssi_item *curitem ;1960 struct aim_ssi_item *curitem, *curgroup; 1956 1961 int tmp; 1957 1962 char *nrm; … … 1964 1969 switch (curitem->type) { 1965 1970 case 0x0000: /* Buddy */ 1966 if ((curitem->name) && (!imcb_ find_buddy(ic, nrm))) {1971 if ((curitem->name) && (!imcb_buddy_by_handle(ic, nrm))) { 1967 1972 char *realname = NULL; 1968 1973 1969 1974 if (curitem->data && aim_gettlv(curitem->data, 0x0131, 1)) 1970 1975 realname = aim_gettlv_str(curitem->data, 0x0131, 1); 1971 1972 imcb_add_buddy(ic, nrm, NULL);1976 1977 imcb_add_buddy(ic, nrm, curgroup->gid == curitem->gid ? curgroup->name : NULL); 1973 1978 1974 1979 if (realname) { … … 1978 1983 } 1979 1984 } 1985 break; 1986 1987 case 0x0001: /* Group */ 1988 curgroup = curitem; 1980 1989 break; 1981 1990 … … 2422 2431 char *s; 2423 2432 2424 ccon = c->data; 2433 if (!(ccon = c->data)) 2434 return; 2425 2435 2426 2436 for (s = message; *s; s++) … … 2463 2473 struct im_connection *ic = c->ic; 2464 2474 struct oscar_data * od = (struct oscar_data *)ic->proto_data; 2465 struct chat_connection *ccon = c->data; 2475 struct chat_connection *ccon; 2476 2477 if (!(ccon = c->data)) 2478 return; 2466 2479 2467 2480 aim_chat_invite(od->sess, od->conn, who, message ? message : "", … … 2488 2501 void oscar_chat_leave(struct groupchat *c) 2489 2502 { 2503 if (!c->data) 2504 return; 2490 2505 oscar_chat_kill(c->ic, c->data); 2491 2506 } 2492 2507 2493 struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password ) 2508 struct groupchat *oscar_chat_join_internal(struct im_connection *ic, const char *room, 2509 const char *nick, const char *password, int exchange_number) 2494 2510 { 2495 2511 struct oscar_data * od = (struct oscar_data *)ic->proto_data; 2512 struct groupchat *ret = imcb_chat_new(ic, room); 2496 2513 aim_conn_t * cur; 2497 2514 … … 2499 2516 int st; 2500 2517 2501 st = aim_chatnav_createroom(od->sess, cur, room, 4);2518 st = aim_chatnav_createroom(od->sess, cur, room, exchange_number); 2502 2519 2503 return NULL;2520 return ret; 2504 2521 } else { 2505 2522 struct create_room * cr = g_new0(struct create_room, 1); 2506 2523 2507 cr->exchange = 4;2524 cr->exchange = exchange_number; 2508 2525 cr->name = g_strdup(room); 2509 2526 od->create_rooms = g_slist_append(od->create_rooms, cr); 2510 2527 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_CHATNAV); 2511 2528 2512 return NULL; 2513 } 2529 return ret; 2530 } 2531 } 2532 2533 struct groupchat *oscar_chat_join(struct im_connection *ic, const char *room, 2534 const char *nick, const char *password, set_t **sets) 2535 { 2536 return oscar_chat_join_internal(ic, room, nick, password, set_getint(sets, "exchange_number")); 2514 2537 } 2515 2538 … … 2519 2542 struct groupchat *ret; 2520 2543 static int chat_id = 0; 2521 char * chatname; 2544 char * chatname, *s; 2545 struct groupchat *c; 2522 2546 2523 2547 chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "", 2524 2548 ic->acc->user, chat_id++); 2525 2526 ret = oscar_chat_join(ic, chatname, NULL, NULL); 2527 2549 2550 for (s = chatname; *s; s ++) 2551 if (!isalnum(*s)) 2552 *s = '0'; 2553 2554 c = imcb_chat_new(ic, chatname); 2555 ret = oscar_chat_join_internal(ic, chatname, NULL, NULL, 4); 2528 2556 aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0); 2529 2557 … … 2537 2565 struct aim_chat_invitation * inv = data; 2538 2566 2539 oscar_chat_join (inv->ic, inv->name, NULL, NULL);2567 oscar_chat_join_internal(inv->ic, inv->name, NULL, NULL, 4); 2540 2568 g_free(inv->name); 2541 2569 g_free(inv); … … 2548 2576 g_free(inv->name); 2549 2577 g_free(inv); 2578 } 2579 2580 void oscar_chat_add_settings(account_t *acc, set_t **head) 2581 { 2582 set_add(head, "exchange_number", "4", set_eval_int, NULL); 2583 } 2584 2585 void oscar_chat_free_settings(account_t *acc, set_t **head) 2586 { 2587 set_del(head, "exchange_number"); 2550 2588 } 2551 2589 … … 2570 2608 ret->chat_with = oscar_chat_with; 2571 2609 ret->chat_join = oscar_chat_join; 2610 ret->chat_add_settings = oscar_chat_add_settings; 2611 ret->chat_free_settings = oscar_chat_free_settings; 2572 2612 ret->add_permit = oscar_add_permit; 2573 2613 ret->add_deny = oscar_add_deny;
Note: See TracChangeset
for help on using the changeset viewer.