Changeset a352335c
- Timestamp:
- Jul 5, 2003, 7:38:16 AM (21 years ago)
- 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
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rc045455 ra352335c 1 1 $Id$ 2 2 3 2.0.7-pre-2 4 Don't allow zwrite if zephyr isn't present 3 2.0.7 4 Idletimes now appear in the buddylisting 5 Failed AIM logins are now correctly reported 6 Owl will build now without zephyr, enabling it to act as a 7 standalone AIM client. 5 8 There is now a zcrypt command 6 9 Replies to zcrypted messages now work 7 Failed AIM logins are now correctly reported 8 9 2.0.7-pre-1 10 Owl should build now without zephyr, enabling it to act as a 11 standalone AIM client. 10 Don't allow zwrite if zephyr isn't present 12 11 Cleaned up some warnings from linux gcc. 13 12 Fixed bug that can cause response stuff to crash 14 Idletimes now appear in the buddylisting 13 Improved status command 14 Fixed bug in buddy stuff 15 15 16 16 2.0.6 -
aim.c
rc045455 ra352335c 147 147 priv->server = "login.oscar.aol.com"; 148 148 owl_global_get_aimsess(&g)->aux_data = priv; 149 150 149 151 150 /* login */ … … 153 152 if (ret) { 154 153 owl_global_set_aimnologgedin(&g); 155 /* printf("login returned %i\n"); */154 owl_global_set_no_doaimevents(&g); 156 155 return(-1); 157 156 } 157 owl_global_set_doaimevents(&g); 158 return(0); 159 } 160 161 /* stuff to run once login has been successful */ 162 void owl_aim_successful_login(char *screenname) 163 { 158 164 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 161 174 } 162 175 … … 166 179 logout(owl_global_get_aimsess(&g)); 167 180 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 184 void 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 } 173 191 owl_function_beep(); 174 192 owl_global_set_aimnologgedin(&g); 193 owl_global_set_no_doaimevents(&g); 175 194 } 176 195 … … 365 384 366 385 /* printf("Screen name: %s\n", info->sn); */ 386 owl_function_debugmsg("Here with %s", info->sn); 367 387 368 388 /* … … 374 394 printf("Error URL: %s\n", info->errorurl); 375 395 */ 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); 378 415 return 1; 379 416 } … … 395 432 return 1; 396 433 } 434 owl_aim_successful_login(info->sn); 397 435 addcb_bos(sess, bosconn); 398 436 aim_sendcookie(sess, bosconn, info->cookie); 399 owl_function_makemsg("%s logged in", info->sn);400 437 return 1; 401 438 } … … 424 461 int faimtest_conncomplete(aim_session_t *sess, aim_frame_t *fr, ...) 425 462 { 463 /* owl_aim_successful_login(info->sn); */ 464 426 465 return 1; 427 466 } -
buddylist.c
r5b85d19 ra352335c 10 10 11 11 /* Deal with an "oncoming" message. This means recognizing the user 12 * has logged in, and sending a message if they were not already12 * has logged in, and displaying a message if they were not already 13 13 * logged in. 14 14 */ 15 15 void owl_buddylist_oncoming(owl_buddylist *b, char *screenname) 16 16 { 17 int i, j, found;17 int *zero; 18 18 owl_message *m; 19 int *zero;20 19 21 found=0; 22 j=owl_list_get_size(&(b->buddies)); 23 for (i=0; i<j; i++) { 24 if (!strcasecmp(owl_list_get_element(&(b->buddies), i), screenname)) { 25 found=1; 26 break; 27 } 28 } 20 if (!owl_buddylist_is_buddy_loggedin(b, screenname)) { 29 21 30 if (!found) {31 22 /* add the buddy */ 32 23 owl_list_append_element(&(b->buddies), owl_strdup(screenname)); … … 36 27 37 28 /* do a request for idle time */ 38 owl_buddylist_request_idletime s(owl_global_get_buddylist(&g));29 owl_buddylist_request_idletime(b, screenname); 39 30 40 31 /* are we ingoring login messages for a while? */ 41 32 if (!owl_timer_is_expired(owl_global_get_aim_login_timer(&g))) return; 42 33 34 /* if not, create the login message */ 43 35 m=owl_malloc(sizeof(owl_message)); 44 36 owl_message_create_aim(m, … … 49 41 1); 50 42 owl_global_messagequeue_addmsg(&g, m); 51 52 43 } 53 44 } … … 58 49 void owl_buddylist_offgoing(owl_buddylist *b, char *screenname) 59 50 { 60 int i , j, found;51 int index; 61 52 owl_message *m; 62 53 63 found=0; 64 j=owl_list_get_size(&(b->buddies)); 65 for (i=0; i<j; i++) { 66 if (!strcasecmp(owl_list_get_element(&(b->buddies), i), screenname)) { 67 found=1; 68 owl_free(owl_list_get_element(&(b->buddies), i)); 69 owl_free(owl_list_get_element(&(b->idletimes), i)); 70 owl_list_remove_element(&(b->buddies), i); 71 owl_list_remove_element(&(b->idletimes), i); 72 break; 73 } 74 } 54 index=owl_buddylist_get_buddy_index(b, screenname); 55 if (index==-1) return; 75 56 76 if (found) { 77 m=owl_malloc(sizeof(owl_message)); 78 owl_message_create_aim(m, 79 screenname, 80 owl_global_get_aim_screenname(&g), 81 "", 82 OWL_MESSAGE_DIRECTION_IN, 83 -1); 57 owl_free(owl_list_get_element(&(b->buddies), index)); 58 owl_free(owl_list_get_element(&(b->idletimes), index)); 59 owl_list_remove_element(&(b->buddies), index); 60 owl_list_remove_element(&(b->idletimes), index); 84 61 85 owl_global_messagequeue_addmsg(&g, m); 86 } 62 m=owl_malloc(sizeof(owl_message)); 63 owl_message_create_aim(m, 64 screenname, 65 owl_global_get_aim_screenname(&g), 66 "", 67 OWL_MESSAGE_DIRECTION_IN, 68 -1); 69 owl_global_messagequeue_addmsg(&g, m); 87 70 } 88 71 … … 101 84 } 102 85 86 /* send request to the AIM server to retrieve info on one buddy. The 87 * AIM callback then fills in the values when the responses are 88 * received. The buddy must be logged in or no request will be 89 * performed. 90 */ 91 void owl_buddylist_request_idletime(owl_buddylist *b, char *screenname) 92 { 93 if (!owl_buddylist_is_buddy_loggedin(b, screenname)) return; 94 owl_aim_get_idle(screenname); 95 } 96 103 97 /* return the number of logged in buddies */ 104 98 int owl_buddylist_get_size(owl_buddylist *b) … … 110 104 char *owl_buddylist_get_buddy(owl_buddylist *b, int n) 111 105 { 106 if (n > owl_buddylist_get_size(b)-1) return(""); 112 107 return(owl_list_get_element(&(b->buddies), n)); 108 } 109 110 /* Return the index of the buddy 'screename' or -1 111 * if the buddy is not logged in. 112 */ 113 int owl_buddylist_get_buddy_index(owl_buddylist *b, char *screenname) 114 { 115 int i, j; 116 117 j=owl_list_get_size(&(b->buddies)); 118 for (i=0; i<j; i++) { 119 if (!strcasecmp(owl_list_get_element(&(b->buddies), i), screenname)) { 120 return(i); 121 } 122 } 123 return(-1); 124 } 125 126 /* return 1 if the buddy 'screenname' is logged in, 127 * otherwise return 0 128 */ 129 int owl_buddylist_is_buddy_loggedin(owl_buddylist *b, char *screenname) 130 { 131 if (owl_buddylist_get_buddy_index(b, screenname)!=-1) return(1); 132 return(0); 113 133 } 114 134 … … 127 147 void owl_buddylist_set_idletime(owl_buddylist *b, char *screenname, int minutes) 128 148 { 129 int i , j, *idle;149 int index, *idle; 130 150 131 j=owl_buddylist_get_size(b); 132 for (i=0; i<j; i++) { 133 if (!strcasecmp(owl_list_get_element(&(b->buddies), i), screenname)) { 134 owl_free(owl_list_get_element(&(b->idletimes), i)); 135 idle=owl_malloc(sizeof(int)); 136 *idle=minutes; 137 owl_list_replace_element(&(b->idletimes), i, idle); 138 return; 139 } 140 } 151 index=owl_buddylist_get_buddy_index(b, screenname); 152 if (index==-1) return; 153 154 owl_free(owl_list_get_element(&(b->idletimes), index)); 155 idle=owl_malloc(sizeof(int)); 156 *idle=minutes; 157 owl_list_replace_element(&(b->idletimes), index, idle); 141 158 } 142 159 -
commands.c
rc045455 ra352335c 2130 2130 /* try to login */ 2131 2131 ret=owl_aim_login(argv[1], argv[2]); 2132 if (!ret) { 2133 /* start the ingorelogin timer */ 2134 owl_timer_reset_newstart(owl_global_get_aim_login_timer(&g), 2135 owl_global_get_aim_ignorelogin_timer(&g)); 2136 2137 return(NULL); 2138 } 2139 2140 owl_function_makemsg("Warning: login for %s failed.\n"); 2132 if (ret) owl_function_makemsg("Warning: login for %s failed.\n"); 2133 2134 /* this is a test */ 2141 2135 return(NULL); 2142 2136 } -
functions.c
r3ba3af0 ra352335c 1684 1684 time_t start; 1685 1685 int up, days, hours, minutes; 1686 owl_fmtext fm; 1687 1688 owl_fmtext_init_null(&fm); 1686 1689 1687 1690 start=owl_global_get_starttime(&g); 1688 1691 1689 sprintf(buff, "Version: %s\n", OWL_VERSION_STRING); 1690 sprintf(buff, "%sScreen size: %i lines, %i columns\n", buff, owl_global_get_lines(&g), owl_global_get_cols(&g)); 1691 sprintf(buff, "%sStartup Arugments: %s\n", buff, owl_global_get_startupargs(&g)); 1692 sprintf(buff, "%sStartup Time: %s", buff, ctime(&start)); 1692 owl_fmtext_append_normal(&fm, "Version: "); 1693 owl_fmtext_append_normal(&fm, OWL_VERSION_STRING); 1694 owl_fmtext_append_normal(&fm, "\n"); 1695 1696 sprintf(buff, "Screen size: %i lines, %i columns\n", owl_global_get_lines(&g), owl_global_get_cols(&g)); 1697 owl_fmtext_append_normal(&fm, buff); 1698 1699 owl_fmtext_append_normal(&fm, "Startup Arugments: "); 1700 owl_fmtext_append_normal(&fm, owl_global_get_startupargs(&g)); 1701 owl_fmtext_append_normal(&fm, "\n"); 1702 sprintf(buff, "Startup Time: %s", ctime(&start)); 1703 owl_fmtext_append_normal(&fm, buff); 1704 1693 1705 1694 1706 up=owl_global_get_runtime(&g); … … 1699 1711 minutes=up/60; 1700 1712 up-=minutes*60; 1701 sprintf(buff, "%sRun Time: %i days %2.2i:%2.2i:%2.2i\n", buff, days, hours, minutes, up); 1713 sprintf(buff, "Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up); 1714 owl_fmtext_append_normal(&fm, buff); 1702 1715 1703 1716 if (owl_global_get_hascolors(&g)) { 1704 sprintf(buff, " %sColor: Yes, %i color pairs.\n", buff, owl_global_get_colorpairs(&g));1717 sprintf(buff, "Color: Yes, %i color pairs.\n", owl_global_get_colorpairs(&g)); 1705 1718 } else { 1706 strcat(buff, "Color: No.\n"); 1707 } 1708 1719 sprintf(buff, "Color: No.\n"); 1720 } 1721 owl_fmtext_append_normal(&fm, buff); 1722 1723 /* 1709 1724 sprintf(buff, "%sMemory Malloced: %i\n", buff, owl_global_get_malloced(&g)); 1710 1725 sprintf(buff, "%sMemory Freed: %i\n", buff, owl_global_get_freed(&g)); 1711 1726 sprintf(buff, "%sMemory In Use: %i\n", buff, owl_global_get_meminuse(&g)); 1712 1713 owl_function_popless_text(buff); 1727 */ 1728 1729 owl_fmtext_append_normal(&fm, "\n"); 1730 if (owl_global_is_aimloggedin(&g)) { 1731 owl_fmtext_append_normal(&fm, "AIM: logged in as "); 1732 owl_fmtext_append_normal(&fm, owl_global_get_aim_screenname(&g)); 1733 owl_fmtext_append_normal(&fm, "\n"); 1734 } else { 1735 owl_fmtext_append_normal(&fm, "AIM: not logged in\n"); 1736 } 1737 if (owl_global_is_doaimevents(&g)) { 1738 owl_fmtext_append_normal(&fm, "AIM: processing events\n "); 1739 } else { 1740 owl_fmtext_append_normal(&fm, "AIM: not processing events\n "); 1741 } 1742 1743 owl_function_popless_fmtext(&fm); 1744 owl_fmtext_free(&fm); 1714 1745 } 1715 1746 -
global.c
rde03334 ra352335c 100 100 g->havezephyr=0; 101 101 g->haveaim=0; 102 owl_global_set_no_doaimevents(g); 102 103 } 103 104 … … 674 675 char *owl_global_get_aim_screenname(owl_global *g) 675 676 { 676 return (g->aim_screenname); 677 if (owl_global_is_aimloggedin(g)) { 678 return (g->aim_screenname); 679 } 680 return(""); 677 681 } 678 682 … … 688 692 g->aim_loggedin=0; 689 693 } 694 695 int owl_global_is_doaimevents(owl_global *g) 696 { 697 if (g->aim_doprocessing) return(1); 698 return(0); 699 } 700 701 void owl_global_set_doaimevents(owl_global *g) 702 { 703 g->aim_doprocessing=1; 704 } 705 706 void owl_global_set_no_doaimevents(owl_global *g) 707 { 708 g->aim_doprocessing=0; 709 } 710 690 711 691 712 aim_session_t *owl_global_get_aimsess(owl_global *g) -
owl.c
rde03334 ra352335c 319 319 followlast=owl_global_should_followlast(&g); 320 320 321 /* If we're logged into AIM, do AIM stuff */ 322 if (owl_global_is_aimloggedin(&g)) { 323 owl_function_debugmsg("Doing aim processing"); 321 /* Do AIM stuff */ 322 if (owl_global_is_doaimevents(&g)) { 324 323 owl_aim_process_events(); 325 324 326 if (owl_timer_is_expired(owl_global_get_aim_buddyinfo_timer(&g))) { 327 owl_buddylist_request_idletimes(owl_global_get_buddylist(&g)); 328 owl_timer_reset(owl_global_get_aim_buddyinfo_timer(&g)); 325 if (owl_global_is_aimloggedin(&g)) { 326 if (owl_timer_is_expired(owl_global_get_aim_buddyinfo_timer(&g))) { 327 owl_buddylist_request_idletimes(owl_global_get_buddylist(&g)); 328 owl_timer_reset(owl_global_get_aim_buddyinfo_timer(&g)); 329 } 329 330 } 330 331 } -
owl.h
r5b85d19 ra352335c 21 21 static const char owl_h_fileIdent[] = "$Id$"; 22 22 23 #define OWL_VERSION 2.0.7 -pre-224 #define OWL_VERSION_STRING "2.0.7 -pre-2"23 #define OWL_VERSION 2.0.7 24 #define OWL_VERSION_STRING "2.0.7" 25 25 26 26 #define OWL_DEBUG 0 … … 447 447 owl_timer aim_buddyinfo_timer; 448 448 int aim_loggedin; /* true if currently logged into AIM */ 449 int aim_doprocessing; /* true if we should process AIM events (like pending login) */ 449 450 char *aim_screenname; /* currently logged in AIM screen name */ 450 451 owl_buddylist buddylist; /* list of logged in AIM buddies */
Note: See TracChangeset
for help on using the changeset viewer.