Changeset fa29d093 for protocols/oscar


Ignore:
Timestamp:
2007-03-28T05:53:11Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0da65d5
Parents:
723e611
Message:

Preparing for Jabber conference room support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    r723e611 rfa29d093  
    157157        return tmp;
    158158}
    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 
    175159
    176160static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc,
     
    769753        chatcon = find_oscar_chat_by_conn(gc, fr->conn);
    770754        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;
    772757
    773758        return 1;
     
    15801565        tmp = g_malloc(BUF_LONG);
    15811566        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));
    15831568        g_free(tmp);
    15841569
     
    25212506}
    25222507
    2523 int oscar_chat_send(struct gaim_connection * gc, int id, char *message)
    2524 {
     2508int oscar_chat_send(struct conversation *c, char *message)
     2509{
     2510        struct gaim_connection *gc = c->gc;
    25252511        struct oscar_data * od = (struct oscar_data*)gc->proto_data;
    25262512        struct chat_connection * ccon;
     
    25302516        char *s;
    25312517       
    2532         if(!(ccon = find_oscar_chat(gc, id)))
    2533                 return -1;
     2518        ccon = c->data;
    25342519               
    25352520        for (s = message; *s; s++)
     
    25682553}
    25692554
    2570 void oscar_chat_invite(struct gaim_connection * gc, int id, char *message, char *who)
    2571 {
     2555void oscar_chat_invite(struct conversation *c, char *message, char *who)
     2556{
     2557        struct gaim_connection *gc = c->gc;
    25722558        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;
    25772560       
    25782561        aim_chat_invite(od->sess, od->conn, who, message ? message : "",
     
    25852568
    25862569        /* 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);
    25882571
    25892572        /* Destroy the chat_connection */
     
    25972580}
    25982581
    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);
     2582void oscar_chat_leave(struct conversation *c)
     2583{
     2584        oscar_chat_kill(c->gc, c->data);
    26072585}
    26082586
    26092587int oscar_chat_join(struct gaim_connection * gc, char * name)
    26102588{
    2611     struct oscar_data * od = (struct oscar_data *)gc->proto_data;
     2589        struct oscar_data * od = (struct oscar_data *)gc->proto_data;
    26122590       
    26132591        aim_conn_t * cur;
     
    26272605}
    26282606
    2629 int oscar_chat_open(struct gaim_connection * gc, char *who)
     2607struct conversation *oscar_chat_open(struct gaim_connection * gc, char *who)
    26302608{
    26312609        struct oscar_data * od = (struct oscar_data *)gc->proto_data;
     
    26422620        g_free(chatname);
    26432621       
    2644         return ret;
     2622        return NULL;
    26452623}
    26462624
Note: See TracChangeset for help on using the changeset viewer.