Changes in / [4626016:4485285]
- Files:
-
- 146 edited
Legend:
- Unmodified
- Added
- Removed
-
COPYING
rccc182c r7869e48 113 113 the original authors' reputations. 114 114 115 116 115 Finally, any free program is threatened constantly by software 117 116 patents. We wish to avoid the danger that companies distributing free … … 161 160 General Public License rather than by this special one. 162 161 163 164 162 GNU LIBRARY GENERAL PUBLIC LICENSE 165 163 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION … … 196 194 writing it). Whether that is true depends on what the Library does 197 195 and what the program that uses the Library does. 198 196 199 197 1. You may copy and distribute verbatim copies of the Library's 200 198 complete source code as you receive it, in any medium, provided that … … 208 206 and you may at your option offer warranty protection in exchange for a 209 207 fee. 210 211 208 212 209 2. You may modify your copy or copies of the Library or any portion … … 268 265 these notices. 269 266 270 271 267 Once this change is made in a given copy, it is irreversible for 272 268 that copy, so the ordinary GNU General Public License applies to all … … 319 315 Any executables containing that work also fall under Section 6, 320 316 whether or not they are linked directly with the Library itself. 321 322 317 323 318 6. As an exception to the Sections above, you may also compile or … … 375 370 distribute. 376 371 377 378 372 7. You may place library facilities that are a work based on the 379 373 Library side-by-side in a single library together with other library … … 416 410 You are not responsible for enforcing compliance by third parties to 417 411 this License. 418 419 412 420 413 11. If, as a consequence of a court judgment or allegation of patent … … 470 463 the Free Software Foundation. 471 464 472 473 465 14. If you wish to incorporate parts of the Library into other free 474 466 programs whose distribution conditions are incompatible with these, … … 505 497 END OF TERMS AND CONDITIONS 506 498 507 508 499 How to Apply These Terms to Your New Libraries 509 500 … … 849 840 - "Package" refers to the collection of files distributed by the Copyright 850 841 Holder, and derivatives of that collection of files created through 851 textual modification. 842 textual modification. 852 843 - "Standard Version" refers to such a Package if it has not been modified, 853 844 or has been modified in accordance with the wishes of the Copyright 854 Holder. 845 Holder. 855 846 - "Copyright Holder" is whoever is named in the copyright or copyrights for 856 the package. 847 the package. 857 848 - "You" is you, if you're thinking about copying or distributing this Package. 858 849 - "Reasonable copying fee" is whatever you can justify on the basis of media 859 850 cost, duplication charges, time of people involved, and so on. (You will 860 851 not be required to justify it to the Copyright Holder, but only to the 861 computing community at large as a market that must bear the fee.) 852 computing community at large as a market that must bear the fee.) 862 853 - "Freely Available" means that no fee is charged for the item itself, though 863 854 there may be fees involved in handling the item. It also means that 864 855 recipients of the item may redistribute it under the same conditions they 865 received it. 856 received it. 866 857 867 858 1. You may make and give away verbatim copies of the source form of the -
ChangeLog
r65ff3f4 r7869e48 456 456 libncursesw. - asedeno 457 457 * text entry: 458 first pass at utf-8 text entry. 458 first pass at utf-8 text entry. 459 459 * Change wcwidth() calls to mk_wcwidth() - asedeno 460 460 * First pass at outbound zephyr -> iso-8859-1 sanitizing. … … 730 730 731 731 2.1.12pre 732 Don't crash when sending/logging outgoing 732 Don't crash when sending/logging outgoing 733 733 AIM message and not logged in [BZ 90] 734 734 Don't crash when senging to someone not on AIM buddy list [BZ 94] 735 735 (patch from Alex Vandiver) 736 736 737 737 2.1.11 738 738 Don't crash doing zlocate with bad tickets. [BZ 12] … … 762 762 A fix for certain resize crashes (partly from alexmv) [BZ 55] 763 763 Turn off ISTRIP (gildea) 764 764 765 765 2.1.9 766 766 Include /usr/include/kerberosIV if it's found 767 767 768 768 2.1.8 769 769 Do OLC formatting for anything coming from olc.matisse 770 770 Improvements to popup size algorithm (from gildea) 771 771 Improved 'show colors' with non-colored labels 772 772 773 773 2.1.7 774 774 The colorclass command is added, to make colorization easy … … 777 777 Do ntohs() when printing zephyr port in zephyr info 778 778 Updated man page 779 779 780 780 2.1.6 781 781 Fixed three bugs found by Valgrind. … … 792 792 Dropped first brace in muxevents functions for consistency 793 793 Catch SIGHUP and SIGTERM and do a proper logout 794 794 795 795 2.1.5 796 796 Added a licence … … 802 802 will also be logged if this is set to 'on' 803 803 Added 'show license' 804 804 805 805 2.1.4 806 806 Normalize and downcase AIM names for logging … … 818 818 Do the initial zephyr_buddy_check when pseduologin set to true. 819 819 Updated man page 820 820 821 821 2.1.2 822 822 removed unused filter_depth variable 823 823 Fixed memory bug on receiving pings 824 824 825 825 2.1.1 826 826 Filters of filters now work. … … 865 865 Don't print extra new lines in popless_file 866 866 New zephyr_get_field function 867 867 868 868 2.0.14 869 869 Fixed missing word in startup message … … 876 876 Current directory added to 'status' command 877 877 Massive changes to libfaim and aim 878 878 879 879 2.0.13 880 880 Changed startup message for new mailing list 881 881 blist now prints AIM info even if .anyone is unreadable 882 882 Catch SIGPIPE and print an error rather than crashing. 883 [It's possible that this may have some portability 884 issues under Solaris and we may need to add some 883 [It's possible that this may have some portability 884 issues under Solaris and we may need to add some 885 885 configure stuff around SA_SIGINFO...] 886 886 Handle the case in aim_bstream_send where aim_send returns -1, … … 891 891 Un-word-wrap text when sending AIM messages. 892 892 Replace the main loop continue in the keyboard handler with an else. 893 893 894 894 2.0.12 895 895 Command history now doesn't allow the last entry … … 909 909 Print an error message if trying an invalid color for a filter 910 910 Fixed bug causing > not to go to end of editwin every time 911 911 912 912 2.0.11 913 913 Updated basic help … … 920 920 Zpunt now works with weird regex characters 921 921 Smart filters now work with weird regex characters 922 922 923 923 2.0.10 924 924 Allow 'hostname' in filters. … … 927 927 An admin message is displayed when you are logged out of AIM 928 928 Print an error message and admin message if an AIM send fails 929 929 930 930 2.0.9 931 931 Added the 'fancylines' variable. … … 941 941 Added command "show errors" 942 942 Fixed bug removing newlines in backup files 943 943 944 944 2.0.8 945 945 Increased size of screen name field in buddy listing … … 951 951 Add owl::login and owl::auth to legacy variables populated for format_msg. 952 952 Additions to intro.txt and advanced.txt documents. (Still in progress.) 953 Add base methods for login_host and login_tty 953 Add base methods for login_host and login_tty 954 954 and others that return undef. 955 New API for perl message formatting functions. 955 New API for perl message formatting functions. 956 956 Legacy variables are still supported for owl::format_msg 957 and owl::receive_msg, but these functions are now also 957 and owl::receive_msg, but these functions are now also 958 958 passed an owl::Message object which contains methods 959 for accessing the contents of the message. See perlwrap.pm 959 for accessing the contents of the message. See perlwrap.pm 960 960 (and docs TBD) for the available methods. 961 961 *** WARNING: The exact API for owl::Message has … … 970 970 When perl throws an error, the message is put in the msgwin 971 971 if possible. 972 Added perl functions for: 972 Added perl functions for: 973 973 owl::getcurmsg() -- returns an owl::Message object for 974 974 the active message … … 977 977 owl::zephyr_getrealm() -- returns the zephyr realm 978 978 owl::zephyr_getsender() -- returns the zephyr sender 979 Made owl::COMMAND("foo"); be syntactic sugar for 979 Made owl::COMMAND("foo"); be syntactic sugar for 980 980 owl::command("COMMAND foo"); 981 Added perlwrap.pm to contain perl code to be compiled into 981 Added perlwrap.pm to contain perl code to be compiled into 982 982 the binary. This is transformed into perlwrap.c by 983 983 encapsulate.pl. … … 998 998 Improved status command 999 999 Fixed bug in buddy stuff 1000 1000 1001 1001 2.0.6 1002 1002 aimlogin will now accept the screenname without a password and ask … … 1009 1009 Reformatted editwin.c and added capability of doing password-style 1010 1010 echoing 1011 1011 1012 1012 2.0.5 1013 1013 Fix in finding des for building zcrypt … … 1021 1021 Added hostname and tty name to LOGIN/LOGOUT zephyrs on oneline 1022 1022 style 1023 1023 1024 1024 2.0.4 1025 1025 Made command line option -n actually work … … 1056 1056 Translate < > & " &ensp, &emsp, &endash and 1057 1057 &emdash 1058 1058 1059 1059 2.0.3 1060 1060 Don't ring the terminal bell on mail messages. … … 1063 1063 Fixed a bug in fmtext 1064 1064 Expanded the size of the hostname buffer 1065 1065 1066 1066 2.0.2 1067 1067 Fixed bug in 'startup' command. … … 1159 1159 Disabled 'addbuddy' and 'delbuddy' for aim since it doesn't work yet 1160 1160 Hacked the Perl build stuff not to link with iconv 1161 1161 1162 1162 1.2.8 1163 1163 Class pings are displayed differently now 1164 1164 Updated owlconf.simple example to format outgoing messages. 1165 1165 1166 1166 1.2.7 1167 1167 Outgoing messages now go through the config for formatting … … 1179 1179 Started implementing zcrypt command 1180 1180 More updates to the intro doc 1181 1181 1182 1182 1.2.6 1183 1183 Started adding code for newmsgproc. It doesn't fully work yet! … … 1193 1193 Implemented the dump command 1194 1194 New startup message 1195 1195 1196 1196 1.2.5 1197 1197 Patch to fix memory bug in replying to CC messages … … 1201 1201 Cast to an int for isspace, to make gcc -Wall quiet 1202 1202 Added 'zlist' and 'l' to basic help. 1203 1203 1204 1204 1.2.4 1205 1205 'zlog in' will now take an optional thrid argument to set the … … 1228 1228 Made daemon.webzephyr a special case for smartstrip 1229 1229 Added 'out' as a default filter for outgoing messages 1230 1230 1231 1231 1.2.3 1232 1232 Added filters "ping", "auto" and "login" by default. … … 1247 1247 Print the zsig used for outgoing messages 1248 1248 The tty variable now controls the zephyr location tty name 1249 1249 1250 1250 1.2.2 1251 1251 Added the 'search' command. … … 1258 1258 When switching from an empty view to one we've previously 1259 1259 been in, the new current message position will attempt 1260 to be close to the current position from the last 1260 to be close to the current position from the last 1261 1261 time we visited that view. 1262 1262 Fixed bug in readconfig.c that prevented building under perl 5.005. … … 1276 1276 New framework for command handling. 1277 1277 New framework for keymap handling. 1278 Added commands for everything that is bound 1278 Added commands for everything that is bound 1279 1279 to a key (do 'show commands' to get the full list). 1280 1280 Added 'multi' and '(' commands to allow multiple commands 1281 to be specified on a line. 1281 to be specified on a line. 1282 1282 Added user keybindings with bindkey command. 1283 1283 Added command aliases (eg, "alias foo bar"). … … 1298 1298 C-t will transpose characters 1299 1299 Fix the scrolling bug where we would sometimes fail to scroll 1300 the screen down, leaving the current message off 1300 the screen down, leaving the current message off 1301 1301 the bottom of the screen. 1302 1302 Refixed 'login or login' typo in help … … 1342 1342 Added owl_sprintf which returns the formatted string, or NULL. 1343 1343 The caller must free this string. 1344 This will allocate enough memory and thus 1344 This will allocate enough memory and thus 1345 1345 avoid potential some buffer overrun situations. 1346 1346 Simple implementation of 'zwrite -m' (doesn't yet log an outgoing 1347 1347 message as having been sent.) 1348 The "Not logged in or subscribing to messages" error 1348 The "Not logged in or subscribing to messages" error 1349 1349 now includes the name of the recipient. 1350 1350 The "disable-ctrl-d" variable may also be set to "middle" 1351 which will result in ctrl-d only sending at the 1351 which will result in ctrl-d only sending at the 1352 1352 end of the message. This is now the default. 1353 1353 This also added a command "editmulti:done-or-delete". … … 1359 1359 The M-n and M-p keys will cycle through the history ring. 1360 1360 In particular, it is now possible to edit the command line 1361 of a zephyr being composed: C-c it and restart it 1361 of a zephyr being composed: C-c it and restart it 1362 1362 and then M-p to get the aborted composition back. 1363 1363 Added owl::send_zwrite(command, message) to the perl glue 1364 1364 to allow for the direct sending of multi-line messages. 1365 For example: owl::send_zwrite("-c foo -i bar", "hello"); 1366 Changed owl_fmtext_print_plain to return an alloc'd string to 1365 For example: owl::send_zwrite("-c foo -i bar", "hello"); 1366 Changed owl_fmtext_print_plain to return an alloc'd string to 1367 1367 avoid buffer overrun risks. 1368 Added owl::ztext_stylestrip("...") function to perlglue 1368 Added owl::ztext_stylestrip("...") function to perlglue 1369 1369 which returns the ztext with formatting stripped out. 1370 1370 Added colorztext variable which can be used to disable @color() … … 1380 1380 Added opera to the allowed options to the webbrowser variable. 1381 1381 Fixed some buffer overruns in the "reply" command. 1382 When repying to "all" on a message that begins with "CC:" (eg, sent 1382 When repying to "all" on a message that begins with "CC:" (eg, sent 1383 1383 with "zwrite -C", the reply line will be constructed 1384 1384 from the sender and the usernames on the CC: line … … 1391 1391 Added --no-move option to delete command. 1392 1392 In particular, delete-and-always-move-down may now 1393 be implemented with 1393 be implemented with 1394 1394 '( delete --no-move ; next --skip-deleted )'. 1395 Folded the nextmsg and prevmsg commands and functions together into 1395 Folded the nextmsg and prevmsg commands and functions together into 1396 1396 one command which takes arguments. 1397 1397 Added '--filter <name>' option (eg, for next_personal), 1398 1398 '--skip-deleted' option, and 1399 1399 '--last-if-none'/'--first-if-none' options. 1400 Help updated accordingly. 1401 In particular, the 'personal' filter is now used 1402 for 'next personal'. 1403 Added --smart-filter and --smart-filter-instance options 1400 Help updated accordingly. 1401 In particular, the 'personal' filter is now used 1402 for 'next personal'. 1403 Added --smart-filter and --smart-filter-instance options 1404 1404 to the next and prev commands. 1405 1405 Updated examples/owlconf.erik with the above. 1406 Made owl_function_fast*filt return a string and not do the 1406 Made owl_function_fast*filt return a string and not do the 1407 1407 narrowing, to make it more general. 1408 1408 Added a smartfilter command that creates a filter 1409 1409 based on the current message and returns the name 1410 1410 of the filter. 1411 Added M-C-n and M-C-p keybindings to "move to next message 1412 matching current" and "move to previous message 1411 Added M-C-n and M-C-p keybindings to "move to next message 1412 matching current" and "move to previous message 1413 1413 matching current" 1414 Added variables edit:maxfillcols and edit:maxwrapcols which 1414 Added variables edit:maxfillcols and edit:maxwrapcols which 1415 1415 will limit how wide editing paragraphs may get before 1416 1416 they get wrapped. This is a max and may be narrower … … 1419 1419 edit:maxfillcols and unlimited for edit:maxwrapcols. 1420 1420 Added smartzpunt command with key binding of "C-x k". 1421 This starts a zpunt command filled in with 1421 This starts a zpunt command filled in with 1422 1422 the proposed zpunt. 1423 1423 Fixed a memory reference bug in delete and undelete commands. … … 1426 1426 call back into owl. This allows perl to get the return 1427 1427 value of strings returned by owl commands. 1428 Added the getview command which returns the name of the current 1429 view's filter. 1428 Added the getview command which returns the name of the current 1429 view's filter. 1430 1430 Added the getvar command which returns the value of a variable. 1431 Added an example to examples/owlconf.erik which uses TAB to 1432 narrow and restore the view. 1433 Added an example to examples/owlconf.erik which uses M-c to 1431 Added an example to examples/owlconf.erik which uses TAB to 1432 narrow and restore the view. 1433 Added an example to examples/owlconf.erik which uses M-c to 1434 1434 color messages matching the current one green. 1435 1435 Integrated change to fix problem with popup blinking on new zephyrs. … … 1443 1443 and new show commands. 1444 1444 Show with arguments produces help on show. 1445 Fix a bug in readconfig caught by efence (where we'd try to read before 1445 Fix a bug in readconfig caught by efence (where we'd try to read before 1446 1446 the beginning of a string if it was empty). 1447 1447 The perl command doesn't do makemsg directly, but instead 1448 returns the string and it will get printed if it 1448 returns the string and it will get printed if it 1449 1449 was run interactively. 1450 1450 1451 1451 1.1.3 1452 1452 'show subs' and 'show subscriptions' are now the same as 'getsubs' … … 1494 1494 Include login/logout messages in auto user filters 1495 1495 'V' changes to the home view ('all' by default) 1496 1496 1497 1497 1.1.1 1498 Fixed perl, aperl, and pperl commands to deal with quoting 1498 Fixed perl, aperl, and pperl commands to deal with quoting 1499 1499 and spaces in a saner manner. 1500 1500 Removed all owl_get_* methods for booleans and switched 1501 cases where they were used to owl_is_* 1501 cases where they were used to owl_is_* 1502 1502 Changes to owlconf.erik to use some new features. 1503 Increased the size of the help buffer (as it 1503 Increased the size of the help buffer (as it 1504 1504 was overflowing and truncating the help message). 1505 1505 Variables prefixed with a _ are not shown in help 1506 or by printallvars (and prefixed Not Yet Implemented 1506 or by printallvars (and prefixed Not Yet Implemented 1507 1507 variables with this). 1508 1508 Fix typo in help … … 1517 1517 display admin message time in 'info' command 1518 1518 fixed an editwin M-> last character bug 1519 1519 1520 1520 1.1 1521 1521 reply is a normal function now … … 1567 1567 Fixed an arg checking bug in delete command 1568 1568 Added owl::id to perl namespace with message id 1569 Fixed a memory corruption bug in readconfig.c (where right 1569 Fixed a memory corruption bug in readconfig.c (where right 1570 1570 after the strdup to "out", we'd strcat a \n onto the end. 1571 1571 This would be triggered whenever owl::format_msg returned 1572 1572 a string not ending in a newline 1573 Added 'X' keybinding which expunges and then switches to 1574 a view defined by the variable "view_home" which defaults 1573 Added 'X' keybinding which expunges and then switches to 1574 a view defined by the variable "view_home" which defaults 1575 1575 to "all" 1576 1576 Consolidated readconfig.c somewhat to remove duplication. … … 1601 1601 are generated from variable.c by stubgen.pl. 1602 1602 The help.c messages for variables now calls into variable.c 1603 so all information about most variables is in one place. 1603 so all information about most variables is in one place. 1604 1604 Cleaned out code from global.c and command.c that was made obselete 1605 1605 by variable overhaul. 1606 1606 The set command now takes a -q option to not log a message. 1607 1607 Fixed a bug where set and print with no arguments would 1608 print "Undefined variable" in addition 1608 print "Undefined variable" in addition 1609 1609 to running owl_function_printallvars. 1610 1610 debug is now a variable that can be turned on and off. 1611 1611 Fixed mail,inbox message parsing in examples/owlconf.erik 1612 Made zaway_msg and zaway_msg_default into variables 1613 Changed owl_function_makemsg and owl_function_debugmsg 1612 Made zaway_msg and zaway_msg_default into variables 1613 Changed owl_function_makemsg and owl_function_debugmsg 1614 1614 to use varargs (ie, so they can now take a format 1615 1615 string with args). … … 1631 1631 Added doc/code.txt which gives a brief overview of the code. 1632 1632 Added tags makefile rule and added TAGS to distclean rule. 1633 1633 1634 1634 1.0.1 1635 1635 fix frees in loadsubs and loadloginsubs 1636 1636 don't return in owl_free 1637 1637 1638 1638 1.0 1639 1639 'print' and 'set' with no arguments prints all variables … … 1665 1665 you can now reply to an admin message 1666 1666 don't display an error about keypress on window resize 1667 1667 1668 1668 0.11 1669 1669 fixed bug in viewing messages longer than the screen … … 1681 1681 change malloc, realloc, strdup and free to use owl hooks so that 1682 1682 debugging can be added 1683 1683 1684 1684 0.10.1 1685 1685 fixed a trailing space bug in the parser … … 1688 1688 fixed bug in reporting which M- key was pressed 1689 1689 C-g will now cancel commands like C-c 1690 1690 1691 1691 0.10 1692 1692 implemented owl_function_full_redisplay(). … … 1713 1713 some build cleanup 1714 1714 1715 1715 1716 1716 0.9 1717 1717 added owl_message_is_personal and have things use it … … 1728 1728 added smart bolding and userclue 1729 1729 fixed a bug causing pings to beep even if rxping is off 1730 1730 1731 1731 0.8.1 1732 1732 fixed bug in logging code 1733 1733 1734 1734 0.8 1735 1735 implemented personal logging … … 1738 1738 fixed the backspace problem 1739 1739 -v command line option prints the version number 1740 1740 1741 1741 0.7 1742 1742 load-subs will report error opening file … … 1752 1752 added displayoutgoing variable 1753 1753 temporarily removed error printing for zlog in / out 1754 1754 1755 1755 0.61 1756 1756 fixed bug in "message sent to <foo>" for zwrite 1757 1757 1758 1758 0.6 1759 1759 help updated … … 1766 1766 personal bell variable 1767 1767 beta message now an admin message 1768 1768 1769 1769 0.5 1770 1770 Added the debug command and flag -
aim.c
rf271129 r7869e48 107 107 * future. It's still called by Owl. 108 108 */ 109 109 110 110 } 111 111 … … 131 131 aim_setdebuggingcb(sess, faimtest_debugcb); 132 132 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL); 133 133 134 134 /* this will leak, I know and just don't care right now */ 135 135 priv=g_new0(struct owlfaim_priv, 1); … … 165 165 */ 166 166 167 167 168 168 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, faimtest_flapversion, 0); 169 169 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0); … … 174 174 /* aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); */ 175 175 /* aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); */ 176 176 177 177 /* start processing AIM events */ 178 178 owl_global_set_doaimevents(&g); … … 338 338 339 339 owl_function_debugmsg("owl_aim_search: doing search for %s", email); 340 ret=aim_search_address(owl_global_get_aimsess(&g), 340 ret=aim_search_address(owl_global_get_aimsess(&g), 341 341 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_BOS), 342 342 email); … … 358 358 len=499; 359 359 } 360 360 361 361 aim_locate_setprofile(owl_global_get_aimsess(&g), 362 362 NULL, NULL, 0, … … 367 367 aim_bos_setprofile(owl_global_get_aimsess(&g), 368 368 owl_global_get_bosconn(&g), 369 NULL, NULL, 0, "us-ascii", msg, 369 NULL, NULL, 0, "us-ascii", msg, 370 370 strlen(msg), 0); 371 371 */ … … 421 421 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), name, exchange); 422 422 ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000); 423 423 424 424 } 425 425 … … 468 468 if (selstat == -1) { 469 469 owl_aim_logged_out(); 470 } else if (selstat == 0) { 470 } else if (selstat == 0) { 471 471 /* no events pending */ 472 472 } else if (selstat == 1) { /* outgoing data pending */ … … 474 474 } else if (selstat == 2) { /* incoming data pending */ 475 475 /* printf("selstat == 2\n"); */ 476 476 477 477 if (aim_get_command(aimsess, waitingconn) >= 0) { 478 478 aim_rxdispatch(aimsess); … … 510 510 struct owlfaim_priv *priv = sess->aux_data; 511 511 struct client_info_s info = CLIENTINFO_AIM_KNOWNGOOD; 512 512 513 513 const char *key; 514 514 va_list ap; … … 519 519 520 520 aim_send_login(sess, fr->conn, priv->screenname, priv->password, &info, key); 521 521 522 522 return(1); 523 523 } … … 649 649 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOK, 0x0003, faimtest_parse_searchreply, 0); 650 650 */ 651 651 652 652 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, faimtest_parse_msgerr, 0); 653 653 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, faimtest_parse_userinfo, 0); … … 733 733 fu16_t code; 734 734 const char *msg; 735 735 736 736 va_start(ap, fr); 737 737 code = va_arg(ap, int); 738 738 msg = va_arg(ap, const char *); 739 739 va_end(ap); 740 740 741 741 owl_function_error("faimtest_parse_connerr: Code 0x%04x: %s\n", code, msg); 742 742 aim_conn_kill(sess, &fr->conn); /* this will break the main loop */ 743 743 744 744 priv->connected = 0; 745 745 746 746 return 1; 747 747 } … … 751 751 int status; 752 752 va_list ap; 753 753 754 754 va_start(ap, fr); 755 755 status = va_arg(ap, int); /* status code of confirmation request */ … … 758 758 /* owl_function_debugmsg("faimtest_accountconfirm: Code 0x%04x: %s\n", code, msg); */ 759 759 owl_function_debugmsg("faimtest_accountconfirm: account confirmation returned status 0x%04x (%s)\n", status, (status==0x0000)?"email sent":"unknown"); 760 760 761 761 return 1; 762 762 } … … 768 768 const char *val; 769 769 va_list ap; 770 770 771 771 va_start(ap, fr); 772 772 change = va_arg(ap, int); … … 777 777 str = va_arg(ap, int); 778 778 va_end(ap); 779 779 780 780 owl_function_debugmsg("faimtest_infochange: info%s: perms = %d, type = %x, length = %d, val = %s", change?" change":"", perms, type, length, str?val:"(not string)"); 781 781 782 782 return(1); 783 783 } … … 790 790 791 791 owl_function_debugmsg("faimtest_handledirect:"); 792 792 793 793 va_start(ap, fr); 794 794 redir = va_arg(ap, struct aim_redirect_data *); 795 795 796 796 if (redir->group == 0x0005) { /* Adverts */ 797 797 798 798 } else if (redir->group == 0x0007) { /* Authorizer */ 799 799 aim_conn_t *tstconn; 800 800 801 801 owl_function_debugmsg("faimtest_handledirect: autorizer"); 802 802 803 803 tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, redir->ip); 804 804 if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) { … … 832 832 struct aim_icbmparameters *params; 833 833 va_list ap; 834 834 835 835 va_start(ap, fr); 836 836 params = va_arg(ap, struct aim_icbmparameters *); 837 837 va_end(ap); 838 838 839 839 owl_function_debugmsg("faimtest_icbmparaminfo: ICBM Parameters: maxchannel = %d, default flags = 0x%08x, max msg len = %d, max sender evil = %f, max reciever evil = %f, min msg interval = %u", 840 840 params->maxchan, params->flags, params->maxmsglen, ((float)params->maxsenderwarn)/10.0, ((float)params->maxrecverwarn)/10.0, params->minmsginterval); 841 841 842 842 /* 843 843 * Set these to your taste, or client medium. Setting minmsginterval … … 850 850 /* aim_seticbmparam(sess, params); */ 851 851 aim_im_setparams(sess, params); 852 852 853 853 return 1; 854 854 } … … 858 858 va_list ap; 859 859 fu16_t maxbuddies, maxwatchers; 860 860 861 861 va_start(ap, fr); 862 862 maxbuddies = va_arg(ap, int); 863 863 maxwatchers = va_arg(ap, int); 864 864 va_end(ap); 865 865 866 866 owl_function_debugmsg("faimtest_parse_buddyrights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); 867 867 868 868 /* aim_ssi_reqrights(sess, fr->conn); */ 869 869 aim_ssi_reqrights(sess); 870 870 871 871 return 1; 872 872 } … … 876 876 va_list ap; 877 877 fu16_t maxpermits, maxdenies; 878 878 879 879 va_start(ap, fr); 880 880 maxpermits = va_arg(ap, int); 881 881 maxdenies = va_arg(ap, int); 882 882 va_end(ap); 883 883 884 884 owl_function_debugmsg("faimtest_bosrights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); 885 885 aim_clientready(sess, fr->conn); … … 893 893 va_list ap; 894 894 fu16_t maxsiglen; 895 895 896 896 va_start(ap, fr); 897 897 maxsiglen = va_arg(ap, int); … … 899 899 900 900 owl_function_debugmsg("faimtest_locrights: rights: max signature length = %d\n", maxsiglen); 901 901 902 902 return(1); 903 903 } … … 944 944 945 945 owl_function_debugmsg("faimtest_parse_motd: %s (%d / %s)\n", msg?msg:"nomsg", id, (id < codeslen)?codes[id]:"unknown"); 946 946 947 947 return 1; 948 948 } … … 960 960 if (flags & AIM_FLAG_WIRELESS) printf("WIRELESS "); 961 961 if (flags & AIM_FLAG_ACTIVEBUDDY) printf("ACTIVEBUDDY "); 962 962 963 963 return; 964 964 } … … 1073 1073 static int faimtest_parse_incoming_im_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) 1074 1074 { 1075 /* 1075 /* 1076 1076 printf("rendezvous: source sn = %s\n", userinfo->sn); 1077 1077 printf("rendezvous: \twarnlevel = %f\n", aim_userinfo_warnlevel(userinfo)); … … 1079 1079 printuserflags(userinfo->flags); 1080 1080 printf("\n"); 1081 1081 1082 1082 printf("rendezvous: \tonlinesince = %lu\n", userinfo->onlinesince); 1083 1083 printf("rendezvous: \tidletime = 0x%04x\n", userinfo->idletime); 1084 1084 1085 1085 printf("rendezvous: message/description = %s\n", args->msg); 1086 1086 printf("rendezvous: encoding = %s\n", args->encoding); 1087 1087 printf("rendezvous: language = %s\n", args->language); 1088 1088 */ 1089 1089 1090 1090 if (args->reqclass == AIM_CAPS_SENDFILE) { 1091 1091 owl_function_debugmsg("faimtest_parse_incoming_im_chan2: send file!"); … … 1119 1119 va_list ap; 1120 1120 int ret = 0; 1121 1121 1122 1122 va_start(ap, fr); 1123 1123 channel = (fu16_t)va_arg(ap, unsigned int); 1124 1124 userinfo = va_arg(ap, aim_userinfo_t *); 1125 1125 1126 1126 if (channel == 1) { 1127 1127 struct aim_incomingim_ch1_args *args; … … 1151 1151 1152 1152 nz_screenname=owl_aim_normalize_screenname(userinfo->sn); 1153 1153 1154 1154 owl_buddylist_oncoming(owl_global_get_buddylist(&g), nz_screenname); 1155 1155 … … 1173 1173 owl_function_debugmsg("parse_oncoming sn: %s away flag!", userinfo->sn); 1174 1174 } 1175 1175 1176 1176 owl_function_debugmsg("parse_oncoming sn: %s idle: %i", userinfo->sn, userinfo->idletime); 1177 1177 1178 1178 g_free(nz_screenname); 1179 1179 1180 1180 /* 1181 1181 printf("%ld %s is now online (flags: %04x = %s%s%s%s%s%s%s%s) (caps = %s = 0x%08lx)\n", … … 1201 1201 char *nz_screenname; 1202 1202 va_list ap; 1203 1203 1204 1204 va_start(ap, fr); 1205 1205 userinfo = va_arg(ap, aim_userinfo_t *); … … 1229 1229 userinfo->capabilities); 1230 1230 */ 1231 1231 1232 1232 return 1; 1233 1233 } … … 1238 1238 va_list ap; 1239 1239 fu16_t reason; 1240 1240 1241 1241 va_start(ap, fr); 1242 1242 reason = (fu16_t)va_arg(ap, unsigned int); 1243 1243 va_end(ap); 1244 1244 1245 1245 /* printf("snac threw error (reason 0x%04x: %s)\n", reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */ 1246 1246 if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]); 1247 1247 1248 1248 return 1; 1249 1249 } … … 1254 1254 const char *destsn; 1255 1255 fu16_t reason; 1256 1256 1257 1257 va_start(ap, fr); 1258 1258 reason = (fu16_t)va_arg(ap, unsigned int); 1259 1259 destsn = va_arg(ap, const char *); 1260 1260 va_end(ap); 1261 1261 1262 1262 /* printf("message to %s bounced (reason 0x%04x: %s)\n", destsn, reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */ 1263 1263 if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]); … … 1266 1266 owl_function_adminmsg("", "Could not send AIM message, user not logged on"); 1267 1267 } 1268 1268 1269 1269 return 1; 1270 1270 } … … 1275 1275 const char *destsn; 1276 1276 fu16_t reason; 1277 1277 1278 1278 va_start(ap, fr); 1279 1279 reason = (fu16_t)va_arg(ap, unsigned int); 1280 1280 destsn = va_arg(ap, const char *); 1281 1281 va_end(ap); 1282 1282 1283 1283 /* printf("user information for %s unavailable (reason 0x%04x: %s)\n", destsn, reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */ 1284 1284 if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]); 1285 1285 1286 1286 return 1; 1287 1287 } … … 1297 1297 }; 1298 1298 static int missedreasonslen = 5; 1299 1299 1300 1300 va_list ap; 1301 1301 fu16_t chan, nummissed, reason; 1302 1302 aim_userinfo_t *userinfo; 1303 1303 1304 1304 va_start(ap, fr); 1305 1305 chan = (fu16_t)va_arg(ap, unsigned int); … … 1308 1308 reason = (fu16_t)va_arg(ap, unsigned int); 1309 1309 va_end(ap); 1310 1310 1311 1311 owl_function_debugmsg("faimtest_parse_misses: missed %d messages from %s on channel %d (reason %d: %s)\n", nummissed, userinfo->sn, chan, reason, (reason<missedreasonslen)?missedreasons[reason]:"unknown"); 1312 1312 1313 1313 return 1; 1314 1314 } … … 1322 1322 fu16_t type; 1323 1323 const char *sn = NULL; 1324 1324 1325 1325 va_start(ap, fr); 1326 1326 type = (fu16_t)va_arg(ap, unsigned int); 1327 1327 sn = va_arg(ap, const char *); 1328 1328 va_end(ap); 1329 1329 1330 1330 owl_function_debugmsg("faimtest_parse_msgack: 0x%04x / %s\n", type, sn); 1331 1331 1332 1332 return 1; 1333 1333 } … … 1346 1346 fu32_t windowsize, clear, alert, limit, disconnect; 1347 1347 fu32_t currentavg, maxavg; 1348 1349 va_start(ap, fr); 1350 1348 1349 va_start(ap, fr); 1350 1351 1351 /* See code explanations below */ 1352 1352 code = (fu16_t)va_arg(ap, unsigned int); 1353 1353 1354 1354 /* 1355 1355 * See comments above aim_parse_ratechange_middle() in aim_rxhandlers.c. 1356 1356 */ 1357 1357 rateclass = (fu16_t)va_arg(ap, unsigned int); 1358 1359 /* 1360 * Not sure what this is exactly. I think its the temporal 1358 1359 /* 1360 * Not sure what this is exactly. I think its the temporal 1361 1361 * relation factor (ie, how to make the rest of the numbers 1362 * make sense in the real world). 1362 * make sense in the real world). 1363 1363 */ 1364 1364 windowsize = va_arg(ap, fu32_t); 1365 1365 1366 1366 /* Explained below */ 1367 1367 clear = va_arg(ap, fu32_t); … … 1371 1371 currentavg = va_arg(ap, fu32_t); 1372 1372 maxavg = va_arg(ap, fu32_t); 1373 1374 va_end(ap); 1375 1373 1374 va_end(ap); 1375 1376 1376 owl_function_debugmsg("faimtest_parse_ratechange: rate %s (rate class 0x%04x): curavg = %u, maxavg = %u, alert at %u, clear warning at %u, limit at %u, disconnect at %u (window size = %u)", 1377 1377 (code < 5)?codes[code]:"invalid", … … 1389 1389 fu16_t newevil; 1390 1390 aim_userinfo_t *userinfo; 1391 1391 1392 1392 va_start(ap, fr); 1393 1393 newevil = (fu16_t)va_arg(ap, unsigned int); 1394 1394 userinfo = va_arg(ap, aim_userinfo_t *); 1395 1395 va_end(ap); 1396 1396 1397 1397 /* 1398 1398 * Evil Notifications that are lacking userinfo->sn are anon-warns … … 1404 1404 */ 1405 1405 owl_function_debugmsg("faimtest_parse_evilnotify: new value = %2.1f%% (caused by %s)\n", ((float)newevil)/10, (userinfo && strlen(userinfo->sn))?userinfo->sn:"anonymous"); 1406 1406 1407 1407 return 1; 1408 1408 } … … 1414 1414 int num, i; 1415 1415 GPtrArray *list; 1416 1416 1417 1417 va_start(ap, fr); 1418 1418 address = va_arg(ap, const char *); … … 1422 1422 1423 1423 list = g_ptr_array_new(); 1424 1424 1425 1425 owl_function_debugmsg("faimtest_parse_searchreply: E-Mail Search Results for %s: ", address); 1426 1426 for (i=0; i<num; i++) { … … 1437 1437 va_list ap; 1438 1438 const char *address; 1439 1439 1440 1440 va_start(ap, fr); 1441 1441 address = va_arg(ap, const char *); … … 1444 1444 owl_function_error("No results searching for %s", address); 1445 1445 owl_function_debugmsg("faimtest_parse_searcherror: E-Mail Search Results for %s: No Results or Invalid Email\n", address); 1446 1446 1447 1447 return(1); 1448 1448 } … … 1453 1453 const char *msg, *url; 1454 1454 fu16_t width, height, delay; 1455 1455 1456 1456 va_start(ap, fr); 1457 1457 msg = va_arg(ap, const char *); … … 1461 1461 delay = va_arg(ap, unsigned int); 1462 1462 va_end(ap); 1463 1463 1464 1464 owl_function_debugmsg("handlepopup: (%dx%x:%d) %s (%s)\n", width, height, delay, msg, url); 1465 1465 1466 1466 return 1; 1467 1467 } … … 1479 1479 const char *bosip; 1480 1480 fu8_t *cookie; 1481 1481 1482 1482 va_start(ap, fr); 1483 1483 bosip = va_arg(ap, const char *); 1484 1484 cookie = va_arg(ap, fu8_t *); 1485 1485 va_end(ap); 1486 1486 1487 1487 owl_function_debugmsg("migrate: migration in progress -- new BOS is %s -- disconnecting", bosip); 1488 1488 aim_conn_kill(sess, &fr->conn); 1489 1489 1490 1490 if (!(bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, bosip))) { 1491 1491 owl_function_debugmsg("migrate: could not connect to BOS: internal error"); 1492 1492 return 1; 1493 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) { 1493 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) { 1494 1494 owl_function_debugmsg("migrate: could not connect to BOS"); 1495 1495 aim_conn_kill(sess, &bosconn); 1496 1496 return 1; 1497 1497 } 1498 1498 1499 1499 /* Login will happen all over again. */ 1500 1500 addcb_bos(sess, bosconn); … … 1508 1508 /* aim_ssi_reqdata(sess, fr->conn, 0, 0x0000); */ 1509 1509 aim_ssi_reqdata(sess); 1510 1510 1511 1511 return(1); 1512 1512 } … … 1523 1523 struct aim_ssi_item *l; 1524 1524 */ 1525 1525 1526 1526 va_start(ap, fr); 1527 1527 fmtver = va_arg(ap, unsigned int); … … 1530 1530 list = va_arg(ap, struct aim_ssi_item *); 1531 1531 va_end(ap); 1532 1532 1533 1533 owl_function_debugmsg("ssiddata: got SSI data (0x%02x, %d items, %u)", fmtver, itemcount, stamp); 1534 1534 /* … … 1540 1540 */ 1541 1541 aim_ssi_enable(sess); 1542 1542 1543 1543 return 1; 1544 1544 } … … 1556 1556 va_list ap; 1557 1557 struct aim_icq_offlinemsg *msg; 1558 1558 1559 1559 va_start(ap, fr); 1560 1560 msg = va_arg(ap, struct aim_icq_offlinemsg *); 1561 1561 va_end(ap); 1562 1562 1563 1563 if (msg->type == 0x0001) { 1564 1564 owl_function_debugmsg("offlinemsg: from %u at %d/%d/%d %02d:%02d : %s", msg->sender, msg->year, msg->month, msg->day, msg->hour, msg->minute, msg->msg); … … 1586 1586 int count; 1587 1587 /* int i; */ 1588 1588 1589 1589 va_start(ap, fr); 1590 1590 count = va_arg(ap, int); … … 1608 1608 /* int i; */ 1609 1609 1610 1610 1611 1611 va_start(ap, fr); 1612 1612 count = va_arg(ap, int); 1613 1613 userinfo = va_arg(ap, aim_userinfo_t *); 1614 1614 va_end(ap); 1615 1615 1616 1616 /* 1617 1617 printf("chat: %s: Some occupants have left:\n", aim_chat_getname(fr->conn)); 1618 1618 1619 1619 for (i = 0; i < count; i++) 1620 1620 printf("chat: %s: \t%s\n", aim_chat_getname(fr->conn), userinfo[i].sn); … … 1635 1635 const char *croomname; 1636 1636 /* int i; */ 1637 1637 1638 1638 croomname = aim_chat_getname(fr->conn); 1639 1639 1640 1640 va_start(ap, fr); 1641 1641 roominfo = va_arg(ap, struct aim_chat_roominfo *); … … 1662 1662 for (i = 0; i < usercount; i++) 1663 1663 printf("chat: %s: \t\t%s\n", croomname, userinfo[i].sn); 1664 1665 owl_function_debugmsg("chat: %s: \tRoom flags: 0x%04x (%s%s%s%s)\n", 1664 1665 owl_function_debugmsg("chat: %s: \tRoom flags: 0x%04x (%s%s%s%s)\n", 1666 1666 croomname, flags, 1667 1667 (flags & AIM_CHATROOM_FLAG_EVILABLE) ? "Evilable, " : "", … … 1675 1675 printf("chat: %s: \tMax visible message length: %d bytes\n", croomname, maxvisiblemsglen); 1676 1676 */ 1677 1677 1678 1678 return(1); 1679 1679 } … … 1685 1685 const char *msg; 1686 1686 char tmpbuf[1152]; 1687 1688 va_start(ap, fr); 1689 userinfo = va_arg(ap, aim_userinfo_t *); 1687 1688 va_start(ap, fr); 1689 userinfo = va_arg(ap, aim_userinfo_t *); 1690 1690 msg = va_arg(ap, const char *); 1691 1691 va_end(ap); … … 1696 1696 printf("chat: %s: incoming msg from %s: %s\n", aim_chat_getname(fr->conn), userinfo->sn, msg); 1697 1697 */ 1698 1698 1699 1699 /* 1700 1700 * Do an echo for testing purposes. But not for ourselves ("oops!") … … 1704 1704 aim_chat_send_im(sess, fr->conn, 0, tmpbuf, strlen(tmpbuf)); 1705 1705 } 1706 1706 1707 1707 return 1; 1708 1708 } … … 1717 1717 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0); 1718 1718 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0); 1719 1719 1720 1720 aim_clientready(sess, fr->conn); 1721 1721 1722 1722 owl_function_debugmsg("Chat ready"); 1723 1723 … … 1735 1735 1736 1736 owl_function_debugmsg("in faimtest_chatnav_redirect"); 1737 1737 1738 1738 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, redir->ip); 1739 1739 if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) { … … 1743 1743 return; 1744 1744 } 1745 1745 1746 1746 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0); 1747 1747 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chat, 0); … … 1757 1757 1758 1758 owl_function_debugmsg("in chat_redirect"); 1759 1759 1760 1760 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, redir->ip); 1761 1761 if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) { 1762 1762 /* printf("unable to connect to chat server\n"); */ 1763 1763 if (tstconn) aim_conn_kill(sess, &tstconn); 1764 return; 1765 } 1764 return; 1765 } 1766 1766 /* printf("chat: connected to %s instance %d on exchange %d\n", redir->chat.room, redir->chat.instance, redir->chat.exchange); */ 1767 1767 1768 1768 /* 1769 1769 * We must do this to attach the stored name to the connection! … … 1773 1773 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chat, 0); 1774 1774 aim_sendcookie(sess, tstconn, redir->cookielen, redir->cookie); 1775 return; 1775 return; 1776 1776 } 1777 1777 -
buddylist.c
r3cdd6d2 r7869e48 12 12 owl_buddy *b; 13 13 b=g_new(owl_buddy, 1); 14 14 15 15 owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname); 16 16 g_ptr_array_add(bl->buddies, b); -
cmd.c
rf271129 r7869e48 79 79 owl_function_makemsg("Unbalanced quotes"); 80 80 return NULL; 81 } 82 81 } 82 83 83 if (argc < 1) { 84 84 g_strfreev(argv); … … 144 144 } 145 145 146 int owl_cmd_is_context_valid(const owl_cmd *cmd, const owl_context *ctx) { 146 int owl_cmd_is_context_valid(const owl_cmd *cmd, const owl_context *ctx) { 147 147 if (owl_context_matches(ctx, cmd->validctx)) return 1; 148 148 else return 0; … … 168 168 rv = owl_function_command(newcmd); 169 169 g_free(newcmd); 170 } 170 } 171 171 alias_recurse_depth--; 172 172 return rv; … … 201 201 if (cmd->cmd_args_fn) { 202 202 return cmd->cmd_args_fn(argc, argv, cmdbuff); 203 } else if (cmd->cmd_v_fn) { 203 } else if (cmd->cmd_v_fn) { 204 204 cmd->cmd_v_fn(); 205 205 } else if (cmd->cmd_i_fn) { … … 207 207 } else if (cmd->cmd_ctxargs_fn) { 208 208 return cmd->cmd_ctxargs_fn(owl_context_get_data(ctx), argc, argv, cmdbuff); 209 } else if (cmd->cmd_ctxv_fn) { 209 } else if (cmd->cmd_ctxv_fn) { 210 210 cmd->cmd_ctxv_fn(owl_context_get_data(ctx)); 211 211 } else if (cmd->cmd_ctxi_fn) { … … 277 277 } 278 278 279 owl_fmtext_append_normal(fm, "\n\n"); 280 } 279 owl_fmtext_append_normal(fm, "\n\n"); 280 } -
codelist.pl
r06adc25 r7869e48 29 29 print; 30 30 } 31 31 32 32 } 33 33 close(FILE); -
commands.c
r39a531d r7869e48 69 69 "", 70 70 ""), 71 71 72 72 OWLCMD_ARGS("start-command", owl_command_start_command, OWL_CTX_INTERACTIVE, 73 73 "prompts the user to enter a command", … … 125 125 "send an AIM message", 126 126 "aimwrite <user> [-m <message...>]", 127 "Send an aim message to a user.\n\n" 127 "Send an aim message to a user.\n\n" 128 128 "The following options are available:\n\n" 129 129 "-m Specifies a message to send without prompting.\n"), … … 139 139 "Behaves like zwrite but uses encryption. Not for use with\n" 140 140 "personal messages\n"), 141 141 142 142 OWLCMD_ARGS("reply", owl_command_reply, OWL_CTX_INTERACTIVE, 143 143 "reply to the current message", … … 217 217 OWLCMD_VOID("unsuball", owl_command_unsuball, OWL_CTX_ANY, 218 218 "unsubscribe from all zephyrs", "", ""), 219 219 220 220 OWLCMD_VOID("getsubs", owl_command_getsubs, OWL_CTX_ANY, 221 221 "print all current subscriptions", … … 299 299 "display detailed information about the current message", 300 300 "", ""), 301 301 302 302 OWLCMD_ARGS("help", owl_command_help, OWL_CTX_INTERACTIVE, 303 303 "display help on using BarnOwl", … … 330 330 "scrolls receive window to specified position", "", ""), 331 331 332 OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 332 OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 333 333 OWL_CTX_INTERACTIVE, 334 334 "scrolls down by a page", "", ""), … … 346 346 347 347 OWLCMD_INT ("recv:scroll", owl_function_page_curmsg, OWL_CTX_INTERACTIVE, 348 "scrolls current message up or down", 349 "recv:scroll <numlines>", 348 "scrolls current message up or down", 349 "recv:scroll <numlines>", 350 350 "Scrolls the current message up or down by <numlines>.\n" 351 351 "Scrolls up if <numlines> is negative, else scrolls down.\n"), … … 396 396 397 397 OWLCMD_VOID("last", owl_command_last, OWL_CTX_INTERACTIVE, 398 "move the pointer to the last message", "", 398 "move the pointer to the last message", "", 399 399 "Moves the pointer to the last message in the view.\n" 400 400 "If we are already at the last message in the view,\n" … … 509 509 OWLCMD_VOID("status", owl_command_status, OWL_CTX_ANY, 510 510 "print status information about the running BarnOwl", "", ""), 511 511 512 512 OWLCMD_ARGS("zlocate", owl_command_zlocate, OWL_CTX_INTERACTIVE, 513 513 "locate a user", 514 "zlocate [-d] <user> ...", 514 "zlocate [-d] <user> ...", 515 515 "Performs a zlocate on one ore more users and puts the result\n" 516 516 "int a popwin. If -d is specified, does not authenticate\n" 517 517 "the lookup request.\n"), 518 518 519 519 OWLCMD_ARGS("filter", owl_command_filter, OWL_CTX_ANY, 520 520 "create a message filter", … … 674 674 "Show errors will show a list of errors encountered by BarnOwl.\n\n" 675 675 "SEE ALSO: filter, view, alias, bindkey, help\n"), 676 676 677 677 OWLCMD_ARGS("delete", owl_command_delete, OWL_CTX_INTERACTIVE, 678 678 "mark a message for deletion", … … 799 799 /****************************************************************/ 800 800 801 OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 801 OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 802 802 OWL_CTX_EDIT, 803 803 "moves cursor forward a word", 804 804 "", ""), 805 805 806 OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 806 OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 807 807 OWL_CTX_EDIT, 808 808 "moves cursor backwards a word", … … 814 814 "", ""), 815 815 816 OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 816 OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 817 817 OWL_CTX_EDIT, 818 818 "moves cursor to the bottom right (end) of the buffer", 819 819 "", ""), 820 820 821 OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 821 OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 822 822 OWL_CTX_EDIT, 823 823 "moves cursor to the end of the line", 824 824 "", ""), 825 825 826 OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 826 OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 827 827 OWL_CTX_EDIT, 828 828 "moves cursor to the beginning of the line", 829 829 "", ""), 830 830 831 OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 831 OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 832 832 OWL_CTX_EDIT, 833 833 "moves the cursor left by a character", … … 854 854 "", ""), 855 855 856 OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 856 OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 857 857 OWL_CTX_EDIT, 858 858 "deletes the character to the right of the cursor", … … 864 864 "", ""), 865 865 866 OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 866 OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 867 867 OWL_CTX_EDIT, 868 868 "deletes all of the contents of the buffer", … … 874 874 "", ""), 875 875 876 OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 876 OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 877 877 OWL_CTX_EDIT, 878 878 "fills the current paragraph to line-wrap well", 879 879 "", ""), 880 880 881 OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 881 OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 882 882 OWL_CTX_EDIT, 883 883 "recenters the buffer", 884 884 "", ""), 885 885 886 OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 886 OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 887 887 OWL_CTX_EDIT, 888 888 "inserts text into the buffer", 889 889 "edit:insert-text <text>", ""), 890 890 891 OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 891 OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 892 892 OWL_CTX_EDIT, 893 893 "cancels the current command", 894 894 "", ""), 895 895 896 OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 896 OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 897 897 OWL_CTX_EDIT, 898 898 "replaces the text with the next history", 899 899 "", ""), 900 900 901 OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 901 OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 902 902 OWL_CTX_EDIT, 903 903 "replaces the text with the previous history", … … 932 932 OWLCMD_ALIAS ("editresponse:done", "edit:done"), 933 933 934 OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 934 OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 935 935 OWL_CTX_EDITMULTI, 936 936 "moves the cursor up one line", 937 937 "", ""), 938 938 939 OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 939 OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 940 940 OWL_CTX_EDITMULTI, 941 941 "moves the cursor down one line", 942 942 "", ""), 943 943 944 OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 944 OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 945 945 OWL_CTX_EDIT, 946 946 "Finishes entering text in the editwin.", 947 947 "", ""), 948 948 949 OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 949 OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 950 950 OWL_CTX_EDITMULTI, 951 951 "completes the command, but only if at end of message", 952 "", 952 "", 953 953 "If only whitespace is to the right of the cursor,\n" 954 954 "runs 'edit:done'.\n"\ … … 971 971 /****************************************************************/ 972 972 973 OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 973 OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 974 974 OWL_CTX_POPLESS, 975 975 "scrolls down one page", 976 976 "", ""), 977 977 978 OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 978 OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 979 979 OWL_CTX_POPLESS, 980 980 "scrolls down one line", 981 981 "", ""), 982 982 983 OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 983 OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 984 984 OWL_CTX_POPLESS, 985 985 "scrolls up one page", 986 986 "", ""), 987 987 988 OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 988 OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 989 989 OWL_CTX_POPLESS, 990 990 "scrolls up one line", 991 991 "", ""), 992 992 993 OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 993 OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 994 994 OWL_CTX_POPLESS, 995 995 "scrolls to the top of the buffer", 996 996 "", ""), 997 997 998 OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 998 OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 999 999 OWL_CTX_POPLESS, 1000 1000 "scrolls to the bottom of the buffer", 1001 1001 "", ""), 1002 1002 1003 OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 1003 OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 1004 1004 OWL_CTX_POPLESS, 1005 1005 "scrolls right in the buffer", 1006 1006 "popless:scroll-right <num-chars>", ""), 1007 1007 1008 OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 1008 OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 1009 1009 OWL_CTX_POPLESS, 1010 1010 "scrolls left in the buffer", 1011 1011 "popless:scroll-left <num-chars>", ""), 1012 1012 1013 OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 1013 OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 1014 1014 OWL_CTX_POPLESS, 1015 1015 "exits the popless window", … … 1066 1066 return NULL; 1067 1067 } 1068 1068 1069 1069 owl_function_help_for_command(argv[1]); 1070 1070 return NULL; … … 1252 1252 { 1253 1253 char *filename; 1254 1254 1255 1255 if (argc!=2) { 1256 1256 owl_function_makemsg("usage: dump <filename>"); … … 1281 1281 if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) { 1282 1282 skip_deleted=1; 1283 argc-=1; argv+=1; 1283 argc-=1; argv+=1; 1284 1284 } else if (argc>=1 && !strcmp(argv[1], "--last-if-none")) { 1285 1285 last_if_none=1; 1286 argc-=1; argv+=1; 1286 argc-=1; argv+=1; 1287 1287 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1288 1288 filter = g_strdup(argv[2]); 1289 argc-=2; argv+=2; 1289 argc-=2; argv+=2; 1290 1290 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 1291 1291 filter = owl_function_smartfilter(0, 0); 1292 argc-=2; argv+=2; 1292 argc-=2; argv+=2; 1293 1293 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 1294 1294 filter = owl_function_smartfilter(1, 0); 1295 argc-=2; argv+=2; 1295 argc-=2; argv+=2; 1296 1296 } else { 1297 1297 owl_function_makemsg("Invalid arguments to command 'next'."); … … 1311 1311 if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) { 1312 1312 skip_deleted=1; 1313 argc-=1; argv+=1; 1313 argc-=1; argv+=1; 1314 1314 } else if (argc>=1 && !strcmp(argv[1], "--first-if-none")) { 1315 1315 first_if_none=1; 1316 argc-=1; argv+=1; 1316 argc-=1; argv+=1; 1317 1317 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1318 1318 filter = g_strdup(argv[2]); 1319 argc-=2; argv+=2; 1319 argc-=2; argv+=2; 1320 1320 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 1321 1321 filter = owl_function_smartfilter(0, 0); 1322 argc-=2; argv+=2; 1322 argc-=2; argv+=2; 1323 1323 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 1324 1324 filter = owl_function_smartfilter(1, 0); 1325 argc-=2; argv+=2; 1325 argc-=2; argv+=2; 1326 1326 } else { 1327 1327 owl_function_makemsg("Invalid arguments to command 'prev'."); … … 1387 1387 filtname = owl_function_smartfilter(1, 0); 1388 1388 } else { 1389 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 1389 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 1390 1390 } 1391 1391 return filtname; … … 1582 1582 owl_function_printallvars(); 1583 1583 return NULL; 1584 } 1584 } 1585 1585 1586 1586 if (argc > 1 && !strcmp("-q",argv[1])) { … … 1656 1656 1657 1657 var=argv[1]; 1658 1658 1659 1659 v = owl_variable_get_var(owl_global_get_vardict(&g), var); 1660 1660 if (v) { … … 1708 1708 int i; 1709 1709 if (argc < 2) { 1710 owl_function_makemsg("Invalid arguments to 'multi' command."); 1710 owl_function_makemsg("Invalid arguments to 'multi' command."); 1711 1711 return NULL; 1712 1712 } … … 1718 1718 break; 1719 1719 } else if (newbuff[i] != ' ') { 1720 owl_function_makemsg("Invalid arguments to 'multi' command."); 1720 owl_function_makemsg("Invalid arguments to 'multi' command."); 1721 1721 g_free(newbuff); 1722 1722 return NULL; … … 2012 2012 const char *const *myargv; 2013 2013 int myargc; 2014 2014 2015 2015 if (!owl_global_is_aimloggedin(&g)) { 2016 2016 owl_function_error("You are not logged in to AIM."); … … 2064 2064 { 2065 2065 int edit=0; 2066 2066 2067 2067 if (argc>=2 && !strcmp("-e", argv[1])) { 2068 2068 edit=1; … … 2071 2071 } 2072 2072 2073 if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) { 2073 if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) { 2074 2074 owl_function_reply(0, !edit); 2075 2075 } else if (argc==2 && !strcmp(argv[1], "sender")) { … … 2078 2078 const owl_message *m; 2079 2079 const owl_view *v; 2080 v = owl_global_get_current_view(&g); 2080 v = owl_global_get_current_view(&g); 2081 2081 m = owl_view_get_element(v, owl_global_get_curmsg(&g)); 2082 2082 if (m) owl_zephyr_zaway(m); … … 2096 2096 { 2097 2097 int auth; 2098 2098 2099 2099 if (argc<2) { 2100 2100 owl_function_makemsg("Too few arguments for zlocate command"); … … 2212 2212 return(NULL); 2213 2213 } 2214 2214 2215 2215 } 2216 2216 return(NULL); … … 2230 2230 owl_function_show_filter(argv[2]); 2231 2231 } 2232 } else if (argc==2 2232 } else if (argc==2 2233 2233 && (!strcmp(argv[1], "zpunts") || !strcmp(argv[1], "zpunted"))) { 2234 2234 owl_function_show_zpunts(); … … 2275 2275 } else if (!strcmp(argv[1], "startup")) { 2276 2276 const char *filename; 2277 2277 2278 2278 filename=owl_global_get_startupfile(&g); 2279 2279 owl_function_popless_file(filename); … … 2332 2332 if (argc>1 && !strcmp(argv[1], "--no-move")) { 2333 2333 move_after = 0; 2334 argc--; 2334 argc--; 2335 2335 argv++; 2336 2336 } … … 2393 2393 if (argc>1 && !strcmp(argv[1], "--no-move")) { 2394 2394 move_after = 0; 2395 argc--; 2395 argc--; 2396 2396 argv++; 2397 2397 } … … 2434 2434 { 2435 2435 char *filtname; 2436 2436 2437 2437 if (argc < 3 || argc > 4) { 2438 2438 owl_function_makemsg("Wrong number of arguments to colorclass command"); … … 2504 2504 owl_function_smartzpunt(1); 2505 2505 } else { 2506 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 2506 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 2507 2507 } 2508 2508 return NULL; … … 2598 2598 buffstart=skiptokens(buff, 2); 2599 2599 } 2600 2600 2601 2601 if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) { 2602 2602 /* When continuing a search, don't consider the current message. */ … … 2606 2606 owl_function_search_helper(true, direction); 2607 2607 } 2608 2608 2609 2609 return(NULL); 2610 2610 } … … 2616 2616 buffstart=skiptokens(buff, 1); 2617 2617 owl_function_set_search(*buffstart ? buffstart : NULL); 2618 2618 2619 2619 return(NULL); 2620 2620 } -
context.c
rf271129 r7869e48 24 24 if ((((ctx->mode&OWL_CTX_MODE_BITS) & test) 25 25 || !(test&OWL_CTX_MODE_BITS)) 26 && 27 (((ctx->mode&OWL_CTX_ACTIVE_BITS) & test) 26 && 27 (((ctx->mode&OWL_CTX_ACTIVE_BITS) & test) 28 28 || !(test&OWL_CTX_ACTIVE_BITS))) { 29 29 return 1; -
dict.c
rf271129 r7869e48 1 /* Dictionary data abstraction. 1 /* Dictionary data abstraction. 2 2 * Maps from strings to pointers. 3 3 * Stores as a sorted list of key/value pairs. … … 68 68 } 69 69 70 /* Returns 0 on success. Will copy the key but make 71 a reference to the value. Will clobber an existing 70 /* Returns 0 on success. Will copy the key but make 71 a reference to the value. Will clobber an existing 72 72 entry with the same key iff delete_on_replace!=NULL, 73 73 and will run delete_on_replace on the old element. … … 93 93 if (pos!=d->size) { 94 94 /* shift forward to leave us a slot */ 95 memmove(d->els+pos+1, d->els+pos, 95 memmove(d->els+pos+1, d->els+pos, 96 96 sizeof(owl_dict_el)*(d->size-pos)); 97 97 } 98 98 d->size++; 99 99 d->els[pos].k = g_strdup(k); 100 d->els[pos].v = v; 100 d->els[pos].v = v; 101 101 return(0); 102 102 } -
doc/advanced.txt
rc82b055 r7869e48 44 44 type message type ('zephyr', 'aim', 'admin') 45 45 direction either 'in' 'out' or 'none'\n" 46 login either 'login' 'logout' or 'none'\n" 46 login either 'login' 'logout' or 'none'\n" 47 47 48 48 You can also use the operators 'and' 'or' and 'not' as well as the … … 64 64 *** WARNING: This interface is still evolving and may change over time *** 65 65 66 The ~/.owlconf file is interpreted by the perl interpreter. 66 The ~/.owlconf file is interpreted by the perl interpreter. 67 67 You may specify an alternate file by running owl with "owl -c <configfile>". 68 68 … … 76 76 owl::format_msg() run to format messages when using the perl style. 77 77 The return value is used to display the message on the 78 screen. 78 screen. 79 79 owl::receive_msg() run when a message is received, and after 80 80 it has been added to the message list … … 87 87 owl::command('set zsigproc "/mit/kretch/bin/getzsig foo"'); 88 88 89 will set the owl variable zsigproc to 89 will set the owl variable zsigproc to 90 90 the value "/mit/kretch/bin/getzsig foo". 91 91 Note that you will need to watch out for perl quoting issues. … … 93 93 94 94 Both owl::format_msg and owl::receive_msg are passed perl owl::Message 95 objects which have methods for accessing the attributes of the message. 95 objects which have methods for accessing the attributes of the message. 96 96 97 97 (Caveat: Note that these owl::Message objects are currently only … … 154 154 } 155 155 156 In the above, $m is the owl::Message object and 156 In the above, $m is the owl::Message object and 157 157 its methods are called with $m->METHODNAME. 158 158 159 An example receiver function that tags all zephyr pings for 159 An example receiver function that tags all zephyr pings for 160 160 deletion would be: 161 161 … … 187 187 If you use pperl instead of perl, the return value 188 188 of the perl command will be displayed in a pop-up window. 189 This is particularly useful within key bindings 189 This is particularly useful within key bindings 190 190 and aliases. For example: 191 191 … … 193 193 194 194 Will cause the "finger" command to be used to finger at the host 195 where the current message came from. You can then bind this 195 where the current message came from. You can then bind this 196 196 to the "f" key with: 197 197 -
doc/barnowl.1
r8135737 r7869e48 36 36 \fB\-c\fP, \fB\-\-config\-file\fP=\fIFILE\fP 37 37 Specify an alternate config file for \fBBarnOwl\fP to use. The config file is 38 an arbitrary Perl script evaluated in the \fImain\fP package, and if it 39 overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP 40 starts. (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands 38 an arbitrary Perl script evaluated in the \fImain\fP package, and if it 39 overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP 40 starts. (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands 41 41 that are run at startup after the config file is loaded.) 42 42 43 By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP, 43 By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP, 44 44 \fI~/.barnowlconf\fP, or \fI~/.owlconf\fP that exists. 45 45 -
doc/code.txt
rd40ad8b r7869e48 16 16 is owl_function_command("foo"); 17 17 Commands are only active within specific contexts, 18 and attempts to call them from invalid contexts will fail. 18 and attempts to call them from invalid contexts will fail. 19 19 20 context: A context specifies the current state of owl, in terms 20 context: A context specifies the current state of owl, in terms 21 21 of which modal window is active and which point 22 22 in its life owl is in (eg, in startup, or running). 23 This is implemented as a bitmask and there is 23 This is implemented as a bitmask and there is 24 24 some hierarchy. Commands may restrict themselves 25 25 to only running in a limited number of contexts … … 34 34 Sometimes also referred to as typewin. 35 35 36 filter: Patterns which match messages. These may 37 contain multiple filterelements which may be 36 filter: Patterns which match messages. These may 37 contain multiple filterelements which may be 38 38 combined together (eg, by "and" and "or"). 39 40 filterelement: An element of a filter which matches on some 39 40 filterelement: An element of a filter which matches on some 41 41 attribute of a message. 42 42 … … 44 44 These are particularly useful for building up 45 45 text regions that are to be rendered on-screen, 46 as they resize memory as needed, and they have 46 as they resize memory as needed, and they have 47 47 routines for cropping as needed. 48 48 … … 55 55 owl.h defines "g" as a singleton instance of owl_global. 56 56 Where possible/appropriate, most accesses to global data should 57 be from a limited number of files (eg, from owl.c and 57 be from a limited number of files (eg, from owl.c and 58 58 functions.c). Consider whether you really need to before 59 59 adding in uses of global. … … 103 103 Also contains the main loop, which is roughly: 104 104 - handle scheduled resizes, and anything that might result 105 - while zephyrs are pending, grab incoming zephyrs 105 - while zephyrs are pending, grab incoming zephyrs 106 106 and handle them (which includes formatting them 107 107 with either perl extension or default formatter … … 109 109 - updates mainwin display if there are new zephyrs 110 110 - displays and updates popwins and the terminal as necessary 111 - sends characters to the popwin, recwin/mainwin, 111 - sends characters to the popwin, recwin/mainwin, 112 112 or typewin/editwin 113 113 … … 118 118 Created by codelist.pl. 119 119 120 popwin: Modal pop-up window container. 120 popwin: Modal pop-up window container. 121 121 Usually contains a viewwin for read-only scrolling text. 122 122 … … 126 126 127 127 util: Misc utility functions that don't fit anywhere yet: 128 - sepbar rendering 128 - sepbar rendering 129 129 - tokenizing and parsing utilities 130 130 - downstr … … 186 186 something, and this should be the exception to the rule. 187 187 188 Owl should be generally useful out-of-the-box without 189 extensive configuration, for most people's needs. 188 Owl should be generally useful out-of-the-box without 189 extensive configuration, for most people's needs. 190 190 People shouldn't have to spend days tweaking 191 191 with config files before being happy switching to it. -
doc/intro.txt
rd7cc50b r7869e48 188 188 variable. For example: 189 189 190 set personalbell on 190 set personalbell on 191 191 192 192 will set the value of the variable 'personalbell' to 'on'. The … … 347 347 owl::format_msg() run to format messages when using the perl style. 348 348 The return value is used to display the message on the 349 screen. 349 screen. 350 350 owl::receive_msg() run when a message is received, and after 351 351 it has been added to the message list … … 424 424 For example: 425 425 426 bindkey recv C-k command delete 427 428 will bind Control-k to the delete command, but only in the 426 bindkey recv C-k command delete 427 428 will bind Control-k to the delete command, but only in the 429 429 recv window context. 430 430 431 Some keymaps inherit their bindings from more 431 Some keymaps inherit their bindings from more 432 432 general keymaps. The valid keymaps are: 433 433 … … 438 438 | |-editresponse - single-line responses to questions 439 439 |-popless - scrolling pop-up windows 440 |-recv - the main message list window 440 |-recv - the main message list window 441 441 where received messages are displayed 442 442 … … 445 445 Note that not all commands may be used in all contexts. 446 446 447 Key sequences may be surrounded by quotes and include 447 Key sequences may be surrounded by quotes and include 448 448 a sequence of keys that must be pressed in order 449 449 to execute the command. For example: -
editwin.c
r7803326 r7869e48 1286 1286 const char *p; 1287 1287 int width = offset; 1288 1288 1289 1289 for(p = e->buff + start; 1290 1290 p < e->buff + end; … … 1390 1390 { 1391 1391 char *p; 1392 1392 1393 1393 p = g_new(char, end - start + 1); 1394 1394 memcpy(p, e->buff + start, end - start); … … 1418 1418 if (e->win) owl_window_dirty(e->win); 1419 1419 } 1420 1421 1420 1422 1421 -
examples/owlconf.erik
rd7cc50b r7869e48 1 ### The owlconf config file -*- perl -*- 1 ### The owlconf config file -*- perl -*- 2 2 ### 3 3 ### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! 4 ### This is an example file intended to demonstrate how to use 4 ### This is an example file intended to demonstrate how to use 5 5 ### various features of owl. Some of the key bindings, in particular, 6 6 ### are more for examples than things you may actually want to use. … … 30 30 ### The message attributes may be dereferenced with $m->attribute 31 31 ### 32 ### 32 ### 33 33 34 34 # tokens for sepbar are: … … 122 122 } 123 123 124 # Load in things which don't belong in an owlconf 124 # Load in things which don't belong in an owlconf 125 125 # that people might use as an example... 126 126 sub personal_startup { … … 231 231 sepbartokens_add("<$sender"); 232 232 sepbartokens_trim(">$sender"); 233 } 233 } 234 234 } elsif ($m->is_mail) { 235 235 mail_add_message($m); … … 249 249 my ($b) = @_; 250 250 $b=~s/^/ /g; 251 $b=~s/\n/\n /g; 251 $b=~s/\n/\n /g; 252 252 return $b; 253 253 } … … 282 282 } 283 283 284 if (!$m->is_zephyr && !$m->is_aim) { 284 if (!$m->is_zephyr && !$m->is_aim) { 285 285 return "Unknown message type: ".$m->type."\n"; 286 286 } … … 308 308 309 309 if ($m->is_zephyr) { 310 $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class), 310 $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class), 311 311 lc($m->instance), $m->time, lc($m->host); 312 312 if ($m->opcode ne "") {$out.=" op:".$m->opcode;} … … 322 322 } 323 323 } 324 $out.="\n"; 324 $out.="\n"; 325 325 } else { 326 326 $out = sprintf "[%s] / %s\n", lc($m->type), $m->time; 327 327 $out.= " \@bold($sender)> "; 328 $out.="\n"; 328 $out.="\n"; 329 329 } 330 330 … … 380 380 } 381 381 382 if (!$m->is_zephyr && !$m->is_aim) { 382 if (!$m->is_zephyr && !$m->is_aim) { 383 383 return "Unknown message type: ".$m->type."\n"; 384 384 } … … 402 402 } 403 403 return "$out\n"; 404 404 405 405 } elsif ($m->is_zephyr && $m->is_mail) { 406 406 my $body = $m->body; … … 414 414 my $channel = ""; 415 415 my $body = $m->body; 416 416 417 417 if ($m->is_zephyr) { 418 418 my $inst = $m->instance; … … 459 459 } 460 460 for my $w (@words) { 461 if (($outline ne "") 461 if (($outline ne "") 462 462 && (length($outline)+length($w) > $width-$unindent)) { 463 463 $out .= $outline."\n"; … … 472 472 $outline .= $w; 473 473 } 474 $out .= $outline . "\n"; 475 } 474 $out .= $outline . "\n"; 475 } -
examples/owlconf.simple
rd7cc50b r7869e48 1 ### The owlconf config file -*- perl -*- 1 ### The owlconf config file -*- perl -*- 2 2 3 3 ### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! 4 ### This is an example file intended to demonstrate how to use 4 ### This is an example file intended to demonstrate how to use 5 5 ### various features of owl. Some of the key bindings, in particular, 6 6 ### are more for examples than things you may actually want to use. … … 36 36 ### $owl::sender, $owl::opcode, $owl::zsig, 37 37 ### $owl::msg, $owl::time, $owl::host, @owl::fields, $owl::id 38 ### 38 ### 39 39 40 40 # NOTE: Lines beginning with a "#" are perl comments. … … 49 49 ## Doing "help" will show you more about each variable. 50 50 ## These lines will set things to the default. 51 ## You can uncomment them and then change the value to get 51 ## You can uncomment them and then change the value to get 52 52 ## a different behavior (remove the "#" to an alternate value). 53 53 ################################################################ … … 60 60 61 61 ## Set this to on to enable logging of personal zephyrs 62 # owl::command('set -q logging off'); 62 # owl::command('set -q logging off'); 63 63 64 64 ## This directory must exist and is where personal zephyrs are logged. … … 67 67 68 68 ## Set this to on to enable logging of classes 69 # owl::command('set -q classlogging off'); 69 # owl::command('set -q classlogging off'); 70 70 71 71 ## This directory must exist and is where class zephyrs are logged. … … 105 105 ################################################################ 106 106 ## The following create filters. Filters can be used to select 107 ## on multiple zephyrs for operations. With 'views' you can 107 ## on multiple zephyrs for operations. With 'views' you can 108 108 ## look at only the zephyrs matching a particular filter. 109 109 ## Use the 'view <filtername>' command or the 'v' key to switch views. … … 114 114 ## The filter command creates a filter with the specified name, 115 115 ## or if one already exists it is replaced. Example filter 116 ## syntax would be: 116 ## syntax would be: 117 117 ## 118 118 ## filter myfilter -c red ( class ^foobar$ ) or ( class ^quux$ and instance ^bar$ ) … … 123 123 ## is used it specifies the color that messages matching this filter 124 124 ## should be displayed in. Do 'show colors' to see the available colors. 125 ## 125 ## 126 126 ################################################################ 127 127 … … 137 137 ## The 'trash' filter is used when you press 'T' to mark things 138 138 ## for autodeletion. 139 # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$'); 139 # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$'); 140 140 141 141 } … … 188 188 ## Note that: 189 189 ## $out .= "foo"; appends "foo" to the end of the variable $out. 190 ## lc(bar) will convert bar to lowercase. 190 ## lc(bar) will convert bar to lowercase. 191 191 ## "ne" does "not equal" for string comparison. 192 192 ## sprintf fills in the %s's with the arguments later on the line. … … 213 213 # Incoming messages 214 214 215 $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class), 215 $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class), 216 216 lc($owl::instance), $owl::time, lc($owl::host); 217 217 if ($owl::opcode ne "") {$out.=" op:$owl::opcode";} … … 228 228 } 229 229 } 230 $out.="\n"; 230 $out.="\n"; 231 231 232 232 # This indents the body of the message and then appends it on. … … 251 251 ## In most cases you won't need anything here. 252 252 sub owl::receive_msg() { 253 253 254 254 ## If this is uncommented, it would mark all messages 255 255 ## with opcode "PING" for immediate deletion: -
examples/owlconf.vtformat
rd7cc50b r7869e48 1 ### The owlconf config file -*- perl -*- 1 ### The owlconf config file -*- perl -*- 2 2 ### 3 3 ### This file is interpreted by the perl interpreter. … … 23 23 ### $owl::sender, $owl::opcode, $owl::zsig, 24 24 ### $owl::msg, $owl::time, $owl::host, @owl::fields 25 ### 25 ### 26 26 27 27 # classes will be appreviated this way … … 124 124 } 125 125 for my $w (@words) { 126 if (($outline ne "") 126 if (($outline ne "") 127 127 && (length($outline)+length($w) > $width-$unindent)) { 128 128 $out .= $outline."\n"; … … 137 137 $outline .= $w; 138 138 } 139 $out .= $outline . "\n"; 139 $out .= $outline . "\n"; 140 140 } -
filterelement.c
r7756dde r7869e48 75 75 */ 76 76 return 0; 77 } 77 } 78 78 return owl_filter_message_match(subfilter, m); 79 79 } -
fmtext.c
rf271129 r7869e48 26 26 { 27 27 int a = 0, fg = 0, bg = 0; 28 28 29 29 if (attr != OWL_FMTEXT_ATTR_NONE) a=1; 30 30 if (fgcolor != OWL_COLOR_DEFAULT) fg=1; … … 121 121 p = strchr(p+1, OWL_FMTEXT_UC_STARTBYTE_UTF8); 122 122 } 123 } 123 } 124 124 125 125 /* Internal function. Append text from 'in' between index 'start' … … 205 205 char attr; 206 206 short fg, bg, pair = 0; 207 207 208 208 if (w==NULL) { 209 209 owl_function_debugmsg("Hit a null window in owl_fmtext_curs_waddstr."); … … 226 226 /* Deal with all text from last insert to here. */ 227 227 char tmp; 228 228 229 229 tmp = p[0]; 230 230 p[0] = '\0'; … … 243 243 _owl_fmtext_wattrset(w, attr ^ OWL_FMTEXT_ATTR_REVERSE); 244 244 _owl_fmtext_wcolor_set(w, pair); 245 245 246 246 waddnstr(w, s + start, end - start); 247 247 … … 332 332 const char *ptr1, *ptr2; 333 333 int i, offset; 334 334 335 335 /* find the starting line */ 336 336 ptr1 = in->buff->str; … … 340 340 ptr1++; 341 341 } 342 342 343 343 /* ptr1 now holds the starting point */ 344 344 … … 375 375 break; 376 376 } 377 377 378 378 if (ptr_e == ptr_s) { 379 379 owl_fmtext_append_normal(out, "\n"); … … 392 392 chwidth = mk_wcwidth(c); 393 393 if (col + chwidth > bcol) break; 394 394 395 395 if (col >= acol) { 396 396 if (st == 0) { … … 596 596 continue; 597 597 } 598 598 599 599 /* if there's no opener, print the @ and continue */ 600 600 tmpptr=strpbrk(txtptr, "(<[{ "); … … 657 657 /* if it's a color read the color, set the current color and 658 658 continue */ 659 } else if (!strcasecmp(buff, "@color") 659 } else if (!strcasecmp(buff, "@color") 660 660 && owl_global_is_colorztext(&g)) { 661 661 g_free(buff); … … 756 756 757 757 /* requires that the list values are strings or NULL. 758 * joins the elements together with join_with. 758 * joins the elements together with join_with. 759 759 * If format_fn is specified, passes it the list element value 760 760 * and it will return a string which this needs to free. */ … … 837 837 if (fg > COLORS || fg < OWL_COLOR_DEFAULT) fg = OWL_COLOR_DEFAULT; 838 838 if (bg > COLORS || bg < OWL_COLOR_DEFAULT) bg = OWL_COLOR_DEFAULT; 839 839 840 840 #ifdef HAVE_USE_DEFAULT_COLORS 841 841 if (fg == OWL_COLOR_DEFAULT) fg = -1; -
functions.c
r06470d7 r7869e48 8 8 { 9 9 owl_function_debugmsg("executing command: %s", cmdbuff); 10 return owl_cmddict_execute(owl_global_get_cmddict(&g), 10 return owl_cmddict_execute(owl_global_get_cmddict(&g), 11 11 owl_global_get_context(&g), cmdbuff); 12 12 } … … 198 198 m=g_new(owl_message, 1); 199 199 owl_message_create_admin(m, header, body); 200 200 201 201 /* add it to the global list and current view */ 202 202 owl_messagelist_append_element(owl_global_get_msglist(&g), m); … … 250 250 /* error if we're not logged into aim */ 251 251 if (!owl_global_is_aimloggedin(&g)) return(NULL); 252 252 253 253 m=g_new(owl_message, 1); 254 254 owl_message_create_aim(m, … … 455 455 if (unwrap) 456 456 owl_text_wordunwrap(format_msg); 457 457 458 458 /* send the message */ 459 459 ret=owl_aim_send_im(to, format_msg); … … 485 485 format_msg=g_strdup(msg); 486 486 owl_text_wordunwrap(format_msg); 487 487 488 488 /* send the message */ 489 489 ret=owl_aim_send_awaymsg(to, format_msg); … … 534 534 535 535 /* If filter is non-null, looks for the next message matching 536 * that filter. If skip_deleted, skips any deleted messages. 536 * that filter. If skip_deleted, skips any deleted messages. 537 537 * If last_if_none, will stop at the last message in the view 538 538 * if no matching messages are found. */ … … 707 707 708 708 if (move_after) { 709 /* move the poiner in the appropriate direction 709 /* move the poiner in the appropriate direction 710 710 * to the next undeleted msg */ 711 711 if (owl_global_get_direction(&g)==OWL_DIRECTION_UPWARDS) { … … 723 723 724 724 v=owl_global_get_current_view(&g); 725 725 726 726 if (owl_view_get_size(v) < 1) { 727 727 owl_function_error("No current message to undelete"); … … 801 801 802 802 owl_function_redisplay_to_nearest(lastmsgid, v); 803 803 804 804 owl_function_makemsg("Messages expunged"); 805 805 } … … 820 820 v=owl_global_get_current_view(&g); 821 821 oldcurmsg=owl_global_get_curmsg(&g); 822 curmsg=owl_view_get_size(v)-1; 822 curmsg=owl_view_get_size(v)-1; 823 823 if (curmsg<0) curmsg=0; 824 824 owl_global_set_curmsg(&g, curmsg); … … 830 830 owl_global_set_topmsg(&g, curmsg+1); 831 831 owl_global_set_curmsg(&g, curmsg+1); 832 } 832 } 833 833 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 834 834 owl_global_set_direction_downwards(&g); … … 995 995 { 996 996 char *ret; 997 997 998 998 /* zlog out if we need to */ 999 999 if (owl_global_is_havezephyr(&g) && … … 1010 1010 kill(owl_global_get_newmsgproc_pid(&g), SIGHUP); 1011 1011 } 1012 1012 1013 1013 /* Quit AIM */ 1014 1014 if (owl_global_is_aimloggedin(&g)) { … … 1060 1060 } 1061 1061 1062 /* Returns what the new topmsg should be. 1063 * Passed the last direction of movement, 1062 /* Returns what the new topmsg should be. 1063 * Passed the last direction of movement, 1064 1064 * the current view, 1065 1065 * the current message number in the view, … … 1074 1074 int owl_function_calculate_topmsg_neartop(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) 1075 1075 { 1076 if (curmsg>0 1076 if (curmsg>0 1077 1077 && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1)) 1078 1078 < recwinlines/2)) { … … 1082 1082 } 1083 1083 } 1084 1084 1085 1085 int owl_function_calculate_topmsg_center(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) 1086 1086 { … … 1096 1096 return(last); 1097 1097 } 1098 1098 1099 1099 int owl_function_calculate_topmsg_paged(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page) 1100 1100 { 1101 1101 int i, last, lines, savey; 1102 1103 /* If we're off the top of the screen, scroll up such that the 1102 1103 /* If we're off the top of the screen, scroll up such that the 1104 1104 * curmsg is near the botton of the screen. */ 1105 1105 if (curmsg < topmsg) { … … 1142 1142 1143 1143 if (curmsg<0) return(topmsg); 1144 1144 1145 1145 /* If we're off the top of the screen then center */ 1146 1146 if (curmsg<topmsg) { … … 1167 1167 direction=OWL_DIRECTION_UPWARDS; 1168 1168 } 1169 1169 1170 1170 /* If our bottom line is less than 1/4 down the screen then scroll up */ 1171 1171 if (direction == OWL_DIRECTION_UPWARDS || direction == OWL_DIRECTION_NONE) { … … 1386 1386 1387 1387 owl_fmtext_init_null(&fm); 1388 1388 1389 1389 v=owl_global_get_current_view(&g); 1390 1390 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); … … 1422 1422 if (owl_message_is_type_zephyr(m)) { 1423 1423 owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n"); 1424 1424 1425 1425 owl_fmtext_appendf_normal(&fm, " Class : %s\n", owl_message_get_class(m)); 1426 1426 owl_fmtext_appendf_normal(&fm, " Instance : %s\n", owl_message_get_instance(m)); … … 1493 1493 owl_message_attributes_tofmtext(m, &attrfm); 1494 1494 owl_fmtext_append_fmtext(&fm, &attrfm); 1495 1495 1496 1496 owl_function_popless_fmtext(&fm); 1497 1497 owl_fmtext_cleanup(&fm); … … 1548 1548 return; 1549 1549 } 1550 1550 1551 1551 /* Bail if we're not truncated */ 1552 1552 if (!owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) { … … 1555 1555 } 1556 1556 } 1557 1558 1557 1558 1559 1559 /* don't scroll past the last line */ 1560 1560 if (step>0) { … … 1574 1574 } 1575 1575 } 1576 1576 1577 1577 /* redisplay */ 1578 1578 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); … … 1617 1617 owl_function_popless_text("Error getting subscriptions"); 1618 1618 } 1619 1619 1620 1620 g_free(buff); 1621 1621 } … … 1658 1658 const owl_variable *v; 1659 1659 GPtrArray *varnames; 1660 owl_fmtext fm; 1660 owl_fmtext fm; 1661 1661 int i; 1662 1662 const char *varname; 1663 1663 1664 1664 owl_fmtext_init_null(&fm); 1665 owl_fmtext_append_bold(&fm, 1665 owl_fmtext_append_bold(&fm, 1666 1666 "Variables: (use 'show variable <name>' for details)\n"); 1667 1667 varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g)); … … 1681 1681 { 1682 1682 const owl_variable *v; 1683 owl_fmtext fm; 1683 owl_fmtext fm; 1684 1684 1685 1685 owl_fmtext_init_null(&fm); … … 1819 1819 owl_fmtext_append_normal(&fm, "no\n"); 1820 1820 #endif 1821 1821 1822 1822 1823 1823 owl_fmtext_append_normal(&fm, "\nAIM Status:\n"); … … 1872 1872 const owl_message *m; 1873 1873 const owl_filter *f; 1874 1874 1875 1875 if (owl_view_get_size(owl_global_get_current_view(&g))==0) { 1876 1876 owl_function_error("No message selected"); 1877 1877 } else { 1878 1878 char *cmd; 1879 1879 1880 1880 m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g)); 1881 1881 if (!m) { … … 2020 2020 #if OWL_STDERR_REDIR 2021 2021 redirect = " < /dev/null"; 2022 #endif 2022 #endif 2023 2023 2024 2024 if (argc<2) { … … 2036 2036 out = owl_slurp(p); 2037 2037 pclose(p); 2038 2038 2039 2039 if (type == OWL_OUTPUT_RETURN) { 2040 2040 g_free(newbuff); … … 2067 2067 2068 2068 perlout = owl_perlconfig_execute(buff); 2069 if (perlout) { 2069 if (perlout) { 2070 2070 if (type == OWL_OUTPUT_POPUP) { 2071 2071 owl_function_popless_text(perlout); … … 2114 2114 /* Figure out what to set the current message to. 2115 2115 * - If the view we're leaving has messages in it, go to the closest message 2116 * to the last message pointed to in that view. 2116 * to the last message pointed to in that view. 2117 2117 * - If the view we're leaving is empty, try to restore the position 2118 2118 * from the last time we were in the new view. */ … … 2227 2227 2228 2228 owl_function_debugmsg("owl_function_create_negative_filter"); 2229 2229 2230 2230 if (!strncmp(filtername, "not-", 4)) { 2231 2231 newname=g_strdup(filtername+4); … … 2316 2316 * If 'related' is nonzero, encompass unclasses and .d classes as well. 2317 2317 */ 2318 CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 2318 CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 2319 2319 { 2320 2320 owl_filter *f; … … 2350 2350 } 2351 2351 } 2352 2352 2353 2353 /* if it already exists then go with it. This lets users override */ 2354 2354 if (owl_global_get_filter(&g, filtname)) { … … 2540 2540 owl_function_makemsg("%i messages marked for %sdeletion", j, flag?"":"un"); 2541 2541 2542 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2542 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2543 2543 } 2544 2544 … … 2588 2588 * If the curmsg is a zephyr class message, instance foo, recip *, 2589 2589 * return a filter name to the class, inst. 2590 * If the curmsg is a zephyr class message and type==0 then 2590 * If the curmsg is a zephyr class message and type==0 then 2591 2591 * return a filter name for just the class. 2592 * If the curmsg is a zephyr class message and type==1 then 2592 * If the curmsg is a zephyr class message and type==1 then 2593 2593 * return a filter name for the class and instance. 2594 2594 * If the curmsg is a personal AIM message returna filter 2595 * name to the AIM conversation with that user 2595 * name to the AIM conversation with that user 2596 2596 */ 2597 2597 CALLER_OWN char *owl_function_smartfilter(int type, int invert_related) … … 2670 2670 void owl_function_smartzpunt(int type) 2671 2671 { 2672 /* Starts a zpunt command based on the current class,instance pair. 2672 /* Starts a zpunt command based on the current class,instance pair. 2673 2673 * If type=0, uses just class. If type=1, uses instance as well. */ 2674 2674 const owl_view *v; … … 2676 2676 const char *mclass, *minst; 2677 2677 GString *buf; 2678 2678 2679 2679 v=owl_global_get_current_view(&g); 2680 2680 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); … … 2759 2759 } 2760 2760 owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor)); 2761 2761 2762 2762 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2763 2763 return(0); … … 2767 2767 { 2768 2768 owl_fmtext fm; 2769 int i; 2770 2769 int i; 2770 2771 2771 owl_fmtext_init_null(&fm); 2772 2772 owl_fmtext_append_normal(&fm,"default: "); … … 2805 2805 g_free(str2); 2806 2806 } 2807 2807 2808 2808 owl_function_popless_fmtext(&fm); 2809 2809 owl_fmtext_cleanup(&fm); … … 2923 2923 } 2924 2924 owl_fmtext_append_normal(&fm, "\n"); 2925 2925 2926 2926 owl_function_popless_fmtext(&fm); 2927 2927 owl_ptr_array_free(l, g_free); … … 2931 2931 CALLER_OWN char *owl_function_keymap_summary(const char *name) 2932 2932 { 2933 const owl_keymap *km 2933 const owl_keymap *km 2934 2934 = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name); 2935 2935 if (km) return owl_keymap_summary(km); … … 2949 2949 } else { 2950 2950 owl_fmtext_append_normal(&fm, "No such keymap...\n"); 2951 } 2951 } 2952 2952 owl_function_popless_fmtext(&fm); 2953 2953 owl_fmtext_cleanup(&fm); … … 2960 2960 owl_fmtext_init_null(&fm); 2961 2961 owl_cmd_get_help(owl_global_get_cmddict(&g), cmdname, &fm); 2962 owl_function_popless_fmtext(&fm); 2962 owl_function_popless_fmtext(&fm); 2963 2963 owl_fmtext_cleanup(&fm); 2964 2964 } … … 2993 2993 viewsize=owl_view_get_size(v); 2994 2994 curmsg=owl_global_get_curmsg(&g); 2995 2995 2996 2996 if (viewsize==0) { 2997 2997 owl_function_makemsg("No messages present"); … … 3041 3041 } 3042 3042 3043 /* strips formatting from ztext and returns the unformatted text. 3043 /* strips formatting from ztext and returns the unformatted text. 3044 3044 * caller is responsible for freeing. */ 3045 3045 CALLER_OWN char *owl_function_ztext_stylestrip(const char *zt) … … 3167 3167 3168 3168 /* Dump messages in the current view to the file 'filename'. */ 3169 void owl_function_dump(const char *filename) 3169 void owl_function_dump(const char *filename) 3170 3170 { 3171 3171 int i, j; … … 3221 3221 } 3222 3222 } 3223 3223 3224 3224 /* if it exited, spawn a new one */ 3225 3225 if (owl_global_get_newmsgproc_pid(&g)==0) { -
global.c
r0792d99 r7869e48 55 55 g->lastinputtime=g->starttime; 56 56 g->newmsgproc_pid=0; 57 57 58 58 owl_global_set_config_format(g, 0); 59 59 owl_global_set_no_have_config(g); … … 596 596 int owl_global_should_followlast(owl_global *g) { 597 597 const owl_view *v; 598 598 599 599 if (!owl_global_is__followlast(g)) return(0); 600 600 601 601 v=owl_global_get_current_view(g); 602 602 603 603 if (owl_global_get_curmsg(g)==owl_view_get_size(v)-1) return(1); 604 604 return(0); … … 743 743 return(&(g->buddylist)); 744 744 } 745 745 746 746 /* style */ 747 747 -
help.c
rd6b8b50 r7869e48 11 11 owl_fmtext_init_null(&fm); 12 12 owl_fmtext_append_bold 13 (&fm, 13 (&fm, 14 14 "OWL HELP\n\n"); 15 15 16 16 owl_fmtext_append_normal 17 (&fm, 17 (&fm, 18 18 " If you're new to BarnOwl, the first thing you should type is\n\n" 19 19 " :show quickstart\n\n" … … 24 24 25 25 owl_fmtext_append_bold 26 (&fm, 26 (&fm, 27 27 " Basic Keys:\n" 28 28 ); 29 29 owl_fmtext_append_normal 30 (&fm, 30 (&fm, 31 31 " n Move to next non-deleted message\n" 32 32 " p Move to previous non-deleted message\n" … … 78 78 ); 79 79 owl_fmtext_append_bold 80 (&fm, 80 (&fm, 81 81 " Basic Commands:\n" 82 82 ); 83 83 owl_fmtext_append_normal 84 (&fm, 84 (&fm, 85 85 " quit, exit Exit BarnOwl\n" 86 86 " help Get help about commands\n" … … 125 125 " version Print the version number of BarnOwl\n" 126 126 "\n"); 127 127 128 128 /* help for variables */ 129 owl_fmtext_append_bold(&fm, 129 owl_fmtext_append_bold(&fm, 130 130 "Variables:\n"); 131 131 varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g)); -
keybinding.c
rf271129 r7869e48 2 2 3 3 /* 4 * TODO: Idea for allowing functions to be user-specified --- 5 * Have function have a context bitmask that says where it 4 * TODO: Idea for allowing functions to be user-specified --- 5 * Have function have a context bitmask that says where it 6 6 * can be used, and have keymaps also have one, and compare 7 7 * the two when setting. 8 * 8 * 9 9 */ 10 10 -
keymap.c
rf271129 r7869e48 41 41 return -1; 42 42 /* see if another matching binding, and if so remove it. 43 * otherwise just add this one. 43 * otherwise just add this one. 44 44 */ 45 45 for (i = km->bindings->len-1; i >= 0; i--) { … … 99 99 owl_fmtext_append_normal(fm, "\n"); 100 100 if (km->default_fn) { 101 owl_fmtext_append_normal(fm, OWL_TABSTR 101 owl_fmtext_append_normal(fm, OWL_TABSTR 102 102 "Has a default keypress handler (default_fn).\n"); 103 103 } … … 107 107 } 108 108 if (km->postalways_fn) { 109 owl_fmtext_append_normal(fm, OWL_TABSTR 109 owl_fmtext_append_normal(fm, OWL_TABSTR 110 110 "Executes a function (postalways_fn) after handling every keypress.\n"); 111 111 } 112 112 113 owl_fmtext_append_bold(fm, "\nKey bindings:\n\n"); 113 owl_fmtext_append_bold(fm, "\nKey bindings:\n\n"); 114 114 if (recurse) { 115 115 _owl_keymap_format_with_parents(km, fm); … … 136 136 int i; 137 137 const owl_keybinding *kb; 138 138 139 139 for (i = 0; i < km->bindings->len; i++) { 140 140 char *kbstr; … … 160 160 owl_fmtext_append_normal(fm, kb->command); 161 161 owl_fmtext_append_normal(fm, "]"); 162 } 162 } 163 163 owl_fmtext_append_normal(fm, "\n"); 164 164 } … … 249 249 kh->in_esc = 0; 250 250 } 251 251 252 252 kh->kpstack[++(kh->kpstackpos)] = j.ch; 253 253 if (kh->kpstackpos >= OWL_KEYMAP_MAXSTACK) { … … 301 301 owl_keyhandler_invalidkey(kh); 302 302 /* unable to handle */ 303 return(1); 303 return(1); 304 304 } 305 305 -
keypress.c
rf271129 r7869e48 6 6 } specialmap[] = { 7 7 #ifdef KEY_CODE_YES 8 { KEY_CODE_YES, "CODE_YES" }, 8 { KEY_CODE_YES, "CODE_YES" }, 9 9 #endif 10 { KEY_MIN, "MIN" }, 11 { KEY_BREAK, "BREAK" }, 12 { KEY_DOWN, "DOWN" }, 13 { KEY_UP, "UP" }, 14 { KEY_LEFT, "LEFT" }, 15 { KEY_RIGHT, "RIGHT" }, 16 { KEY_HOME, "HOME" }, 17 { KEY_BACKSPACE, "BACKSPACE" }, 18 { KEY_F0, "F0" }, 19 { KEY_F(1), "F1" }, 20 { KEY_F(2), "F2" }, 21 { KEY_F(3), "F3" }, 22 { KEY_F(4), "F4" }, 23 { KEY_F(5), "F5" }, 24 { KEY_F(6), "F6" }, 25 { KEY_F(7), "F7" }, 26 { KEY_F(8), "F8" }, 27 { KEY_F(9), "F9" }, 28 { KEY_F(10), "F10" }, 29 { KEY_F(11), "F11" }, 30 { KEY_F(12), "F12" }, 31 { KEY_DL, "DL" }, 32 { KEY_IL, "IL" }, 33 { KEY_DC, "DC" }, 34 { KEY_IC, "IC" }, 35 { KEY_EIC, "EIC" }, 36 { KEY_CLEAR, "CLEAR" }, 37 { KEY_EOS, "EOS" }, 38 { KEY_EOL, "EOL" }, 39 { KEY_SF, "SF" }, 40 { KEY_SR, "SR" }, 41 { KEY_NPAGE, "NPAGE" }, 42 { KEY_PPAGE, "PPAGE" }, 43 { KEY_STAB, "STAB" }, 44 { KEY_CTAB, "CTAB" }, 45 { KEY_CATAB, "CATAB" }, 46 { KEY_ENTER, "ENTER" }, 47 { KEY_SRESET, "SRESET" }, 48 { KEY_RESET, "RESET" }, 49 { KEY_PRINT, "PRINT" }, 50 { KEY_LL, "LL" }, 51 { KEY_A1, "A1" }, 52 { KEY_A3, "A3" }, 53 { KEY_B2, "B2" }, 54 { KEY_C1, "C1" }, 55 { KEY_C3, "C3" }, 56 { KEY_BTAB, "BTAB" }, 57 { KEY_BEG, "BEG" }, 58 { KEY_CANCEL, "CANCEL" }, 59 { KEY_CLOSE, "CLOSE" }, 60 { KEY_COMMAND, "COMMAND" }, 61 { KEY_COPY, "COPY" }, 62 { KEY_CREATE, "CREATE" }, 63 { KEY_END, "END" }, 64 { KEY_EXIT, "EXIT" }, 65 { KEY_FIND, "FIND" }, 66 { KEY_HELP, "HELP" }, 67 { KEY_MARK, "MARK" }, 68 { KEY_MESSAGE, "MESSAGE" }, 69 { KEY_MOVE, "MOVE" }, 70 { KEY_NEXT, "NEXT" }, 71 { KEY_OPEN, "OPEN" }, 72 { KEY_OPTIONS, "OPTIONS" }, 73 { KEY_PREVIOUS, "PREVIOUS" }, 74 { KEY_REDO, "REDO" }, 75 { KEY_REFERENCE, "REFERENCE" }, 76 { KEY_REFRESH, "REFRESH" }, 77 { KEY_REPLACE, "REPLACE" }, 78 { KEY_RESTART, "RESTART" }, 79 { KEY_RESUME, "RESUME" }, 80 { KEY_SAVE, "SAVE" }, 81 { KEY_SBEG, "SBEG" }, 82 { KEY_SCANCEL, "SCANCEL" }, 83 { KEY_SCOMMAND, "SCOMMAND" }, 84 { KEY_SCOPY, "SCOPY" }, 85 { KEY_SCREATE, "SCREATE" }, 86 { KEY_SDC, "SDC" }, 87 { KEY_SDL, "SDL" }, 88 { KEY_SELECT, "SELECT" }, 89 { KEY_SEND, "SEND" }, 90 { KEY_SEOL, "SEOL" }, 91 { KEY_SEXIT, "SEXIT" }, 92 { KEY_SFIND, "SFIND" }, 93 { KEY_SHELP, "SHELP" }, 94 { KEY_SHOME, "SHOME" }, 95 { KEY_SIC, "SIC" }, 96 { KEY_SLEFT, "SLEFT" }, 97 { KEY_SMESSAGE, "SMESSAGE" }, 98 { KEY_SMOVE, "SMOVE" }, 99 { KEY_SNEXT, "SNEXT" }, 100 { KEY_SOPTIONS, "SOPTIONS" }, 101 { KEY_SPREVIOUS, "SPREVIOUS" }, 102 { KEY_SPRINT, "SPRINT" }, 103 { KEY_SREDO, "SREDO" }, 104 { KEY_SREPLACE, "SREPLACE" }, 105 { KEY_SRIGHT, "SRIGHT" }, 106 { KEY_SRSUME, "SRSUME" }, 107 { KEY_SSAVE, "SSAVE" }, 108 { KEY_SSUSPEND, "SSUSPEND" }, 109 { KEY_SUNDO, "SUNDO" }, 110 { KEY_SUSPEND, "SUSPEND" }, 111 { KEY_UNDO, "UNDO" }, 112 { KEY_MOUSE, "MOUSE" }, 10 { KEY_MIN, "MIN" }, 11 { KEY_BREAK, "BREAK" }, 12 { KEY_DOWN, "DOWN" }, 13 { KEY_UP, "UP" }, 14 { KEY_LEFT, "LEFT" }, 15 { KEY_RIGHT, "RIGHT" }, 16 { KEY_HOME, "HOME" }, 17 { KEY_BACKSPACE, "BACKSPACE" }, 18 { KEY_F0, "F0" }, 19 { KEY_F(1), "F1" }, 20 { KEY_F(2), "F2" }, 21 { KEY_F(3), "F3" }, 22 { KEY_F(4), "F4" }, 23 { KEY_F(5), "F5" }, 24 { KEY_F(6), "F6" }, 25 { KEY_F(7), "F7" }, 26 { KEY_F(8), "F8" }, 27 { KEY_F(9), "F9" }, 28 { KEY_F(10), "F10" }, 29 { KEY_F(11), "F11" }, 30 { KEY_F(12), "F12" }, 31 { KEY_DL, "DL" }, 32 { KEY_IL, "IL" }, 33 { KEY_DC, "DC" }, 34 { KEY_IC, "IC" }, 35 { KEY_EIC, "EIC" }, 36 { KEY_CLEAR, "CLEAR" }, 37 { KEY_EOS, "EOS" }, 38 { KEY_EOL, "EOL" }, 39 { KEY_SF, "SF" }, 40 { KEY_SR, "SR" }, 41 { KEY_NPAGE, "NPAGE" }, 42 { KEY_PPAGE, "PPAGE" }, 43 { KEY_STAB, "STAB" }, 44 { KEY_CTAB, "CTAB" }, 45 { KEY_CATAB, "CATAB" }, 46 { KEY_ENTER, "ENTER" }, 47 { KEY_SRESET, "SRESET" }, 48 { KEY_RESET, "RESET" }, 49 { KEY_PRINT, "PRINT" }, 50 { KEY_LL, "LL" }, 51 { KEY_A1, "A1" }, 52 { KEY_A3, "A3" }, 53 { KEY_B2, "B2" }, 54 { KEY_C1, "C1" }, 55 { KEY_C3, "C3" }, 56 { KEY_BTAB, "BTAB" }, 57 { KEY_BEG, "BEG" }, 58 { KEY_CANCEL, "CANCEL" }, 59 { KEY_CLOSE, "CLOSE" }, 60 { KEY_COMMAND, "COMMAND" }, 61 { KEY_COPY, "COPY" }, 62 { KEY_CREATE, "CREATE" }, 63 { KEY_END, "END" }, 64 { KEY_EXIT, "EXIT" }, 65 { KEY_FIND, "FIND" }, 66 { KEY_HELP, "HELP" }, 67 { KEY_MARK, "MARK" }, 68 { KEY_MESSAGE, "MESSAGE" }, 69 { KEY_MOVE, "MOVE" }, 70 { KEY_NEXT, "NEXT" }, 71 { KEY_OPEN, "OPEN" }, 72 { KEY_OPTIONS, "OPTIONS" }, 73 { KEY_PREVIOUS, "PREVIOUS" }, 74 { KEY_REDO, "REDO" }, 75 { KEY_REFERENCE, "REFERENCE" }, 76 { KEY_REFRESH, "REFRESH" }, 77 { KEY_REPLACE, "REPLACE" }, 78 { KEY_RESTART, "RESTART" }, 79 { KEY_RESUME, "RESUME" }, 80 { KEY_SAVE, "SAVE" }, 81 { KEY_SBEG, "SBEG" }, 82 { KEY_SCANCEL, "SCANCEL" }, 83 { KEY_SCOMMAND, "SCOMMAND" }, 84 { KEY_SCOPY, "SCOPY" }, 85 { KEY_SCREATE, "SCREATE" }, 86 { KEY_SDC, "SDC" }, 87 { KEY_SDL, "SDL" }, 88 { KEY_SELECT, "SELECT" }, 89 { KEY_SEND, "SEND" }, 90 { KEY_SEOL, "SEOL" }, 91 { KEY_SEXIT, "SEXIT" }, 92 { KEY_SFIND, "SFIND" }, 93 { KEY_SHELP, "SHELP" }, 94 { KEY_SHOME, "SHOME" }, 95 { KEY_SIC, "SIC" }, 96 { KEY_SLEFT, "SLEFT" }, 97 { KEY_SMESSAGE, "SMESSAGE" }, 98 { KEY_SMOVE, "SMOVE" }, 99 { KEY_SNEXT, "SNEXT" }, 100 { KEY_SOPTIONS, "SOPTIONS" }, 101 { KEY_SPREVIOUS, "SPREVIOUS" }, 102 { KEY_SPRINT, "SPRINT" }, 103 { KEY_SREDO, "SREDO" }, 104 { KEY_SREPLACE, "SREPLACE" }, 105 { KEY_SRIGHT, "SRIGHT" }, 106 { KEY_SRSUME, "SRSUME" }, 107 { KEY_SSAVE, "SSAVE" }, 108 { KEY_SSUSPEND, "SSUSPEND" }, 109 { KEY_SUNDO, "SUNDO" }, 110 { KEY_SUSPEND, "SUSPEND" }, 111 { KEY_UNDO, "UNDO" }, 112 { KEY_MOUSE, "MOUSE" }, 113 113 #ifdef KEY_RESIZE 114 { KEY_RESIZE, "RESIZE" }, 114 { KEY_RESIZE, "RESIZE" }, 115 115 #endif 116 { KEY_MAX, "MAX" }, 117 { ' ', "SPACE" }, 118 { 27, "ESCAPE" }, 119 { 127, "DELETE" }, 120 { '\r', "CR" }, 116 { KEY_MAX, "MAX" }, 117 { ' ', "SPACE" }, 118 { 27, "ESCAPE" }, 119 { 127, "DELETE" }, 120 { '\r', "CR" }, 121 121 { '\n', "LF" }, 122 { '\t', "TAB" }, 122 { '\t', "TAB" }, 123 123 { 0, NULL } 124 124 }; … … 157 157 g_string_append_c(kb, j); 158 158 } 159 160 } 159 160 } 161 161 if (!kb->str[0]) { 162 162 /* not a valid key */ -
keys.c
rdcd48ad r7869e48 13 13 *km_ew_multi, *km_ew_onel, *km_viewwin; 14 14 15 15 16 16 /****************************************************************/ 17 17 /*************************** GLOBAL *****************************/ … … 19 19 20 20 km_global = km = owl_keyhandler_create_and_add_keymap(kh, "global", 21 "System-wide default key bindings", 21 "System-wide default key bindings", 22 22 owl_keys_default_invalid, NULL, NULL); 23 23 BIND_CMD("C-z", "message Use :suspend to suspend.", ""); … … 28 28 29 29 km_editwin = km = owl_keyhandler_create_and_add_keymap(kh, "edit", 30 "Text editing and command window", 30 "Text editing and command window", 31 31 owl_keys_editwin_default, NULL, owl_keys_editwin_postalways); 32 32 owl_keymap_set_parent(km_editwin, km_global); … … 97 97 98 98 km_ew_multi = km = owl_keyhandler_create_and_add_keymap(kh, "editmulti", 99 "Multi-line text editing", 99 "Multi-line text editing", 100 100 owl_keys_editwin_default, NULL, owl_keys_editwin_postalways); 101 101 owl_keymap_set_parent(km_ew_multi, km_editwin); … … 117 117 BIND_CMD("M-n", "edit:history-next", ""); 118 118 119 /* note that changing "disable-ctrl-d" to "on" will change this to 119 /* note that changing "disable-ctrl-d" to "on" will change this to 120 120 * edit:delete-next-char */ 121 121 BIND_CMD("C-d", "edit:done-or-delete", "sends the zephyr if at the end of the message"); … … 127 127 128 128 km_ew_onel = km = owl_keyhandler_create_and_add_keymap(kh, "editline", 129 "Single-line text editing", 129 "Single-line text editing", 130 130 owl_keys_editwin_default, NULL, owl_keys_editwin_postalways); 131 131 owl_keymap_set_parent(km_ew_onel, km_editwin); … … 146 146 BIND_CMD("CR", "editline:done", "executes the command"); 147 147 148 148 149 149 /****************************************************************/ 150 150 /**************************** EDITRESPONSE **********************/ … … 152 152 153 153 km_ew_onel = km = owl_keyhandler_create_and_add_keymap(kh, "editresponse", 154 "Single-line response to question", 154 "Single-line response to question", 155 155 owl_keys_editwin_default, NULL, owl_keys_editwin_postalways); 156 156 owl_keymap_set_parent(km_ew_onel, km_editwin); … … 167 167 168 168 km_viewwin = km = owl_keyhandler_create_and_add_keymap(kh, "popless", 169 "Pop-up window (eg, help)", 169 "Pop-up window (eg, help)", 170 170 owl_keys_default_invalid, NULL, owl_keys_popless_postalways); 171 171 owl_keymap_set_parent(km_viewwin, km_global); … … 261 261 BIND_CMD("M-M", "smartnarrow -ri", "like M-N but with 'narrow-related' temporarily flipped."); 262 262 BIND_CMD("M-p", "view personal", ""); 263 263 264 264 BIND_CMD("/", "start-command search ", "start a search command"); 265 265 BIND_CMD("?", "start-command search -r ", "start a reverse search command"); … … 273 273 BIND_CMD("C-n", "recv:next", ""); 274 274 BIND_CMD("M-[ B", "recv:next", ""); 275 BIND_CMD("M-C-n", "recv:next --smart-filter", "move to next message matching the current one"); 275 BIND_CMD("M-C-n", "recv:next --smart-filter", "move to next message matching the current one"); 276 276 BIND_CMD("UP", "recv:prev", ""); 277 277 BIND_CMD("M-[ A", "recv:prev", ""); -
libfaim/admin.c
rcf02dd6 r7869e48 2 2 * Family 0x0007 - Account Administration. 3 3 * 4 * Used for stuff like changing the formating of your screen name, changing your 5 * email address, requesting an account confirmation email, getting account info, 4 * Used for stuff like changing the formating of your screen name, changing your 5 * email address, requesting an account confirmation email, getting account info, 6 6 * 7 7 */ … … 18 18 * 0x0013 - Unknown 19 19 * 20 */ 20 */ 21 21 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info) 22 22 { … … 41 41 * Subtypes 0x0003 and 0x0005 - Parse account info. 42 42 * 43 * Called in reply to both an information request (subtype 0x0002) and 43 * Called in reply to both an information request (subtype 0x0002) and 44 44 * an information change (subtype 0x0004). 45 45 * … … 112 112 113 113 aim_tlvlist_add_raw(&tl, 0x0001, strlen(newnick), newnick); 114 114 115 115 aim_tlvlist_write(&fr->data, &tl); 116 116 aim_tlvlist_free(&tl); 117 117 118 118 aim_tx_enqueue(sess, fr); 119 119 … … 169 169 170 170 aim_tlvlist_add_raw(&tl, 0x0011, strlen(newemail), newemail); 171 171 172 172 aim_tlvlist_write(&fr->data, &tl); 173 173 aim_tlvlist_free(&tl); 174 174 175 175 aim_tx_enqueue(sess, fr); 176 176 -
libfaim/aim.h
rfe73d0c r7869e48 1 /* 1 /* 2 2 * Main libfaim header. Must be included in client for prototypes/macros. 3 3 * … … 51 51 52 52 #if defined(mach) && defined(__APPLE__) 53 #define gethostbyname(x) gethostbyname2(x, AF_INET) 53 #define gethostbyname(x) gethostbyname2(x, AF_INET) 54 54 #endif 55 55 … … 57 57 /* 58 58 * For a win32 DLL, we define WIN32_INDLL if this file 59 * is included while compiling the DLL. If its not 59 * is included while compiling the DLL. If its not 60 60 * defined (its included in a client app), the symbols 61 61 * will be imported instead of exported. … … 63 63 #ifdef WIN32_INDLL 64 64 #define faim_export __declspec(dllexport) 65 #else 65 #else 66 66 #define faim_export __declspec(dllimport) 67 67 #endif /* WIN32_INDLL */ … … 83 83 #endif 84 84 85 /* 86 * Current Maximum Length for Screen Names (not including NULL) 85 /* 86 * Current Maximum Length for Screen Names (not including NULL) 87 87 * 88 88 * Currently only names up to 16 characters can be registered … … 104 104 * 105 105 * XXX: the real limit is the total SNAC size at 8192. Fix this. 106 * 106 * 107 107 */ 108 108 #define MAXMSGLEN 7987 … … 118 118 * 119 119 * This is actually defined by the protocol to be 120 * dynamic, but I have yet to see due cause to 120 * dynamic, but I have yet to see due cause to 121 121 * define it dynamically here. Maybe later. 122 122 * … … 132 132 133 133 /* 134 * Client info. Filled in by the client and passed in to 134 * Client info. Filled in by the client and passed in to 135 135 * aim_send_login(). The information ends up getting passed to OSCAR 136 136 * through the initial login command. … … 277 277 #define CLIENTINFO_ICQ_KNOWNGOOD CLIENTINFO_ICQ_5_45_3777 278 278 279 /* 280 * These could be arbitrary, but its easier to use the actual AIM values 279 /* 280 * These could be arbitrary, but its easier to use the actual AIM values 281 281 */ 282 282 #define AIM_CONN_TYPE_BOS 0x0002 … … 323 323 void *internal; /* internal conn-specific libfaim data */ 324 324 time_t lastactivity; /* time of last transmit */ 325 int forcedlatency; 325 int forcedlatency; 326 326 void *handlerlist; 327 327 void *sessv; /* pointer to parent session */ … … 353 353 fu8_t hdrtype; /* defines which piece of the union to use */ 354 354 union { 355 struct { 355 struct { 356 356 fu8_t type; 357 flap_seqnum_t seqnum; 357 flap_seqnum_t seqnum; 358 358 } flap; 359 359 struct { … … 379 379 380 380 /* 381 * AIM Session: The main client-data interface. 381 * AIM Session: The main client-data interface. 382 382 * 383 383 */ … … 390 390 391 391 /* 392 * Pointer to anything the client wants to 392 * Pointer to anything the client wants to 393 393 * explicitly associate with this session. 394 394 * … … 410 410 * I/O. I don't suggest that you use libfaim's internal I/O. 411 411 * Its really bad and the API/event model is quirky at best. 412 * 412 * 413 413 */ 414 aim_frame_t *queue_outgoing; 415 aim_frame_t *queue_incoming; 414 aim_frame_t *queue_outgoing; 415 aim_frame_t *queue_incoming; 416 416 417 417 /* … … 439 439 440 440 /* 441 * Outstanding snac handling 441 * Outstanding snac handling 442 442 * 443 443 * XXX: Should these be per-connection? -mid … … 764 764 /* 765 765 * This information is provided in the Incoming ICBM callback for 766 * Channel 1 ICBM's. 766 * Channel 1 ICBM's. 767 767 * 768 768 * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they … … 780 780 aim_mpmsg_t mpmsg; 781 781 fu32_t icbmflags; /* some flags apply only to ->msg, not all mpmsg */ 782 782 783 783 /* Only provided if message has a human-readable section */ 784 784 char *msg; -
libfaim/aim_cbtypes.h
rcf02dd6 r7869e48 35 35 /* 36 36 * SNAC Family: Ack. 37 * 37 * 38 38 * Not really a family, but treating it as one really 39 39 * helps it fit into the libfaim callback structure better. … … 44 44 /* 45 45 * SNAC Family: General. 46 */ 46 */ 47 47 #define AIM_CB_GEN_ERROR 0x0001 48 48 #define AIM_CB_GEN_CLIENTREADY 0x0002 … … 69 69 /* 70 70 * SNAC Family: Location Services. 71 */ 71 */ 72 72 #define AIM_CB_LOC_ERROR 0x0001 73 73 #define AIM_CB_LOC_REQRIGHTS 0x0002 … … 82 82 /* 83 83 * SNAC Family: Buddy List Management Services. 84 */ 84 */ 85 85 #define AIM_CB_BUD_ERROR 0x0001 86 86 #define AIM_CB_BUD_REQRIGHTS 0x0002 … … 95 95 /* 96 96 * SNAC Family: Messeging Services. 97 */ 97 */ 98 98 #define AIM_CB_MSG_ERROR 0x0001 99 99 #define AIM_CB_MSG_PARAMINFO 0x0005 … … 108 108 /* 109 109 * SNAC Family: Advertisement Services 110 */ 110 */ 111 111 #define AIM_CB_ADS_ERROR 0x0001 112 112 #define AIM_CB_ADS_DEFAULT 0xffff … … 114 114 /* 115 115 * SNAC Family: Invitation Services. 116 */ 116 */ 117 117 #define AIM_CB_INV_ERROR 0x0001 118 118 #define AIM_CB_INV_DEFAULT 0xffff … … 120 120 /* 121 121 * SNAC Family: Administrative Services. 122 */ 122 */ 123 123 #define AIM_CB_ADM_ERROR 0x0001 124 124 #define AIM_CB_ADM_INFOCHANGE_REPLY 0x0005 … … 127 127 /* 128 128 * SNAC Family: Popup Messages 129 */ 129 */ 130 130 #define AIM_CB_POP_ERROR 0x0001 131 131 #define AIM_CB_POP_DEFAULT 0xffff … … 133 133 /* 134 134 * SNAC Family: Misc BOS Services. 135 */ 135 */ 136 136 #define AIM_CB_BOS_ERROR 0x0001 137 137 #define AIM_CB_BOS_RIGHTSQUERY 0x0002 … … 141 141 /* 142 142 * SNAC Family: User Lookup Services 143 */ 143 */ 144 144 #define AIM_CB_LOK_ERROR 0x0001 145 145 #define AIM_CB_LOK_DEFAULT 0xffff … … 147 147 /* 148 148 * SNAC Family: User Status Services 149 */ 149 */ 150 150 #define AIM_CB_STS_ERROR 0x0001 151 151 #define AIM_CB_STS_SETREPORTINTERVAL 0x0002 … … 155 155 /* 156 156 * SNAC Family: Translation Services 157 */ 157 */ 158 158 #define AIM_CB_TRN_ERROR 0x0001 159 159 #define AIM_CB_TRN_DEFAULT 0xffff … … 161 161 /* 162 162 * SNAC Family: Chat Navigation Services 163 */ 163 */ 164 164 #define AIM_CB_CTN_ERROR 0x0001 165 165 #define AIM_CB_CTN_CREATE 0x0008 … … 169 169 /* 170 170 * SNAC Family: Chat Services 171 */ 171 */ 172 172 #define AIM_CB_CHT_ERROR 0x0001 173 173 #define AIM_CB_CHT_ROOMINFOUPDATE 0x0002 … … 180 180 /* 181 181 * SNAC Family: "New" Search 182 */ 182 */ 183 183 #define AIM_CB_SCH_ERROR 0x0001 184 184 #define AIM_CB_SCH_SEARCH 0x0002 … … 187 187 /* 188 188 * SNAC Family: Buddy icons 189 */ 189 */ 190 190 #define AIM_CB_ICO_ERROR 0x0001 191 191 #define AIM_CB_ICO_REQUEST 0x0004 … … 196 196 * 197 197 * Most of these are actually special. 198 */ 198 */ 199 199 #define AIM_CB_ICQ_ERROR 0x0001 200 200 #define AIM_CB_ICQ_OFFLINEMSG 0x00f0 … … 256 256 * OFT Services 257 257 * 258 * For all of the above #defines, the number is the subtype 259 * of the SNAC. For OFT #defines, the number is the 260 * "hdrtype" which comes after the magic string and OFT 258 * For all of the above #defines, the number is the subtype 259 * of the SNAC. For OFT #defines, the number is the 260 * "hdrtype" which comes after the magic string and OFT 261 261 * packet length. 262 262 * 263 * I'm pretty sure the ODC ones are arbitrary right now, 263 * I'm pretty sure the ODC ones are arbitrary right now, 264 264 * that should be changed. 265 265 */ … … 292 292 * the SNAC-centered libfaim callback structure. 293 293 * 294 */ 294 */ 295 295 #define AIM_CB_SPECIAL_AUTHSUCCESS 0x0001 296 296 #define AIM_CB_SPECIAL_AUTHOTHER 0x0002 -
libfaim/aim_internal.h
rcf02dd6 r7869e48 144 144 }; 145 145 146 /* 146 /* 147 147 * In SNACland, the terms 'family' and 'group' are synonymous -- the former 148 148 * is my term, the latter is AOL's. … … 178 178 * This is inside every connection. But it is a void * to anything 179 179 * outside of libfaim. It should remain that way. It's called data 180 * abstraction. Maybe you've heard of it. (Probably not if you're a 180 * abstraction. Maybe you've heard of it. (Probably not if you're a 181 181 * libfaim user.) 182 * 182 * 183 183 */ 184 184 typedef struct aim_conn_inside_s { -
libfaim/auth.c
rcf02dd6 r7869e48 2 2 * Family 0x0017 - Authentication. 3 3 * 4 * Deals with the authorizer for SNAC-based login, and also old-style 4 * Deals with the authorizer for SNAC-based login, and also old-style 5 5 * non-SNAC login. 6 6 * … … 24 24 * 25 25 * The encoding_table seems to be a fixed set of values. We'll 26 * hope it doesn't change over time! 26 * hope it doesn't change over time! 27 27 * 28 28 * This is only used for the XOR method, not the better MD5 method. … … 59 59 md5_state_t state; 60 60 61 md5_init(&state); 61 md5_init(&state); 62 62 md5_append(&state, (const md5_byte_t *)key, strlen(key)); 63 63 md5_append(&state, (const md5_byte_t *)password, strlen(password)); … … 77 77 md5_finish(&state, (md5_byte_t *)&passdigest); 78 78 79 md5_init(&state); 79 md5_init(&state); 80 80 md5_append(&state, (const md5_byte_t *)key, strlen(key)); 81 81 md5_append(&state, (const md5_byte_t *)&passdigest, 16); … … 88 88 89 89 /* 90 * The FLAP version is sent by itself at the beginning of authorization 91 * connections. The FLAP version is also sent before the cookie when connecting 90 * The FLAP version is sent by itself at the beginning of authorization 91 * connections. The FLAP version is also sent before the cookie when connecting 92 92 * for other services (BOS, chatnav, chat, etc.). 93 93 */ … … 197 197 * build = 0x0013 198 198 * unknown= (not sent) 199 * 199 * 200 200 * AIM for Linux 1.1.112: 201 201 * clientstring = "AOL Instant Messenger (SM)" … … 260 260 261 261 aim_tlvlist_free(&tl); 262 262 263 263 aim_tx_enqueue(sess, fr); 264 264 … … 269 269 * This is sent back as a general response to the login command. 270 270 * It can be either an error or a success, depending on the 271 * precense of certain TLVs. 271 * precense of certain TLVs. 272 272 * 273 273 * The client should check the value passed as errorcode. If … … 303 303 * have an error url. 304 304 */ 305 if (aim_tlv_gettlv(tlvlist, 0x0008, 1)) 305 if (aim_tlv_gettlv(tlvlist, 0x0008, 1)) 306 306 info->errorcode = aim_tlv_get16(tlvlist, 0x0008, 1); 307 307 if (aim_tlv_gettlv(tlvlist, 0x0004, 1)) … … 329 329 * The email address attached to this account 330 330 * Not available for ICQ or @mac.com logins. 331 * If you receive this TLV, then you are allowed to use 331 * If you receive this TLV, then you are allowed to use 332 332 * family 0x0018 to check the status of your email. 333 333 * XXX - Not really true! … … 436 436 aim_frame_t fr; 437 437 aim_rxcallback_t userfunc; 438 438 439 439 fr.conn = conn; 440 440 441 441 if ((userfunc = aim_callhandler(sess, conn, 0x0017, 0x0007))) 442 442 userfunc(sess, &fr, ""); … … 448 448 * Subtype 0x0006 449 449 * 450 * In AIM 3.5 protocol, the first stage of login is to request login from the 451 * Authorizer, passing it the screen name for verification. If the name is 452 * invalid, a 0017/0003 is spit back, with the standard error contents. If 453 * valid, a 0017/0007 comes back, which is the signal to send it the main 454 * login command (0017/0002). 450 * In AIM 3.5 protocol, the first stage of login is to request login from the 451 * Authorizer, passing it the screen name for verification. If the name is 452 * invalid, a 0017/0003 is spit back, with the standard error contents. If 453 * valid, a 0017/0007 comes back, which is the signal to send it the main 454 * login command (0017/0002). 455 455 * 456 456 */ … … 460 460 aim_snacid_t snacid; 461 461 aim_tlvlist_t *tl = NULL; 462 462 463 463 if (!sess || !conn || !sn) 464 464 return -EINVAL; … … 504 504 keystr = aimbs_getstr(bs, keylen); 505 505 506 /* XXX - When GiantGrayPanda signed on AIM I got a thing asking me to register 507 * for the netscape network. This SNAC had a type 0x0058 TLV with length 10. 506 /* XXX - When GiantGrayPanda signed on AIM I got a thing asking me to register 507 * for the netscape network. This SNAC had a type 0x0058 TLV with length 10. 508 508 * Data is 0x0007 0004 3e19 ae1e 0006 0004 0000 0005 */ 509 509 … … 511 511 ret = userfunc(sess, rx, keystr); 512 512 513 free(keystr); 513 free(keystr); 514 514 515 515 return ret; -
libfaim/bart.c
r07ab1cb r7869e48 2 2 * Family 0x0010 - Server stored buddy art 3 3 * 4 * Used for storing and retrieving your cute little buddy icon 4 * Used for storing and retrieving your cute little buddy icon 5 5 * from the AIM servers. 6 6 * -
libfaim/bos.c
rcf02dd6 r7869e48 24 24 int ret = 0; 25 25 26 /* 27 * TLVs follow 26 /* 27 * TLVs follow 28 28 */ 29 29 tlvlist = aim_tlvlist_read(bs); … … 38 38 * TLV type 0x0002: Maximum number of buddies on deny list. 39 39 */ 40 if (aim_tlv_gettlv(tlvlist, 0x0002, 1)) 40 if (aim_tlv_gettlv(tlvlist, 0x0002, 1)) 41 41 maxdenies = aim_tlv_get16(tlvlist, 0x0002, 1); 42 42 … … 46 46 aim_tlvlist_free(&tlvlist); 47 47 48 return ret; 48 return ret; 49 49 } 50 50 51 /* 51 /* 52 52 * Subtype 0x0004 - Set group permisson mask. 53 53 * … … 74 74 * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again 75 75 * 76 * list should be a list of 76 * list should be a list of 77 77 * screen names in the form "Screen Name One&ScreenNameTwo&" etc. 78 78 * … … 80 80 * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD 81 81 * with only your name on it. 82 * - Allow only users on my Buddy List: Send an 82 * - Allow only users on my Buddy List: Send an 83 83 * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your 84 84 * buddy list 85 * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD 85 * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD 86 86 * with everyone listed that you want to see you. 87 * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only 87 * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only 88 88 * yourself in the list 89 89 * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with -
libfaim/bstream.c
re374dee r7869e48 6 6 7 7 #define FAIM_INTERNAL 8 #include <aim.h> 8 #include <aim.h> 9 9 10 10 faim_internal int aim_bstream_init(aim_bstream_t *bs, fu8_t *data, int len) 11 11 { 12 12 13 13 if (!bs) 14 14 return -1; … … 63 63 faim_internal fu8_t aimbs_get8(aim_bstream_t *bs) 64 64 { 65 66 if (aim_bstream_empty(bs) < 1) 67 return 0; /* XXX throw an exception */ 68 65 66 if (aim_bstream_empty(bs) < 1) 67 return 0; /* XXX throw an exception */ 68 69 69 bs->offset++; 70 70 71 71 return aimutil_get8(bs->data + bs->offset - 1); 72 72 } … … 74 74 faim_internal fu16_t aimbs_get16(aim_bstream_t *bs) 75 75 { 76 77 if (aim_bstream_empty(bs) < 2) 78 return 0; /* XXX throw an exception */ 79 76 77 if (aim_bstream_empty(bs) < 2) 78 return 0; /* XXX throw an exception */ 79 80 80 bs->offset += 2; 81 81 82 82 return aimutil_get16(bs->data + bs->offset - 2); 83 83 } … … 85 85 faim_internal fu32_t aimbs_get32(aim_bstream_t *bs) 86 86 { 87 88 if (aim_bstream_empty(bs) < 4) 89 return 0; /* XXX throw an exception */ 90 87 88 if (aim_bstream_empty(bs) < 4) 89 return 0; /* XXX throw an exception */ 90 91 91 bs->offset += 4; 92 92 93 93 return aimutil_get32(bs->data + bs->offset - 4); 94 94 } … … 96 96 faim_internal fu8_t aimbs_getle8(aim_bstream_t *bs) 97 97 { 98 99 if (aim_bstream_empty(bs) < 1) 100 return 0; /* XXX throw an exception */ 101 98 99 if (aim_bstream_empty(bs) < 1) 100 return 0; /* XXX throw an exception */ 101 102 102 bs->offset++; 103 103 104 104 return aimutil_getle8(bs->data + bs->offset - 1); 105 105 } … … 107 107 faim_internal fu16_t aimbs_getle16(aim_bstream_t *bs) 108 108 { 109 110 if (aim_bstream_empty(bs) < 2) 111 return 0; /* XXX throw an exception */ 112 109 110 if (aim_bstream_empty(bs) < 2) 111 return 0; /* XXX throw an exception */ 112 113 113 bs->offset += 2; 114 114 115 115 return aimutil_getle16(bs->data + bs->offset - 2); 116 116 } … … 118 118 faim_internal fu32_t aimbs_getle32(aim_bstream_t *bs) 119 119 { 120 121 if (aim_bstream_empty(bs) < 4) 122 return 0; /* XXX throw an exception */ 123 120 121 if (aim_bstream_empty(bs) < 4) 122 return 0; /* XXX throw an exception */ 123 124 124 bs->offset += 4; 125 125 126 126 return aimutil_getle32(bs->data + bs->offset - 4); 127 127 } -
libfaim/buddylist.c
rcf02dd6 r7869e48 31 31 int ret = 0; 32 32 33 /* 34 * TLVs follow 33 /* 34 * TLVs follow 35 35 */ 36 36 tlvlist = aim_tlvlist_read(bs); … … 48 48 * list. (This is called the "reverse list" by a certain 49 49 * other IM protocol.) 50 * 50 * 51 51 */ 52 52 if (aim_tlv_gettlv(tlvlist, 0x0002, 1)) … … 64 64 aim_tlvlist_free(&tlvlist); 65 65 66 return ret; 66 return ret; 67 67 } 68 68 … … 103 103 * buddy_list = "Screen Name One&ScreenNameTwo&"; 104 104 * 105 * XXX Clean this up. 105 * XXX Clean this up. 106 106 * 107 107 */ … … 114 114 char *tmpptr = NULL; 115 115 116 if (!buddy_list || !(localcpy = strdup(buddy_list))) 116 if (!buddy_list || !(localcpy = strdup(buddy_list))) 117 117 return -EINVAL; 118 118 … … 176 176 } 177 177 178 /* 178 /* 179 179 * Subtype 0x000b 180 180 * … … 194 194 195 195 snacid = aim_cachesnac(sess, 0x0003, 0x000b, 0x0000, NULL, 0); 196 196 197 197 aim_putsnac(&fr->data, 0x0003, 0x000b, 0x0000, snacid); 198 198 aim_putuserinfo(&fr->data, info); … … 203 203 } 204 204 205 /* 205 /* 206 206 * Subtype 0x000c 207 207 * … … 221 221 222 222 snacid = aim_cachesnac(sess, 0x0003, 0x000c, 0x0000, NULL, 0); 223 223 224 224 aim_putsnac(&fr->data, 0x0003, 0x000c, 0x0000, snacid); 225 225 aimbs_put8(&fr->data, strlen(sn)); -
libfaim/chat.c
rcf02dd6 r7869e48 5 5 6 6 #define FAIM_INTERNAL 7 #include <aim.h> 7 #include <aim.h> 8 8 9 9 #include <string.h> … … 93 93 94 94 buflen = 2 + 1 + strlen(roomname) + 2; 95 95 96 96 if (!(buf = malloc(buflen))) 97 97 return 0; … … 112 112 113 113 /* 114 * Join a room of name roomname. This is the first step to joining an 115 * already created room. It's basically a Service Request for 116 * family 0x000e, with a little added on to specify the exchange and room 114 * Join a room of name roomname. This is the first step to joining an 115 * already created room. It's basically a Service Request for 116 * family 0x000e, with a little added on to specify the exchange and room 117 117 * name. 118 118 */ … … 123 123 aim_tlvlist_t *tl = NULL; 124 124 struct chatsnacinfo csi; 125 125 126 126 if (!sess || !conn || !roomname || !strlen(roomname)) 127 127 return -EINVAL; … … 149 149 aim_tx_enqueue(sess, fr); 150 150 151 return 0; 151 return 0; 152 152 } 153 153 … … 194 194 int hdrlen; 195 195 aim_bstream_t hdrbs; 196 196 197 197 if (!sess || !conn || !sn || !msg || !roomname) 198 198 return -EINVAL; … … 239 239 * Sigh. AOL was rather inconsistent right here. So we have 240 240 * to play some minor tricks. Right inside the type 5 is some 241 * raw data, followed by a series of TLVs. 241 * raw data, followed by a series of TLVs. 242 242 * 243 243 */ … … 245 245 hdr = malloc(hdrlen); 246 246 aim_bstream_init(&hdrbs, hdr, hdrlen); 247 247 248 248 aimbs_put16(&hdrbs, 0x0000); /* Unknown! */ 249 249 aimbs_putraw(&hdrbs, ckstr, sizeof(ckstr)); /* I think... */ … … 255 255 aim_addtlvtochain_chatroom(&itl, 0x2711, exchange, roomname, instance); 256 256 aim_tlvlist_write(&hdrbs, &itl); 257 257 258 258 aim_tlvlist_add_raw(&otl, 0x0005, aim_bstream_curpos(&hdrbs), hdr); 259 259 … … 263 263 aim_tlvlist_free(&itl); 264 264 aim_tlvlist_free(&otl); 265 265 266 266 aim_tx_enqueue(sess, fr); 267 267 … … 307 307 /* 308 308 * Everything else are TLVs. 309 */ 309 */ 310 310 tlvlist = aim_tlvlist_read(bs); 311 311 … … 325 325 * Type 0x0073: Occupant list. 326 326 */ 327 if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) { 327 if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) { 328 328 int curoccupant = 0; 329 329 aim_tlv_t *tmptlv; … … 341 341 } 342 342 343 /* 343 /* 344 344 * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG) 345 345 */ … … 347 347 flags = aim_tlv_get16(tlvlist, 0x00c9, 1); 348 348 349 /* 349 /* 350 350 * Type 0x00ca: Creation time (4 bytes) 351 351 */ … … 353 353 creationtime = aim_tlv_get32(tlvlist, 0x00ca, 1); 354 354 355 /* 355 /* 356 356 * Type 0x00d1: Maximum Message Length 357 357 */ … … 359 359 maxmsglen = aim_tlv_get16(tlvlist, 0x00d1, 1); 360 360 361 /* 361 /* 362 362 * Type 0x00d2: Unknown. (2 bytes) 363 363 */ … … 365 365 unknown_d2 = aim_tlv_get16(tlvlist, 0x00d2, 1); 366 366 367 /* 367 /* 368 368 * Type 0x00d3: Room Description 369 369 */ … … 377 377 ; 378 378 379 /* 379 /* 380 380 * Type 0x00d5: Unknown. (1 byte) 381 381 */ … … 389 389 if (aim_tlv_gettlv(tlvlist, 0x000d6, 1)) 390 390 ; 391 391 392 392 /* 393 393 * Type 0x00d7: Language 1 ("en") … … 401 401 if (aim_tlv_gettlv(tlvlist, 0x000d8, 1)) 402 402 ; 403 403 404 404 /* 405 405 * Type 0x00d9: Language 2 ("en") … … 475 475 * and displays the message as normal.) 476 476 * 477 * XXX convert this to use tlvchains 477 * XXX convert this to use tlvchains 478 478 */ 479 479 faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const char *msg, int msglen) 480 { 480 { 481 481 int i; 482 482 aim_frame_t *fr; … … 539 539 * 540 540 * This could include other information... We just 541 * put in a message TLV however. 542 * 541 * put in a message TLV however. 542 * 543 543 */ 544 544 aim_tlvlist_add_frozentlvlist(&otl, 0x0005, &itl); 545 545 546 546 aim_tlvlist_write(&fr->data, &otl); 547 547 548 548 aim_tlvlist_free(&itl); 549 549 aim_tlvlist_free(&otl); 550 550 551 551 aim_tx_enqueue(sess, fr); 552 552 … … 557 557 * Subtype 0x0006 558 558 * 559 * We could probably include this in the normal ICBM parsing 559 * We could probably include this in the normal ICBM parsing 560 560 * code as channel 0x0003, however, since only the start 561 561 * would be the same, we might as well do it here. … … 577 577 * message string 578 578 * possibly others 579 * 579 * 580 580 */ 581 581 static int incomingmsg(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 582 582 { 583 583 aim_userinfo_t userinfo; 584 aim_rxcallback_t userfunc; 584 aim_rxcallback_t userfunc; 585 585 int ret = 0; 586 586 fu8_t *cookie; … … 619 619 620 620 /* 621 * Start parsing TLVs right away. 621 * Start parsing TLVs right away. 622 622 */ 623 623 otl = aim_tlvlist_read(bs); … … 637 637 638 638 /* 639 * Type 0x0001: If present, it means it was a message to the 639 * Type 0x0001: If present, it means it was a message to the 640 640 * room (as opposed to a whisper). 641 641 */ … … 655 655 itl = aim_tlvlist_read(&tbs); 656 656 657 /* 657 /* 658 658 * Type 0x0001: Message. 659 */ 659 */ 660 660 if (aim_tlv_gettlv(itl, 0x0001, 1)) 661 661 msg = aim_tlv_getstr(itl, 0x0001, 1); 662 662 663 aim_tlvlist_free(&itl); 663 aim_tlvlist_free(&itl); 664 664 } 665 665 -
libfaim/chatnav.c
rcf02dd6 r7869e48 46 46 * This looks to be a big hack. You'll note that this entire 47 47 * SNAC is just a room info structure, but the hard room name, 48 * here, is set to "create". 48 * here, is set to "create". 49 49 * 50 50 * Either this goes on the "list of questions concerning … … 57 57 aimbs_putraw(&fr->data, ck, strlen(ck)); 58 58 59 /* 59 /* 60 60 * instance 61 * 61 * 62 62 * Setting this to 0xffff apparently assigns the last instance. 63 63 * … … 95 95 tlvlist = aim_tlvlist_read(bs); 96 96 97 /* 97 /* 98 98 * Type 0x0002: Maximum concurrent rooms. 99 */ 99 */ 100 100 if (aim_tlv_gettlv(tlvlist, 0x0002, 1)) 101 101 maxrooms = aim_tlv_get8(tlvlist, 0x0002, 1); 102 102 103 /* 103 /* 104 104 * Type 0x0003: Exchange information 105 105 * 106 106 * There can be any number of these, each one 107 * representing another exchange. 108 * 107 * representing another exchange. 108 * 109 109 */ 110 110 for (curexchange = 0; ((exchangetlv = aim_tlv_gettlv(tlvlist, 0x0003, curexchange+1))); ) { … … 121 121 innerlist = aim_tlvlist_read(&tbs); 122 122 123 /* 123 /* 124 124 * Type 0x000a: Unknown. 125 125 * … … 130 130 ; 131 131 132 /* 132 /* 133 133 * Type 0x000d: Unknown. 134 134 */ … … 136 136 ; 137 137 138 /* 138 /* 139 139 * Type 0x0004: Unknown 140 140 */ … … 142 142 ; 143 143 144 /* 144 /* 145 145 * Type 0x0002: Unknown 146 146 */ … … 149 149 150 150 classperms = aim_tlv_get16(innerlist, 0x0002, 1); 151 151 152 152 faimdprintf(sess, 1, "faim: class permissions %x\n", classperms); 153 153 } … … 161 161 * 8 Occupant Peek Allowed 162 162 * 163 */ 163 */ 164 164 if (aim_tlv_gettlv(innerlist, 0x00c9, 1)) 165 165 exchanges[curexchange-1].flags = aim_tlv_get16(innerlist, 0x00c9, 1); 166 167 /* 168 * Type 0x00ca: Creation Date 166 167 /* 168 * Type 0x00ca: Creation Date 169 169 */ 170 170 if (aim_tlv_gettlv(innerlist, 0x00ca, 1)) 171 171 ; 172 172 173 173 /* 174 174 * Type 0x00d0: Mandatory Channels? … … 186 186 * Type 0x00d2: Maximum Occupancy? 187 187 */ 188 if (aim_tlv_gettlv(innerlist, 0x00d2, 1)) 188 if (aim_tlv_gettlv(innerlist, 0x00d2, 1)) 189 189 ; 190 190 … … 192 192 * Type 0x00d3: Exchange Description 193 193 */ 194 if (aim_tlv_gettlv(innerlist, 0x00d3, 1)) 194 if (aim_tlv_gettlv(innerlist, 0x00d3, 1)) 195 195 exchanges[curexchange-1].name = aim_tlv_getstr(innerlist, 0x00d3, 1); 196 196 else … … 200 200 * Type 0x00d4: Exchange Description URL 201 201 */ 202 if (aim_tlv_gettlv(innerlist, 0x00d4, 1)) 202 if (aim_tlv_gettlv(innerlist, 0x00d4, 1)) 203 203 ; 204 204 … … 209 209 * 1 Room creation allowed 210 210 * 2 Exchange creation allowed 211 * 211 * 212 212 */ 213 213 if (aim_tlv_gettlv(innerlist, 0x00d5, 1)) { … … 219 219 /* 220 220 * Type 0x00d6: Character Set (First Time) 221 */ 222 if (aim_tlv_gettlv(innerlist, 0x00d6, 1)) 221 */ 222 if (aim_tlv_gettlv(innerlist, 0x00d6, 1)) 223 223 exchanges[curexchange-1].charset1 = aim_tlv_getstr(innerlist, 0x00d6, 1); 224 224 else 225 225 exchanges[curexchange-1].charset1 = NULL; 226 226 227 227 /* 228 228 * Type 0x00d7: Language (First Time) 229 */ 230 if (aim_tlv_gettlv(innerlist, 0x00d7, 1)) 229 */ 230 if (aim_tlv_gettlv(innerlist, 0x00d7, 1)) 231 231 exchanges[curexchange-1].lang1 = aim_tlv_getstr(innerlist, 0x00d7, 1); 232 232 else … … 235 235 /* 236 236 * Type 0x00d8: Character Set (Second Time) 237 */ 238 if (aim_tlv_gettlv(innerlist, 0x00d8, 1)) 237 */ 238 if (aim_tlv_gettlv(innerlist, 0x00d8, 1)) 239 239 exchanges[curexchange-1].charset2 = aim_tlv_getstr(innerlist, 0x00d8, 1); 240 240 else … … 243 243 /* 244 244 * Type 0x00d9: Language (Second Time) 245 */ 246 if (aim_tlv_gettlv(innerlist, 0x00d9, 1)) 245 */ 246 if (aim_tlv_gettlv(innerlist, 0x00d9, 1)) 247 247 exchanges[curexchange-1].lang2 = aim_tlv_getstr(innerlist, 0x00d9, 1); 248 248 else 249 249 exchanges[curexchange-1].lang2 = NULL; 250 250 251 251 /* 252 252 * Type 0x00da: Unknown 253 253 */ 254 if (aim_tlv_gettlv(innerlist, 0x00da, 1)) 254 if (aim_tlv_gettlv(innerlist, 0x00da, 1)) 255 255 ; 256 256 … … 354 354 * Subtype 0x0009 355 355 * 356 * Since multiple things can trigger this callback, we must lookup the 356 * Since multiple things can trigger this callback, we must lookup the 357 357 * snacid to determine the original snac subtype that was called. 358 358 * … … 364 364 * Nav Short Desc = 8 365 365 * Nav Instance Info = 16 366 * And then everything is really asynchronous. There is no specific 366 * And then everything is really asynchronous. There is no specific 367 367 * attachment of a response to a create room request, for example. Creating 368 368 * the room yields no different a response than requesting the room's info. -
libfaim/conn.c
rcf02dd6 r7869e48 8 8 #define FAIM_INTERNAL 9 9 #define FAIM_NEED_CONN_INTERNAL 10 #include <aim.h> 10 #include <aim.h> 11 11 12 12 #ifndef _WIN32 … … 23 23 * In OSCAR, every connection has a set of SNAC groups associated 24 24 * with it. These are the groups that you can send over this connection 25 * without being guarenteed a "Not supported" SNAC error. 26 * 27 * The grand theory of things says that these associations transcend 25 * without being guarenteed a "Not supported" SNAC error. 26 * 27 * The grand theory of things says that these associations transcend 28 28 * what libfaim calls "connection types" (conn->type). You can probably 29 * see the elegance here, but since I want to revel in it for a bit, you 29 * see the elegance here, but since I want to revel in it for a bit, you 30 30 * get to hear it all spelled out. 31 31 * … … 33 33 * of your modules has just given you a SNAC of the group 0x0004 to send 34 34 * you. Maybe an IM destined for some twit in Greenland. So you start 35 * at the top of your connection list, looking for a connection that 35 * at the top of your connection list, looking for a connection that 36 36 * claims to support group 0x0004. You find one. Why, that neat BOS 37 37 * connection of yours can do that. So you send it on its way. … … 51 51 * that connection. One of the first things you get from this new server 52 52 * is a message saying that indeed it does support the group you were looking 53 * for. So you continue and send rate confirmation and all that. 54 * 53 * for. So you continue and send rate confirmation and all that. 54 * 55 55 * Then you remember you had that SNAC to send, and now you have a means to 56 56 * do it, and you do, and everyone is happy. Except the Greenlander, who is … … 65 65 * to make libfaim work that way. It would take a fair amount of effort, 66 66 * and probably some client API changes as well. (Whenever I don't want 67 * to do something, I just say it would change the client API. Then I 67 * to do something, I just say it would change the client API. Then I 68 68 * instantly have a couple of supporters of not doing it.) 69 69 * … … 159 159 aim_tx_cleanqueue(sess, *deadconn); 160 160 161 if ((*deadconn)->fd != -1) 161 if ((*deadconn)->fd != -1) 162 162 aim_conn_close(*deadconn); 163 163 … … 251 251 aim_conn_t *newconn; 252 252 253 if (!(newconn = malloc(sizeof(aim_conn_t)))) 253 if (!(newconn = malloc(sizeof(aim_conn_t)))) 254 254 return NULL; 255 255 memset(newconn, 0, sizeof(aim_conn_t)); … … 282 282 aim_conn_t *cur, **prev; 283 283 284 if (!deadconn || !*deadconn) 284 if (!deadconn || !*deadconn) 285 285 return; 286 286 … … 307 307 * Close (but not free) a connection. 308 308 * 309 * This leaves everything untouched except for clearing the 309 * This leaves everything untouched except for clearing the 310 310 * handler list and setting the fd to -1 (used to recognize 311 311 * dead connections). It will also remove cookies if necessary. … … 335 335 * @type: Type of connection to look for 336 336 *