Changeset 2674412 for aim.c


Ignore:
Timestamp:
Dec 19, 2003, 11:41:48 AM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
c8735aa
Parents:
e7bcd1b
Message:
Don't bind F1 to help in edit context
File:
1 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    re7bcd1b r2674412  
    6363static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...);
    6464static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...);
     65static int conninitdone_chatnav  (aim_session_t *, aim_frame_t *, ...);
     66static int conninitdone_chat     (aim_session_t *, aim_frame_t *, ...);
    6567int logout(aim_session_t *sess);
    6668
     
    121123void owl_aim_init(void)
    122124{
    123   /* aim_session_init(owl_global_get_aimsess(&g), AIM_SESS_FLAGS_NONBLOCKCONNECT, 0); */
    124 
    125   /*
    126   aim_session_init(owl_global_get_aimsess(&g), TRUE, 0);
    127   aim_setdebuggingcb(owl_global_get_aimsess(&g), faimtest_debugcb);
    128   aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL);
    129   */
    130   /* an experiment to expose idle time */
    131   /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */
     125  /* this has all been moved to owl_aim_login, but we'll leave the
     126   * function here, in case there's stuff we want to init in the
     127   * future.  It's still called by Owl.
     128   */
     129     
    132130}
    133131
     
    217215                           owl_global_get_aim_ignorelogin_timer(&g));
    218216
     217 
     218  /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */
    219219  /* aim_bos_setidle(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), 5000); */
    220220}
     
    285285  /* there is a max away message lentgh we should check against */
    286286
    287   /*
    288287  aim_bos_setprofile(owl_global_get_aimsess(&g),
    289288                     owl_global_get_bosconn(&g),
    290289                     NULL, NULL, 0, "us-ascii", msg,
    291290                     strlen(msg), 0);
    292   */
    293291  return(0);
    294292}
    295293
    296 void owl_aim_chat_join(char *chatroom, int exchange)
     294void owl_aim_chat_join(char *name, int exchange)
    297295{
    298296  int ret;
     297  aim_conn_t *cur;
     298  /*
     299  OscarData *od = (OscarData *)g->proto_data;
     300  char *name, *exchange;
     301  */
     302
     303  owl_function_debugmsg("Attempting to join chatroom %s exchange %i", name, exchange);
     304
     305  /*
     306  name = g_hash_table_lookup(data, "room");
     307  exchange = g_hash_table_lookup(data, "exchange");
     308  */
     309  if ((cur = aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV))) {
     310    owl_function_debugmsg("owl_aim_chat_join: chatnav exists, creating room");
     311    aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange);
     312  } else {
     313    /*    struct create_room *cr = g_new0(struct create_room, 1); */
     314    owl_function_debugmsg("owl_aim_chat_join: chatnav does not exist, opening chatnav");
     315    /*
     316    cr->exchange = atoi(exchange);
     317    cr->name = g_strdup(name);
     318    od->create_rooms = g_slist_append(od->create_rooms, cr);
     319    */
     320    /* aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV); */
     321    aim_reqservice(owl_global_get_aimsess(&g), NULL, AIM_CONN_TYPE_CHATNAV);
     322    aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange);
     323    ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000);
     324
     325  }
     326  return;
     327  /******/
     328
    299329
    300330  /* ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); */
     
    306336  aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV);
    307337  ret = aim_chatnav_createroom(owl_global_get_aimsess(&g),
    308                                aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), chatroom, exchange);
    309    ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000);
    310  
    311   owl_function_debugmsg("Attempting to join chatroom %s exchange %i", chatroom, exchange);
     338                               aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), name, exchange);
     339   ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000);
     340 
    312341}
    313342
     
    555584
    556585  /*
     586  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR,     gaim_connerr, 0);
     587  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chatnav, 0);
     588  */
     589
     590  /*
    557591  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_ERROR,              faimtest_ssi_parseerr, 0);
    558592  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_RIGHTSINFO,         faimtest_ssi_parserights, 0);
     
    675709  va_list ap;
    676710  struct aim_redirect_data *redir;
     711
     712  owl_function_debugmsg("faimtest_handledirect:");
    677713 
    678714  va_start(ap, fr);
     
    683719  } else if (redir->group == 0x0007) {  /* Authorizer */
    684720    aim_conn_t *tstconn;
     721
     722    owl_function_debugmsg("faimtest_handledirect: autorizer");
    685723   
    686724    tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, redir->ip);
     
    699737    }
    700738  } else if (redir->group == 0x000d) {  /* ChatNav */
     739    owl_function_debugmsg("faimtest_handledirect: chatnav");
    701740    chatnav_redirect(sess, redir);
    702741  } else if (redir->group == 0x000e) { /* Chat */
     742    owl_function_debugmsg("faimtest_handledirect: chat");
    703743    chat_redirect(sess, redir);
    704744  } else {
     
    21392179static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...)
    21402180{
    2141 
    2142   owl_function_debugmsg("in faimtest_conninitdone_chat");
     2181  owl_function_debugmsg("faimtest_conninitdone_chat:");
     2182
     2183  aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0);
     2184  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0);
     2185  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0);
     2186  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0);
     2187  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0);
    21432188 
    21442189  aim_clientready(sess, fr->conn);
    21452190 
    2146   if (fr->conn->type == AIM_CONN_TYPE_CHATNAV) {
    2147     /* printf("chatnav ready\n"); */
    2148     aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, faimtest_parse_genericerr, 0);
    2149     aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, faimtest_chatnav_info, 0);
    2150     aim_chatnav_reqrights(sess, fr->conn);
    2151   } else if (fr->conn->type == AIM_CONN_TYPE_CHAT) {
    2152     /* printf("chat ready\n"); */
    2153     owl_function_debugmsg("Chat ready");
    2154     aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0);
    2155     aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0);
    2156     aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0);
    2157     aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0);
    2158     aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0);
    2159   }
    2160   return 1;
     2191  owl_function_debugmsg("Chat ready");
     2192
     2193  /*
     2194    chatcon = find_oscar_chat_by_conn(gc, fr->conn);
     2195    chatcon->id = id;
     2196    chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show);
     2197  */
     2198  return(1);
     2199}
     2200
     2201static int conninitdone_chatnav(aim_session_t *sess, aim_frame_t *fr, ...)
     2202{
     2203  owl_function_debugmsg("faimtest_conninitdone_chatnav:");
     2204
     2205  aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, gaim_parse_genericerr, 0);
     2206  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
     2207
     2208  aim_clientready(sess, fr->conn);
     2209
     2210  aim_chatnav_reqrights(sess, fr->conn);
     2211
     2212  return(1);
    21612213}
    21622214
Note: See TracChangeset for help on using the changeset viewer.