Changeset 8c92848


Ignore:
Timestamp:
Oct 25, 2003, 11:00:13 PM (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:
37eab7f
Parents:
db2dd3d
Message:
More AIM logout detection
Don't proclaim "interfaces changed" on first build.
Started experimenting with chatoom stuff
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rdb2dd3d r8c92848  
    44        Updated basic help
    55        Display CC: in outgoing CC messages
     6        More AIM logout detection
     7        Don't proclaim "interfaces changed" on first build.
    68       
    792.0.10
  • Makefile.in

    rec6ff52 r8c92848  
    6969        perl codelist.pl > owl_prototypes.h.new
    7070        @cmp -s owl_prototypes.h.new $@ || { \
    71          echo 'Interfaces changed!'; \
     71         test -f $@ && echo 'Interfaces changed!'; \
    7272         echo mv -f owl_prototypes.h.new $@; \
    7373              mv -f owl_prototypes.h.new $@; }
  • aim.c

    ra836200 r8c92848  
    149149
    150150#if 0
    151 static void oscar_login(GaimAccount *account) {
     151static void oscar_login(GaimAccount *account)
     152{
    152153  aim_session_t *sess;
    153154  aim_conn_t *conn;
     
    207208void owl_aim_successful_login(char *screenname)
    208209{
     210  owl_function_debugmsg("doing owl_aim_successful_login");
    209211  owl_global_set_aimloggedin(&g, screenname);
    210212  owl_global_set_doaimevents(&g); /* this should already be on */
     
    218220
    219221  /* aim_bos_setidle(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), 5000); */
     222  /* aim_bos_setprofile(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_CHAT); */
    220223}
    221224
     
    281284}
    282285
    283 void owl_aim_chat_join(char *chatroom)
    284 {
     286void owl_aim_chat_join(char *chatroom, int exchange)
     287{
     288  int ret;
     289
     290  /* ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); */
     291  /*
     292  ret=aim_chat_join(owl_global_get_aimsess(&g),
     293                    aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), exchange, chatroom, 0x0000);
     294  */
     295
     296  aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV);
     297  ret = aim_chatnav_createroom(owl_global_get_aimsess(&g),
     298                               aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), chatroom, exchange);
     299   ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000);
     300 
     301  owl_function_debugmsg("Attempting to join chatroom %s exchange %i", chatroom, exchange);
    285302}
    286303
     
    295312
    296313/* caller must free the return */
    297 char *owl_aim_normalize_screenname(char *in) {
     314char *owl_aim_normalize_screenname(char *in)
     315{
    298316  char *out;
    299317  int i, j, k;
     
    312330}
    313331
    314 int owl_aim_process_events() {
     332int owl_aim_process_events()
     333{
    315334  aim_session_t *aimsess;
    316335  aim_conn_t *waitingconn = NULL;
     
    334353  if (selstat == -1) {
    335354    owl_aim_logged_out();
    336   } else if (selstat == 0) {
     355  } else if (selstat == 0) { 
    337356    /* no events pending */
    338357  } else if (selstat == 1) { /* outgoing data pending */
     
    350369          /* printf("disconnected from %s\n", aim_directim_getsn(waitingconn)); */
    351370          aim_conn_kill(aimsess, &waitingconn);
     371          owl_aim_logged_out();
    352372        }
    353373      } else {
    354374        aim_conn_kill(aimsess, &waitingconn);
     375        owl_aim_logged_out();
    355376      }
    356377      if (!aim_getconn_type(aimsess, AIM_CONN_TYPE_BOS)) {
    357378        /* printf("major connection error\n"); */
     379        owl_aim_logged_out();
    358380        /* break; */
    359         /* we should probably kill the session */
    360381      }
    361382    }
     
    383404  va_end(ap);
    384405
     406  owl_function_debugmsg("doing faimtest_parse_login");
     407
    385408  aim_send_login(sess, fr->conn, priv->screenname, priv->password, &info, key);
    386409 
    387   return 1;
     410  return(1);
    388411}
    389412
     
    400423
    401424  /* printf("Screen name: %s\n", info->sn); */
     425  owl_function_debugmsg("doing faimtest_parse_authresp");
    402426  owl_function_debugmsg("faimtest_parse_authresp: %s", info->sn);
    403427
     
    411435    */
    412436    if (info->errorcode==0x05) {
    413       /* Incorrect nick/password */
    414437      owl_aim_login_error("Incorrect nickname or password.");
    415438    } else if (info->errorcode==0x11) {
    416       /* Suspended account */
    417439      owl_aim_login_error("Your account is currently suspended.");
    418440    } else if (info->errorcode==0x14) {
    419       /* service temporarily unavailable */
    420441      owl_aim_login_error("The AOL Instant Messenger service is temporarily unavailable.");
    421442    } else if (info->errorcode==0x18) {
    422       /* connecting too frequently */
    423443      owl_aim_login_error("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.");
    424444    } else if (info->errorcode==0x1c) {
    425       /* client too old */
    426445      owl_aim_login_error("The client version you are using is too old.");
    427446    } else {
     
    429448    }
    430449    aim_conn_kill(sess, &fr->conn);
    431     return 1;
     450    return(1);
    432451  }
    433452
     
    442461  if (!(bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, info->bosip))) {
    443462    /* printf("could not connect to BOS: internal error\n"); */
    444     return 1;
     463    return(1);
    445464  } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) {
    446465    /* printf("could not connect to BOS\n"); */
    447466    aim_conn_kill(sess, &bosconn);
    448     return 1;
     467    return(1);
    449468  }
    450469  owl_global_set_bossconn(&g, bosconn);
     
    452471  addcb_bos(sess, bosconn);
    453472  aim_sendcookie(sess, bosconn, info->cookielen, info->cookie);
    454   return 1;
     473  return(1);
    455474}
    456475
    457476int faimtest_flapversion(aim_session_t *sess, aim_frame_t *fr, ...)
    458477{
     478  owl_function_debugmsg("doing faimtest_flapversion");
     479
    459480#if 0
    460481  /* XXX fix libfaim to support this */
     
    478499int faimtest_conncomplete(aim_session_t *sess, aim_frame_t *fr, ...)
    479500{
     501  owl_function_debugmsg("doing faimtest_conncomplete");
    480502  /* owl_aim_successful_login(info->sn); */
    481 
    482503  return 1;
    483504}
     
    485506void addcb_bos(aim_session_t *sess, aim_conn_t *bosconn)
    486507{
    487 
     508  owl_function_debugmsg("doing addcb_bos");
    488509  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0);
    489510  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_bos, 0);
     
    523544  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE, offlinemsgdone, 0);
    524545
    525   #ifdef MID_REWROTE_ALL_THE_CRAP
    526   aim_conn_addhandler(sess, bosconn, 0xffff,         0xffff,                        faimtest_parse_unknown, 0);
    527   #endif
    528 
    529546  return;
    530547}
    531548
    532 
    533 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) {
     549static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...)
     550{
     551  owl_function_debugmsg("doing coninitdone_bos");
    534552  aim_reqpersonalinfo(sess, fr->conn);
    535553
    536   #ifndef NOSSI
    537554  aim_ssi_reqrights(sess);
    538555  aim_ssi_reqdata(sess);
    539   #endif
    540556
    541557  aim_bos_reqlocaterights(sess, fr->conn);
     
    544560  aim_bos_reqrights(sess, fr->conn); /* XXX - Don't call this with ssi? */
    545561
    546   #ifdef NOSSI
     562  aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_CHAT);
     563
     564#ifdef NOSSI
     565  /*
    547566  aim_bos_setgroupperm(sess, fr->conn, AIM_FLAG_ALLUSERS);
    548567  aim_bos_setprivacyflags(sess, fr->conn, AIM_PRIVFLAGS_ALLOWIDLE | AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
    549   #endif
    550 
    551   return 1;
     568  */
     569#endif
     570
     571  return(1);
    552572}
    553573
     
    763783  /* printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); */
    764784  aim_clientready(sess, fr->conn);
    765   /* printf("officially connected to BOS.\n"); */
     785  owl_function_debugmsg("officially connected to BOS.");
    766786  aim_icq_reqofflinemsgs(sess);
    767787  return 1;
     
    776796  maxsiglen = va_arg(ap, int);
    777797  va_end(ap);
    778  
     798
    779799  /* printf("locate rights: max signature length = %d\n", maxsiglen); */
    780800 
    781   return 1;
     801  return(1);
    782802}
    783803
     
    10481068  return(1);
    10491069
     1070  /*
    10501071  printf("userinfo: sn: %s\n", userinfo->sn);
    10511072  printf("userinfo: warnlevel: %f\n", aim_userinfo_warnlevel(userinfo));
     
    10531074  printuserflags(userinfo->flags);
    10541075  printf("\n");
     1076  */
    10551077
    10561078  /*
     
    10621084 
    10631085  if (inforeq == AIM_GETINFO_GENERALINFO) {
    1064     printf("userinfo: profile_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");
    1065     printf("userinfo: prof: %s\n", prof ? prof : "[none]");
     1086    owl_function_debugmsg("userinfo: profile_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");
     1087    owl_function_debugmsg("userinfo: prof: %s\n", prof ? prof : "[none]");
    10661088  } else if (inforeq == AIM_GETINFO_AWAYMESSAGE) {
    1067     printf("userinfo: awaymsg_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");
    1068     printf("userinfo: awaymsg: %s\n", prof ? prof : "[none]");
     1089    owl_function_debugmsg("userinfo: awaymsg_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");
     1090    owl_function_debugmsg("userinfo: awaymsg: %s\n", prof ? prof : "[none]");
    10691091  } else if (inforeq == AIM_GETINFO_CAPABILITIES) {
    1070     printf("userinfo: capabilities: see above\n");
     1092    owl_function_debugmsg("userinfo: capabilities: see above\n");
    10711093  } else {
    1072     printf("userinfo: unknown info request\n");
    1073   }
    1074  
    1075   return 1;
     1094    owl_function_debugmsg("userinfo: unknown info request\n");
     1095  }
     1096 
     1097  return(1);
    10761098}
    10771099
     
    14351457  }
    14361458 
    1437   return 1;
     1459  return(1);
    14381460}
    14391461
     
    14611483    /* printf("send file!\n"); */
    14621484  } else if (args->reqclass == AIM_CAPS_CHAT) {
     1485    owl_function_debugmsg("chat invite: %s, %i, %i", args->info.chat.roominfo.name, args->info.chat.roominfo.exchange, args->info.chat.roominfo.instance);
    14631486    /*
    14641487    printf("chat invitation: room name = %s\n", args->info.chat.roominfo.name);
     
    15381561    owl_buddy_set_idle_since(b, userinfo->idletime);
    15391562  }
     1563
     1564  if (userinfo->flags & AIM_FLAG_AWAY) {
     1565    owl_function_debugmsg("parse_oncoming sn: %s away flag!", userinfo->sn);
     1566  }
     1567 
    15401568  owl_function_debugmsg("parse_oncoming sn: %s idle: %i", userinfo->sn, userinfo->idletime);
    15411569   
     
    18711899static int ssirights(aim_session_t *sess, aim_frame_t *fr, ...)
    18721900{
    1873  
    18741901  /* printf("got SSI rights, requesting data\n"); */
    18751902  /* aim_ssi_reqdata(sess, fr->conn, 0, 0x0000); */
    18761903  aim_ssi_reqdata(sess);
    18771904 
    1878   return 1;
     1905  return(1);
    18791906}
    18801907
     
    19561983  va_end(ap);
    19571984
     1985  owl_function_debugmsg("In faimtest_chat_join");
    19581986  /*
    19591987  printf("chat: %s:  New occupants have joined:\n", aim_chat_getname(fr->conn));
     
    20152043  va_end(ap);
    20162044
     2045  owl_function_debugmsg("In faimtest_chat_infoupdate");
    20172046  /*
    20182047  printf("chat: %s:  info update:\n", croomname);
     
    20252054    printf("chat: %s:  \t\t%s\n", croomname, userinfo[i].sn);
    20262055 
    2027   printf("chat: %s:  \tRoom flags: 0x%04x (%s%s%s%s)\n",
     2056  owl_function_debugmsg("chat: %s:  \tRoom flags: 0x%04x (%s%s%s%s)\n",
    20282057         croomname, flags,
    20292058         (flags & AIM_CHATROOM_FLAG_EVILABLE) ? "Evilable, " : "",
     
    20382067  */
    20392068 
    2040   return 1;
     2069  return(1);
    20412070}
    20422071
     
    20522081  msg = va_arg(ap, char *);
    20532082  va_end(ap);
     2083
     2084  owl_function_debugmsg("in faimtest_chat_incomingmsg");
    20542085
    20552086  /*
     
    20752106  va_start(ap, fr);
    20762107  type = (fu16_t)va_arg(ap, unsigned int);
     2108
     2109  owl_function_debugmsg("in faimtest_chatnav_info");
    20772110 
    20782111  if (type == 0x0002) {
     
    21362169{
    21372170
     2171  owl_function_debugmsg("in faimtest_conninitdone_chat");
     2172 
    21382173  aim_clientready(sess, fr->conn);
    21392174 
     
    21452180  } else if (fr->conn->type == AIM_CONN_TYPE_CHAT) {
    21462181    /* printf("chat ready\n"); */
     2182    owl_function_debugmsg("Chat ready");
    21472183    aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0);
    21482184    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0);
     
    21572193{
    21582194  aim_conn_t *tstconn;
     2195
     2196  owl_function_debugmsg("in faimtest_chatnav_redirect");
    21592197 
    21602198  tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, redir->ip);
     
    21772215{
    21782216  aim_conn_t *tstconn;
     2217
     2218  owl_function_debugmsg("in chat_redirect");
    21792219 
    21802220  tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, redir->ip);
  • commands.c

    r15283bb r8c92848  
    245245              "such as zephyr, will also be able to use this command.  For now the\n"
    246246              "only available protocol is 'aim', specified as the first argument.\n"),
     247
     248#if 0
     249  OWLCMD_ARGS("join", owl_command_join, OWL_CTX_INTERACTIVE,
     250              "join a chat group",
     251              "join aim <groupname> [exchange]",
     252              "Join the AIM chatroom with 'groupname'.\n"),
     253#endif
    247254
    248255  OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
     
    992999      return(NULL);
    9931000    }
    994     /*
    995     owl_function_makemsg("This function is not yet operational.  Stay tuned.");
    996     return(NULL);
    997     */
    9981001    owl_aim_delbuddy(argv[2]);
    9991002    owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     
    10051008  }
    10061009
    1007 
     1010  return(NULL);
     1011}
     1012
     1013char *owl_command_join(int argc, char **argv, char *buff)
     1014{
     1015  if (argc!=3 && argc!=4) {
     1016    owl_function_makemsg("usage: join <protocol> <buddyname> [exchange]");
     1017    return(NULL);
     1018  }
     1019
     1020  if (!strcasecmp(argv[1], "aim")) {
     1021    if (!owl_global_is_aimloggedin(&g)) {
     1022      owl_function_makemsg("join aim: You must be logged into aim to use this command.");
     1023      return(NULL);
     1024    }
     1025    if (argc==3) {
     1026      owl_aim_chat_join(argv[2], 4);
     1027    } else {
     1028      owl_aim_chat_join(argv[2], atoi(argv[3]));
     1029    }
     1030    /* owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g)); */
     1031  } else {
     1032    owl_function_makemsg("join: currently the only supported protocol is 'aim'");
     1033  }
    10081034  return(NULL);
    10091035}
  • functions.c

    rf17bff98 r8c92848  
    748748{
    749749  owl_global_set_zaway_on(&g);
     750  owl_aim_set_awaymsg(owl_global_get_zaway_msg(&g));
    750751  owl_function_makemsg("zaway set (%s)", owl_global_get_zaway_msg(&g));
    751752}
  • owl.c

    r1077753b r8c92848  
    156156#endif   
    157157
    158  
    159158  /* create the owl directory, in case it does not exist */
    160159  dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR);
Note: See TracChangeset for help on using the changeset viewer.