Changeset a352335c for aim.c


Ignore:
Timestamp:
Jul 5, 2003, 7:38:16 AM (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:
6873455
Parents:
c045455
Message:
Fixed bug in buddy idle time stuff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    rc045455 ra352335c  
    147147  priv->server = "login.oscar.aol.com";
    148148  owl_global_get_aimsess(&g)->aux_data = priv;
    149 
    150149 
    151150  /* login */
     
    153152  if (ret) {
    154153    owl_global_set_aimnologgedin(&g);
    155     /* printf("login returned %i\n"); */
     154    owl_global_set_no_doaimevents(&g);
    156155    return(-1);
    157156  }
     157  owl_global_set_doaimevents(&g);
     158  return(0);
     159}
     160
     161/* stuff to run once login has been successful */
     162void owl_aim_successful_login(char *screenname)
     163{
    158164  owl_global_set_aimloggedin(&g, screenname);
    159 
    160   return(0);
     165  owl_global_set_doaimevents(&g); /* this should already be on */
     166  owl_function_makemsg("%s logged in", screenname);
     167
     168  owl_function_debugmsg("Successful AIM login for %s", screenname);
     169
     170  /* start the ingorelogin timer */
     171  owl_timer_reset_newstart(owl_global_get_aim_login_timer(&g),
     172                           owl_global_get_aim_ignorelogin_timer(&g));
     173
    161174}
    162175
     
    166179  logout(owl_global_get_aimsess(&g));
    167180  owl_global_set_aimnologgedin(&g);
    168 }
    169 
    170 void owl_aim_login_error(void)
    171 {
    172   owl_function_makemsg("Authentication error on login");
     181  owl_global_set_no_doaimevents(&g);
     182}
     183
     184void owl_aim_login_error(char *message)
     185{
     186  if (message) {
     187    owl_function_makemsg(message);
     188  } else {
     189    owl_function_makemsg("Authentication error on login");
     190  }
    173191  owl_function_beep();
    174192  owl_global_set_aimnologgedin(&g);
     193  owl_global_set_no_doaimevents(&g);
    175194}
    176195
     
    365384
    366385  /* printf("Screen name: %s\n", info->sn); */
     386  owl_function_debugmsg("Here with %s", info->sn);
    367387
    368388  /*
     
    374394    printf("Error URL: %s\n", info->errorurl);
    375395    */
    376     owl_aim_login_error();
    377     /* aim_conn_kill(sess, &fr->conn); */
     396    if (info->errorcode==0x05) {
     397      /* Incorrect nick/password */
     398      owl_aim_login_error("Incorrect nickname or password.");
     399    } else if (info->errorcode==0x11) {
     400      /* Suspended account */
     401      owl_aim_login_error("Your account is currently suspended.");
     402    } else if (info->errorcode==0x14) {
     403      /* service temporarily unavailable */
     404      owl_aim_login_error("The AOL Instant Messenger service is temporarily unavailable.");
     405    } else if (info->errorcode==0x18) {
     406      /* connecting too frequently */
     407      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.");
     408    } else if (info->errorcode==0x1c) {
     409      /* client too old */
     410      owl_aim_login_error("The client version you are using is too old.");
     411    } else {
     412      owl_aim_login_error(NULL);
     413    }
     414    aim_conn_kill(sess, &fr->conn);
    378415    return 1;
    379416  }
     
    395432    return 1;
    396433  }
     434  owl_aim_successful_login(info->sn);
    397435  addcb_bos(sess, bosconn);
    398436  aim_sendcookie(sess, bosconn, info->cookie);
    399   owl_function_makemsg("%s logged in", info->sn);
    400437  return 1;
    401438}
     
    424461int faimtest_conncomplete(aim_session_t *sess, aim_frame_t *fr, ...)
    425462{
     463  /* owl_aim_successful_login(info->sn); */
     464
    426465  return 1;
    427466}
Note: See TracChangeset for help on using the changeset viewer.