Changeset fa29d093 for protocols/oscar
- Timestamp:
- 2007-03-28T05:53:11Z (18 years ago)
- Branches:
- master
- Children:
- 0da65d5
- Parents:
- 723e611
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
r723e611 rfa29d093 157 157 return tmp; 158 158 } 159 160 static struct chat_connection *find_oscar_chat(struct gaim_connection *gc, int id) {161 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;162 struct chat_connection *c = NULL;163 164 while (g) {165 c = (struct chat_connection *)g->data;166 if (c->id == id)167 break;168 g = g->next;169 c = NULL;170 }171 172 return c;173 }174 175 159 176 160 static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc, … … 769 753 chatcon = find_oscar_chat_by_conn(gc, fr->conn); 770 754 chatcon->id = id; 771 chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show); 755 chatcon->cnv = serv_got_joined_chat(gc, chatcon->show); 756 chatcon->cnv->data = chatcon; 772 757 773 758 return 1; … … 1580 1565 tmp = g_malloc(BUF_LONG); 1581 1566 g_snprintf(tmp, BUF_LONG, "%s", msg); 1582 serv_got_chat_in( gc, ccon->id, info->sn, 0, tmp, time((time_t)NULL));1567 serv_got_chat_in(ccon->cnv, info->sn, 0, tmp, time((time_t)NULL)); 1583 1568 g_free(tmp); 1584 1569 … … 2521 2506 } 2522 2507 2523 int oscar_chat_send(struct gaim_connection * gc, int id, char *message) 2524 { 2508 int oscar_chat_send(struct conversation *c, char *message) 2509 { 2510 struct gaim_connection *gc = c->gc; 2525 2511 struct oscar_data * od = (struct oscar_data*)gc->proto_data; 2526 2512 struct chat_connection * ccon; … … 2530 2516 char *s; 2531 2517 2532 if(!(ccon = find_oscar_chat(gc, id))) 2533 return -1; 2518 ccon = c->data; 2534 2519 2535 2520 for (s = message; *s; s++) … … 2568 2553 } 2569 2554 2570 void oscar_chat_invite(struct gaim_connection * gc, int id, char *message, char *who) 2571 { 2555 void oscar_chat_invite(struct conversation *c, char *message, char *who) 2556 { 2557 struct gaim_connection *gc = c->gc; 2572 2558 struct oscar_data * od = (struct oscar_data *)gc->proto_data; 2573 struct chat_connection *ccon = find_oscar_chat(gc, id); 2574 2575 if (ccon == NULL) 2576 return; 2559 struct chat_connection *ccon = c->data; 2577 2560 2578 2561 aim_chat_invite(od->sess, od->conn, who, message ? message : "", … … 2585 2568 2586 2569 /* Notify the conversation window that we've left the chat */ 2587 serv_got_chat_left( gc, cc->id);2570 serv_got_chat_left(cc->cnv); 2588 2571 2589 2572 /* Destroy the chat_connection */ … … 2597 2580 } 2598 2581 2599 void oscar_chat_leave(struct gaim_connection * gc, int id) 2600 { 2601 struct chat_connection * ccon = find_oscar_chat(gc, id); 2602 2603 if(ccon == NULL) 2604 return; 2605 2606 oscar_chat_kill(gc, ccon); 2582 void oscar_chat_leave(struct conversation *c) 2583 { 2584 oscar_chat_kill(c->gc, c->data); 2607 2585 } 2608 2586 2609 2587 int oscar_chat_join(struct gaim_connection * gc, char * name) 2610 2588 { 2611 2589 struct oscar_data * od = (struct oscar_data *)gc->proto_data; 2612 2590 2613 2591 aim_conn_t * cur; … … 2627 2605 } 2628 2606 2629 intoscar_chat_open(struct gaim_connection * gc, char *who)2607 struct conversation *oscar_chat_open(struct gaim_connection * gc, char *who) 2630 2608 { 2631 2609 struct oscar_data * od = (struct oscar_data *)gc->proto_data; … … 2642 2620 g_free(chatname); 2643 2621 2644 return ret;2622 return NULL; 2645 2623 } 2646 2624
Note: See TracChangeset
for help on using the changeset viewer.