Changeset aa5f725 for aim.c


Ignore:
Timestamp:
Jun 3, 2003, 3:40:28 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
fd93b41
Parents:
651560f
Message:
added buddylists
added the 'alist' command to print logged in aimusers
added the 'blist' command which prints buddies logged in from all
  protocols.
'l' is now bound to 'blist' by default
File:
1 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    r651560f raa5f725  
    367367  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_bos, 0);
    368368
    369   aim_conn_addhandler(sess, bosconn, 0x0013, 0x0003, ssirights, 0);
    370   aim_conn_addhandler(sess, bosconn, 0x0013, 0x0006, ssidata, 0);
    371   aim_conn_addhandler(sess, bosconn, 0x0013, 0x000f, ssidatanochange, 0);
    372   aim_conn_addhandler(sess, bosconn, 0x0008, 0x0002, handlepopup, 0);
    373   aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, faimtest_bosrights, 0);
    374   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, faimtest_handleredirect, 0);
    375   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, faimtest_reportinterval, 0);
    376   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_RIGHTSINFO, faimtest_parse_buddyrights, 0);
    377   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, faimtest_parse_motd, 0);
    378   aim_conn_addhandler(sess, bosconn, 0x0004, 0x0005, faimtest_icbmparaminfo, 0);
    379   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, faimtest_parse_connerr, 0);
    380   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_RIGHTSINFO, faimtest_locrights, 0);
    381   aim_conn_addhandler(sess, bosconn, 0x0001, 0x001f, faimtest_memrequest, 0);
    382   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING, faimtest_parse_oncoming, 0);
    383   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, faimtest_parse_offgoing, 0);
    384   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, faimtest_parse_incoming_im, 0);
    385   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, faimtest_parse_locerr, 0);
    386   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, faimtest_parse_misses, 0);
    387   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, faimtest_parse_ratechange, 0);
    388   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, faimtest_parse_evilnotify, 0);
    389   aim_conn_addhandler(sess, bosconn, 0x000a, 0x0001, faimtest_parse_searcherror, 0);
    390   aim_conn_addhandler(sess, bosconn, 0x000a, 0x0003, faimtest_parse_searchreply, 0);
    391   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, faimtest_parse_msgerr, 0);
    392   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, faimtest_parse_userinfo, 0);
    393   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, faimtest_parse_msgack, 0);
    394 
    395   aim_conn_addhandler(sess, bosconn, 0x0001, 0x0001, faimtest_parse_genericerr, 0);
    396   aim_conn_addhandler(sess, bosconn, 0x0003, 0x0001, faimtest_parse_genericerr, 0);
    397   aim_conn_addhandler(sess, bosconn, 0x0009, 0x0001, faimtest_parse_genericerr, 0);
    398   aim_conn_addhandler(sess, bosconn, 0x0001, 0x000b, serverpause, 0);
    399   aim_conn_addhandler(sess, bosconn, 0x0001, 0x0012, migrate, 0);
    400   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSG, offlinemsg, 0);
     369  aim_conn_addhandler(sess, bosconn, 0x0013,         0x0003,                        ssirights, 0);
     370  aim_conn_addhandler(sess, bosconn, 0x0013,         0x0006,                        ssidata, 0);
     371  aim_conn_addhandler(sess, bosconn, 0x0013,         0x000f,                        ssidatanochange, 0);
     372  aim_conn_addhandler(sess, bosconn, 0x0008,         0x0002,                        handlepopup, 0);
     373  aim_conn_addhandler(sess, bosconn, 0x0009,         0x0003,                        faimtest_bosrights, 0);
     374  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT,           faimtest_handleredirect, 0);
     375  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL,  faimtest_reportinterval, 0);
     376  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_RIGHTSINFO,         faimtest_parse_buddyrights, 0);
     377  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD,               faimtest_parse_motd, 0);
     378  aim_conn_addhandler(sess, bosconn, 0x0004,         0x0005,                        faimtest_icbmparaminfo, 0);
     379  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR,    faimtest_parse_connerr, 0);
     380  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_RIGHTSINFO,         faimtest_locrights, 0);
     381  aim_conn_addhandler(sess, bosconn, 0x0001,         0x001f,                        faimtest_memrequest, 0);
     382  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING,           faimtest_parse_oncoming, 0);
     383  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING,           faimtest_parse_offgoing, 0);
     384  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING,           faimtest_parse_incoming_im, 0);
     385  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR,              faimtest_parse_locerr, 0);
     386  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL,         faimtest_parse_misses, 0);
     387  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE,         faimtest_parse_ratechange, 0);
     388  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL,               faimtest_parse_evilnotify, 0);
     389  aim_conn_addhandler(sess, bosconn, 0x000a,         0x0001,                        faimtest_parse_searcherror, 0);
     390  aim_conn_addhandler(sess, bosconn, 0x000a,         0x0003,                        faimtest_parse_searchreply, 0);
     391  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR,              faimtest_parse_msgerr, 0);
     392  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO,           faimtest_parse_userinfo, 0);
     393  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK,                faimtest_parse_msgack, 0);
     394
     395  aim_conn_addhandler(sess, bosconn, 0x0001,         0x0001,                        faimtest_parse_genericerr, 0);
     396  aim_conn_addhandler(sess, bosconn, 0x0003,         0x0001,                        faimtest_parse_genericerr, 0);
     397  aim_conn_addhandler(sess, bosconn, 0x0009,         0x0001,                        faimtest_parse_genericerr, 0);
     398  aim_conn_addhandler(sess, bosconn, 0x0001,         0x000b,                        serverpause, 0);
     399  aim_conn_addhandler(sess, bosconn, 0x0001,         0x0012,                        migrate, 0);
     400  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSG,         offlinemsg, 0);
    401401  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE, offlinemsgdone, 0);
    402402
    403403  #ifdef MID_REWROTE_ALL_THE_CRAP
    404   aim_conn_addhandler(sess, bosconn, 0xffff, 0xffff, faimtest_parse_unknown, 0);
     404  aim_conn_addhandler(sess, bosconn, 0xffff,         0xffff,                        faimtest_parse_unknown, 0);
    405405  #endif
    406406
     
    421421
    422422  /*
    423   snprintf(buddies, sizeof(buddies), "jagworks&jkretch76&");
     423  snprintf(buddies, sizeof(buddies), "Buddy1&Buddy2&");
    424424  snprintf(profile, sizeof(profile), "Hello.<br>This is a test");
    425425  */
     
    13871387{
    13881388  aim_userinfo_t *userinfo;
    1389  
     1389
    13901390  va_list ap;
    13911391  va_start(ap, fr);
    13921392  userinfo = va_arg(ap, aim_userinfo_t *);
    13931393  va_end(ap);
     1394
     1395  owl_buddylist_oncoming(owl_global_get_buddylist(&g), userinfo->sn);
     1396 
    13941397  /*
    13951398    printf("%ld  %s is now online (flags: %04x = %s%s%s%s%s%s%s%s) (caps = %s = 0x%08lx)\n",
     
    14071410    userinfo->capabilities);
    14081411  */
    1409   return 1;
     1412  return(1);
    14101413}
    14111414
     
    14181421  userinfo = va_arg(ap, aim_userinfo_t *);
    14191422  va_end(ap);
     1423
     1424  owl_buddylist_offgoing(owl_global_get_buddylist(&g), userinfo->sn);
    14201425
    14211426  /*
     
    24682473  }
    24692474}
     2475
     2476
     2477/****************************************/
     2478
     2479/*
     2480static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...) {
     2481        struct gaim_connection *gc = sess->aux_data;
     2482        struct oscar_data *od = gc->proto_data;
     2483        aim_userinfo_t *info;
     2484        time_t time_idle = 0, signon = 0;
     2485        int type = 0;
     2486        int caps = 0;
     2487        char *tmp;
     2488
     2489        va_list ap;
     2490        va_start(ap, fr);
     2491        info = va_arg(ap, aim_userinfo_t *);
     2492        va_end(ap);
     2493
     2494        if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES)
     2495                caps = info->capabilities;
     2496        if (info->flags & AIM_FLAG_ACTIVEBUDDY)
     2497                type |= UC_AB;
     2498
     2499        if ((!od->icq) && (info->present & AIM_USERINFO_PRESENT_FLAGS)) {
     2500                        if (info->flags & AIM_FLAG_UNCONFIRMED)
     2501                                type |= UC_UNCONFIRMED;
     2502                        if (info->flags & AIM_FLAG_ADMINISTRATOR)
     2503                                type |= UC_ADMIN;
     2504                        if (info->flags & AIM_FLAG_AOL)
     2505                                type |= UC_AOL;
     2506                        if (info->flags & AIM_FLAG_FREE)
     2507                                type |= UC_NORMAL;
     2508                        if (info->flags & AIM_FLAG_AWAY)
     2509                                type |= UC_UNAVAILABLE;
     2510                        if (info->flags & AIM_FLAG_WIRELESS)
     2511                                type |= UC_WIRELESS;
     2512        }
     2513        if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) {
     2514                type = (info->icqinfo.status << 16);
     2515                if (!(info->icqinfo.status & AIM_ICQ_STATE_CHAT) &&
     2516                      (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) {
     2517                        type |= UC_UNAVAILABLE;
     2518                }
     2519        }
     2520
     2521        if (caps & AIM_CAPS_ICQ)
     2522                caps ^= AIM_CAPS_ICQ;
     2523
     2524        if (info->present & AIM_USERINFO_PRESENT_IDLE) {
     2525                time(&time_idle);
     2526                time_idle -= info->idletime*60;
     2527        }
     2528
     2529        if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN)
     2530                signon = time(NULL) - info->sessionlen;
     2531
     2532        tmp = g_strdup(normalize(gc->username));
     2533        if (!strcmp(tmp, normalize(info->sn)))
     2534                g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", info->sn);
     2535        g_free(tmp);
     2536
     2537        serv_got_update(gc, info->sn, 1, info->warnlevel/10, signon,
     2538                        time_idle, type, caps);
     2539
     2540        return 1;
     2541}
     2542*/
Note: See TracChangeset for help on using the changeset viewer.