Changeset aa5f725
- Timestamp:
- Jun 3, 2003, 3:40:28 PM (22 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:
- fd93b41
- Parents:
- 651560f
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r0ff8fb57 raa5f725 22 22 readconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ 23 23 regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ 24 keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c aim.c 24 keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ 25 aim.c buddylist.c 25 26 OWL_SRC = owl.c 26 27 TESTER_SRC = tester.c -
aim.c
r651560f raa5f725 367 367 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_bos, 0); 368 368 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); 401 401 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE, offlinemsgdone, 0); 402 402 403 403 #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); 405 405 #endif 406 406 … … 421 421 422 422 /* 423 snprintf(buddies, sizeof(buddies), " jagworks&jkretch76&");423 snprintf(buddies, sizeof(buddies), "Buddy1&Buddy2&"); 424 424 snprintf(profile, sizeof(profile), "Hello.<br>This is a test"); 425 425 */ … … 1387 1387 { 1388 1388 aim_userinfo_t *userinfo; 1389 1389 1390 1390 va_list ap; 1391 1391 va_start(ap, fr); 1392 1392 userinfo = va_arg(ap, aim_userinfo_t *); 1393 1393 va_end(ap); 1394 1395 owl_buddylist_oncoming(owl_global_get_buddylist(&g), userinfo->sn); 1396 1394 1397 /* 1395 1398 printf("%ld %s is now online (flags: %04x = %s%s%s%s%s%s%s%s) (caps = %s = 0x%08lx)\n", … … 1407 1410 userinfo->capabilities); 1408 1411 */ 1409 return 1;1412 return(1); 1410 1413 } 1411 1414 … … 1418 1421 userinfo = va_arg(ap, aim_userinfo_t *); 1419 1422 va_end(ap); 1423 1424 owl_buddylist_offgoing(owl_global_get_buddylist(&g), userinfo->sn); 1420 1425 1421 1426 /* … … 2468 2473 } 2469 2474 } 2475 2476 2477 /****************************************/ 2478 2479 /* 2480 static 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 */ -
commands.c
r651560f raa5f725 233 233 "znol [-f file]", 234 234 "Print a znol-style listing of users logged in"), 235 235 236 OWLCMD_ARGS("alist", owl_command_alist, OWL_CTX_INTERACTIVE, 237 "List AIM users logged in", 238 "alist", 239 "Print a listing of AIM users logged in"), 240 241 OWLCMD_ARGS("blist", owl_command_blist, OWL_CTX_INTERACTIVE, 242 "List all buddies logged in", 243 "alist", 244 "Print a listing of buddies logged in, regardless of protocol."), 245 236 246 OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE, 237 247 "scrolls receive window to the left", "", ""), … … 818 828 } 819 829 } 820 owl_function_zlist(file, elapsed, timesort); 830 owl_function_buddylist(0, 1, file); 831 return(NULL); 832 } 833 834 char *owl_command_alist() { 835 owl_function_buddylist(1, 0, NULL); 836 return(NULL); 837 } 838 839 char *owl_command_blist() { 840 owl_function_buddylist(1, 1, NULL); 821 841 return(NULL); 822 842 } … … 1378 1398 char *tmpbuff; 1379 1399 1400 if (!owl_global_is_aimloggedin(&g)) { 1401 owl_function_makemsg("You are not logged in to AIM."); 1402 return(NULL); 1403 } 1404 1380 1405 if (argc < 2) { 1381 1406 owl_function_makemsg("Not enough arguments to the aimwrite command."); 1382 } else { 1383 tmpbuff=owl_strdup(buff); 1384 owl_function_aimwrite_setup(tmpbuff); 1385 owl_global_set_buffercommand(&g, tmpbuff); 1386 owl_free(tmpbuff); 1387 } 1388 return NULL; 1407 return(NULL); 1408 } 1409 1410 tmpbuff=owl_strdup(buff); 1411 owl_function_aimwrite_setup(tmpbuff); 1412 owl_global_set_buffercommand(&g, tmpbuff); 1413 owl_free(tmpbuff); 1414 return(NULL); 1389 1415 } 1390 1416 … … 1772 1798 char *owl_command_aimlogin(int argc, char **argv, char *buff) { 1773 1799 int ret; 1774 1800 1775 1801 if (argc!=3) { 1776 1802 owl_function_makemsg("Wrong number of arguments to aimlogin command"); 1777 1803 return(NULL); 1778 1804 } 1805 1806 /* clear the buddylist */ 1807 owl_buddylist_clear(owl_global_get_buddylist(&g)); 1808 1809 /* try to login */ 1779 1810 ret=owl_aim_login(argv[1], argv[2]); 1780 1811 if (!ret) { … … 1788 1819 1789 1820 char *owl_command_aimlogout(int argc, char **argv, char *buff) { 1821 /* clear the buddylist */ 1822 owl_buddylist_clear(owl_global_get_buddylist(&g)); 1823 1790 1824 owl_aim_logout(); 1791 1825 return(NULL); -
functions.c
r3abf28b raa5f725 125 125 } 126 126 127 voidowl_function_make_outgoing_aim(char *body, char *to)127 int owl_function_make_outgoing_aim(char *body, char *to) 128 128 { 129 129 owl_message *m; 130 130 int followlast; 131 132 133 if (!owl_global_is_aimloggedin(&g)) { 134 return(-1); 135 } 131 136 132 137 followlast=owl_global_should_followlast(&g); … … 149 154 wnoutrefresh(owl_global_get_curs_recwin(&g)); 150 155 owl_global_set_needrefresh(&g); 156 return(0); 151 157 } 152 158 … … 2689 2695 } 2690 2696 2691 /* popup a znol listing. If file is NULL use the default .anyone */ 2692 /* this doesn't obey 'elapsed' or 'timesort' yet */ 2693 void owl_function_zlist(char *file, int elapsed, int timesort) 2697 /* Popup a buddylisting. If file is NULL use the default .anyone */ 2698 void owl_function_buddylist(int aim, int zephyr, char *file) 2694 2699 { 2695 2700 char *ourfile, *tmp, buff[LINE], *line; 2696 2701 FILE *f; 2697 int numlocs, ret, i ;2702 int numlocs, ret, i, j; 2698 2703 ZLocations_t location[200]; 2699 2704 owl_fmtext fm; 2700 2701 if (file==NULL) { 2702 tmp=owl_global_get_homedir(&g); 2703 if (!tmp) { 2704 owl_function_makemsg("Could not determine home directory"); 2705 owl_buddylist *b; 2706 2707 owl_fmtext_init_null(&fm); 2708 2709 if (aim && owl_global_is_aimloggedin(&g)) { 2710 b=owl_global_get_buddylist(&g); 2711 2712 owl_fmtext_append_bold(&fm, "AIM users logged in:\n"); 2713 j=owl_buddylist_get_size(b); 2714 for (i=0; i<j; i++) { 2715 owl_fmtext_append_normal(&fm, " "); 2716 owl_fmtext_append_normal(&fm, owl_buddylist_get_buddy(b, i)); 2717 owl_fmtext_append_normal(&fm, "\n"); 2718 } 2719 } 2720 2721 if (zephyr) { 2722 if (file==NULL) { 2723 tmp=owl_global_get_homedir(&g); 2724 if (!tmp) { 2725 owl_function_makemsg("Could not determine home directory"); 2726 return; 2727 } 2728 ourfile=owl_malloc(strlen(tmp)+50); 2729 sprintf(ourfile, "%s/.anyone", owl_global_get_homedir(&g)); 2730 } else { 2731 ourfile=owl_strdup(file); 2732 } 2733 2734 f=fopen(ourfile, "r"); 2735 if (!f) { 2736 owl_function_makemsg("Error opening file %s: %s", 2737 ourfile, 2738 strerror(errno) ? strerror(errno) : ""); 2705 2739 return; 2706 2740 } 2707 ourfile=owl_malloc(strlen(tmp)+50);2708 sprintf(ourfile, "%s/.anyone", owl_global_get_homedir(&g));2709 } else {2710 ourfile=owl_strdup(file);2711 }2712 2713 f=fopen(ourfile, "r");2714 if (!f) {2715 owl_function_makemsg("Error opening file %s: %s",2716 ourfile,2717 strerror(errno) ? strerror(errno) : "");2718 return;2719 }2720 2721 owl_fmtext_init_null(&fm);2722 2741 2723 while (fgets(buff, LINE, f)!=NULL) { 2724 /* ignore comments, blank lines etc. */ 2725 if (buff[0]=='#') continue; 2726 if (buff[0]=='\n') continue; 2727 if (buff[0]=='\0') continue; 2728 2729 /* strip the \n */ 2730 buff[strlen(buff)-1]='\0'; 2731 2732 /* ingore from # on */ 2733 tmp=strchr(buff, '#'); 2734 if (tmp) tmp[0]='\0'; 2735 2736 /* ingore from SPC */ 2737 tmp=strchr(buff, ' '); 2738 if (tmp) tmp[0]='\0'; 2739 2740 /* stick on the local realm. */ 2741 if (!strchr(buff, '@')) { 2742 strcat(buff, "@"); 2743 strcat(buff, ZGetRealm()); 2744 } 2745 2746 ret=ZLocateUser(buff, &numlocs, ZAUTH); 2747 if (ret!=ZERR_NONE) { 2748 owl_function_makemsg("Error getting location for %s", buff); 2749 continue; 2750 } 2751 2752 numlocs=200; 2753 ret=ZGetLocations(location, &numlocs); 2754 if (ret==0) { 2755 for (i=0; i<numlocs; i++) { 2756 line=malloc(strlen(location[i].host)+strlen(location[i].time)+strlen(location[i].tty)+100); 2757 tmp=short_zuser(buff); 2758 sprintf(line, "%-10.10s %-24.24s %-12.12s %20.20s\n", 2759 tmp, 2760 location[i].host, 2761 location[i].tty, 2762 location[i].time); 2763 owl_fmtext_append_normal(&fm, line); 2764 owl_free(tmp); 2742 owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n"); 2743 2744 while (fgets(buff, LINE, f)!=NULL) { 2745 /* ignore comments, blank lines etc. */ 2746 if (buff[0]=='#') continue; 2747 if (buff[0]=='\n') continue; 2748 if (buff[0]=='\0') continue; 2749 2750 /* strip the \n */ 2751 buff[strlen(buff)-1]='\0'; 2752 2753 /* ingore from # on */ 2754 tmp=strchr(buff, '#'); 2755 if (tmp) tmp[0]='\0'; 2756 2757 /* ingore from SPC */ 2758 tmp=strchr(buff, ' '); 2759 if (tmp) tmp[0]='\0'; 2760 2761 /* stick on the local realm. */ 2762 if (!strchr(buff, '@')) { 2763 strcat(buff, "@"); 2764 strcat(buff, ZGetRealm()); 2765 2765 } 2766 if (numlocs>=200) { 2767 owl_fmtext_append_normal(&fm, "Too many locations found for this user, truncating.\n"); 2766 2767 ret=ZLocateUser(buff, &numlocs, ZAUTH); 2768 if (ret!=ZERR_NONE) { 2769 owl_function_makemsg("Error getting location for %s", buff); 2770 continue; 2768 2771 } 2769 } 2770 } 2771 fclose(f); 2772 2772 2773 numlocs=200; 2774 ret=ZGetLocations(location, &numlocs); 2775 if (ret==0) { 2776 for (i=0; i<numlocs; i++) { 2777 line=malloc(strlen(location[i].host)+strlen(location[i].time)+strlen(location[i].tty)+100); 2778 tmp=short_zuser(buff); 2779 sprintf(line, " %-10.10s %-24.24s %-12.12s %20.20s\n", 2780 tmp, 2781 location[i].host, 2782 location[i].tty, 2783 location[i].time); 2784 owl_fmtext_append_normal(&fm, line); 2785 owl_free(tmp); 2786 } 2787 if (numlocs>=200) { 2788 owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n"); 2789 } 2790 } 2791 } 2792 fclose(f); 2793 owl_free(ourfile); 2794 } 2795 2773 2796 owl_function_popless_fmtext(&fm); 2774 2797 owl_fmtext_free(&fm); 2775 2776 owl_free(ourfile);2777 2798 } 2778 2799 -
global.c
rd09e5a1 raa5f725 92 92 g->aim_loggedin=0; 93 93 g->aim_lastnop=0; 94 95 owl_buddylist_init(&(g->buddylist)); 94 96 } 95 97 … … 717 719 return(1); 718 720 } 721 722 owl_buddylist *owl_global_get_buddylist(owl_global *g) { 723 return(&(g->buddylist)); 724 } 725 -
keys.c
r440ce01 raa5f725 241 241 242 242 BIND_CMD("i", "info", ""); 243 BIND_CMD("l", " zlist", "");243 BIND_CMD("l", "blist", ""); 244 244 BIND_CMD("M", "pop-message", ""); 245 245 BIND_CMD("T", "delete trash", "mark all 'trash' messages for deletion"); -
message.c
r3abf28b raa5f725 579 579 580 580 owl_free(indent); 581 } 582 583 /* For login direction == 0 584 * For logout direction == 1 585 */ 586 void owl_message_create_aim_login(owl_message *m, int direction, char *screenname) 587 { 588 owl_message_init(m); 589 owl_message_set_body(m, ""); 590 owl_message_set_sender(m, screenname); 591 owl_message_set_recipient(m, owl_global_get_aim_screenname(&g)); 592 owl_message_set_type_aim(m); 593 owl_message_set_direction_in(m); 594 595 owl_fmtext_init_null(&(m->fmtext)); 596 owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR); 597 if (direction==0) { 598 owl_fmtext_append_bold(&(m->fmtext), "AIM LOGIN"); 599 } else if (direction==1) { 600 owl_fmtext_append_bold(&(m->fmtext), "AIM LOGOUT"); 601 } 602 owl_fmtext_append_normal(&(m->fmtext), " for "); 603 owl_fmtext_append_normal(&(m->fmtext), screenname); 604 owl_fmtext_append_normal(&(m->fmtext), "\n"); 581 605 } 582 606 -
owl.h
rd09e5a1 raa5f725 350 350 int kpstackpos; /* location in stack (-1 = none) */ 351 351 } owl_keyhandler; 352 353 typedef struct _owl_buddylist { 354 owl_list buddies; 355 } owl_buddylist; 356 352 357 353 358 typedef struct _owl_global { … … 403 408 int aim_loggedin; 404 409 char *aim_screenname; 410 owl_buddylist buddylist; 405 411 owl_list messagequeue; /* for queueing up aim and other messages */ 406 412 } owl_global; -
owl_prototypes.h
r651560f raa5f725 22 22 extern void directim_requested(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args); 23 23 24 /* -------------------------------- buddylist.c -------------------------------- */ 25 extern void owl_buddylist_init(owl_buddylist *b); 26 extern void owl_buddylist_oncoming(owl_buddylist *b, char *screenname); 27 extern void owl_buddylist_offgoing(owl_buddylist *b, char *screenname); 28 extern int owl_buddylist_get_size(owl_buddylist *b); 29 extern char *owl_buddylist_get_buddy(owl_buddylist *b, int n); 30 extern void owl_buddylist_clear(owl_buddylist *b); 31 24 32 /* -------------------------------- cmd.c -------------------------------- */ 25 33 extern int owl_cmddict_setup(owl_cmddict *cd); … … 45 53 extern char *owl_command_help(int argc, char **argv, char *buff); 46 54 extern char *owl_command_zlist(int argc, char **argv, char *buff); 55 extern char *owl_command_alist(); 56 extern char *owl_command_blist(); 47 57 extern void owl_command_about(); 48 58 extern void owl_command_version(); … … 280 290 extern void owl_function_adminmsg(char *header, char *body); 281 291 extern void owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig); 282 extern voidowl_function_make_outgoing_aim(char *body, char *to);292 extern int owl_function_make_outgoing_aim(char *body, char *to); 283 293 extern void owl_function_zwrite_setup(char *line); 284 294 extern void owl_function_aimwrite_setup(char *line); … … 376 386 extern void owl_function_search_helper(int mode, int direction); 377 387 extern char *owl_function_ztext_stylestrip(char *zt); 378 extern void owl_function_ zlist(char *file, int elapsed, int timesort);388 extern void owl_function_buddylist(int aim, int zephyr, char *file); 379 389 extern void owl_function_dump(char *filename); 380 390 extern void owl_function_do_newmsgproc(void); … … 479 489 extern owl_message *owl_global_messageuque_popmsg(owl_global *g); 480 490 extern int owl_global_messagequeue_pending(owl_global *g); 491 extern owl_buddylist *owl_global_get_buddylist(owl_global *g); 481 492 482 493 /* -------------------------------- help.c -------------------------------- */ … … 614 625 extern void owl_message_create_incoming_aim(owl_message *m, char *sender, char *recipient, char *text); 615 626 extern void owl_message_create_outgoing_aim(owl_message *m, char *sender, char *recipient, char *text); 627 extern void owl_message_create_aim_login(owl_message *m, int direction, char *screenname); 616 628 extern void owl_message_create_admin(owl_message *m, char *header, char *text); 617 629 extern void owl_message_create_from_znotice(owl_message *m, ZNotice_t *n);
Note: See TracChangeset
for help on using the changeset viewer.