Changeset 7869e48
- Timestamp:
- Jan 12, 2013, 1:43:13 PM (12 years ago)
- Children:
- e3a0d71, 4485285
- Parents:
- 4626016
- git-author:
- Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
- git-committer:
- Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
- 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 * 337 * Searches for a connection of the specified type in the 337 * Searches for a connection of the specified type in the 338 338 * specified session. Returns the first connection of that 339 339 * type found. … … 347 347 348 348 for (cur = sess->connlist; cur; cur = cur->next) { 349 if ((cur->type == type) && 349 if ((cur->type == type) && 350 350 !(cur->status & AIM_CONN_STATUS_INPROGRESS)) 351 351 break; … … 381 381 382 382 /** 383 * aim_proxyconnect - An extrememly quick and dirty SOCKS5 interface. 383 * aim_proxyconnect - An extrememly quick and dirty SOCKS5 interface. 384 384 * @sess: Session to connect 385 385 * @host: Host to connect to … … 584 584 * this function only gets called for some of that rendezvous 585 585 * crap, and not on SNAC connections, its probably okay for 586 * now. 586 * now. 587 587 * 588 588 */ … … 600 600 * Opens a new connection to the specified dest host of specified 601 601 * type, using the proxy settings if available. If @host is %NULL, 602 * the connection is allocated and returned, but no connection 602 * the connection is allocated and returned, but no connection 603 603 * is made. 604 604 * … … 625 625 } 626 626 627 /* 628 * As of 23 Jul 1999, AOL now sends the port number, preceded by a 629 * colon, in the BOS redirect. This fatally breaks all previous 627 /* 628 * As of 23 Jul 1999, AOL now sends the port number, preceded by a 629 * colon, in the BOS redirect. This fatally breaks all previous 630 630 * libfaims. Bad, bad AOL. 631 631 * 632 * We put this here to catch every case. 632 * We put this here to catch every case. 633 633 * 634 634 */ … … 662 662 * @sess: Session to search 663 663 * 664 * Returns the highest valued filed descriptor of all open 664 * Returns the highest valued filed descriptor of all open 665 665 * connections in @sess. 666 666 * … … 708 708 * Waits for a socket with data or for timeout, whichever comes first. 709 709 * See select(2). 710 * 710 * 711 711 * Return codes in *status: 712 712 * -1 error in select() (%NULL returned) … … 715 715 * 2 incoming data pending (connection with pending data returned) 716 716 * 717 */ 717 */ 718 718 faim_export aim_conn_t *aim_select(aim_session_t *sess, struct timeval *timeout, int *status) 719 719 { … … 745 745 } 746 746 747 /* 747 /* 748 748 * If we have data waiting to be sent, return 749 749 * … … 762 762 *status = 1; 763 763 return NULL; 764 } 764 } 765 765 766 766 if ((i = select(maxfd+1, &fds, &wfds, NULL, timeout))>=1) { 767 767 for (cur = sess->connlist; cur; cur = cur->next) { 768 if ((FD_ISSET(cur->fd, &fds)) || 769 ((cur->status & AIM_CONN_STATUS_INPROGRESS) && 768 if ((FD_ISSET(cur->fd, &fds)) || 769 ((cur->status & AIM_CONN_STATUS_INPROGRESS) && 770 770 FD_ISSET(cur->fd, &wfds))) { 771 771 *status = 2; … … 790 790 * 791 791 * This is my lame attempt at overcoming not understanding the rate 792 * limiting. 792 * limiting. 793 793 * 794 794 * XXX: This should really be replaced with something that scales and … … 817 817 * Call this with your SOCKS5 proxy server parameters before 818 818 * the first call to aim_newconn(). If called with all %NULL 819 * args, it will clear out a previously set proxy. 819 * args, it will clear out a previously set proxy. 820 820 * 821 821 * Set username and password to %NULL if not applicable. … … 833 833 834 834 strncpy(sess->socksproxy.server, server, sizeof(sess->socksproxy.server)); 835 if (username && strlen(username)) 835 if (username && strlen(username)) 836 836 strncpy(sess->socksproxy.username, username, sizeof(sess->socksproxy.username)); 837 837 if (password && strlen(password)) … … 850 850 851 851 /** 852 * Initializes a session structure by setting the initial values 852 * Initializes a session structure by setting the initial values 853 853 * stuff in the aim_session_t struct. 854 854 * … … 893 893 /* 894 894 * This must always be set. Default to the queue-based 895 * version for back-compatibility. 895 * version for back-compatibility. 896 896 */ 897 897 aim_tx_setenqueue(sess, AIM_TX_QUEUED, NULL); -
libfaim/email.c
rcf02dd6 r7869e48 2 2 * Family 0x0018 - Email notification 3 3 * 4 * Used for being alerted when the email address(es) associated with 5 * your screen name get new electronic-m. For normal AIM accounts, you 6 * get the email address screenname@netscape.net. AOL accounts have 4 * Used for being alerted when the email address(es) associated with 5 * your screen name get new electronic-m. For normal AIM accounts, you 6 * get the email address screenname@netscape.net. AOL accounts have 7 7 * screenname@aol.com, and can also activate a netscape.net account. 8 8 * … … 65 65 * Subtype 0x0007 - Receive information about your email account 66 66 * 67 * So I don't even know if you can have multiple 16 byte keys, 67 * So I don't even know if you can have multiple 16 byte keys, 68 68 * but this is coded so it will handle that, and handle it well. 69 * This tells you if you have unread mail or not, the URL you 70 * should use to access that mail, and the domain name for the 71 * email account (screenname@domainname.com). If this is the 72 * first 0x0007 SNAC you've received since you signed on, or if 73 * this is just a periodic status update, this will also contain 69 * This tells you if you have unread mail or not, the URL you 70 * should use to access that mail, and the domain name for the 71 * email account (screenname@domainname.com). If this is the 72 * first 0x0007 SNAC you've received since you signed on, or if 73 * this is just a periodic status update, this will also contain 74 74 * the number of unread emails that you have. 75 75 */ … … 131 131 alertitle = aim_tlv_getstr(tlvlist, 0x0005, 1); 132 132 alerturl = aim_tlv_getstr(tlvlist, 0x000d, 1); 133 133 134 134 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 135 135 ret = userfunc(sess, rx, new, havenewmail, alertitle, (alerturl ? alerturl + 2 : NULL)); -
libfaim/faimconfig.h
r5e53c4a r7869e48 14 14 * ICBMs and comparing them to incoming errors. However, 15 15 * its a helluvalot of overhead for something that should 16 * rarely happen. 16 * rarely happen. 17 17 * 18 18 * Default: defined. This is now defined by default 19 * because it should be stable and its not too bad. 19 * because it should be stable and its not too bad. 20 20 * And Josh wanted it. 21 21 * … … 24 24 25 25 /* 26 * Default Authorizer server name and TCP port for the OSCAR farm. 26 * Default Authorizer server name and TCP port for the OSCAR farm. 27 27 * 28 28 * You shouldn't need to change this unless you're writing 29 * your own server. 29 * your own server. 30 30 * 31 31 * Note that only one server is needed to start the whole -
libfaim/ft.c
rfa8f439 r7869e48 3 3 * (ODC is also referred to as DirectIM and IM Image.) 4 4 * 5 * There are a few static helper functions at the top, then 5 * There are a few static helper functions at the top, then 6 6 * ODC stuff, then ft stuff. 7 7 * 8 * I feel like this is a good place to explain OFT, so I'm going to 9 * do just that. Each OFT packet has a header type. I guess this 10 * is pretty similar to the subtype of a SNAC packet. The type 11 * basically tells the other client the meaning of the OFT packet. 12 * There are two distinct types of file transfer, which I usually 13 * call "sendfile" and "getfile." Sendfile is when you send a file 14 * to another AIM user. Getfile is when you share a group of files, 8 * I feel like this is a good place to explain OFT, so I'm going to 9 * do just that. Each OFT packet has a header type. I guess this 10 * is pretty similar to the subtype of a SNAC packet. The type 11 * basically tells the other client the meaning of the OFT packet. 12 * There are two distinct types of file transfer, which I usually 13 * call "sendfile" and "getfile." Sendfile is when you send a file 14 * to another AIM user. Getfile is when you share a group of files, 15 15 * and other users request that you send them the files. 16 16 * 17 17 * A typical sendfile file transfer goes like this: 18 * 1) Sender sends a channel 2 ICBM telling the other user that 19 * we want to send them a file. At the same time, we open a 20 * listener socket (this should be done before sending the 21 * ICBM) on some port, and wait for them to connect to us. 22 * The ICBM we sent should contain our IP address and the port 18 * 1) Sender sends a channel 2 ICBM telling the other user that 19 * we want to send them a file. At the same time, we open a 20 * listener socket (this should be done before sending the 21 * ICBM) on some port, and wait for them to connect to us. 22 * The ICBM we sent should contain our IP address and the port 23 23 * number that we're listening on. 24 * 2) The receiver connects to the sender on the given IP address 25 * and port. After the connection is established, the receiver 24 * 2) The receiver connects to the sender on the given IP address 25 * and port. After the connection is established, the receiver 26 26 * sends an ICBM signifying that we are ready and waiting. 27 * 3) The sender sends an OFT PROMPT message over the OFT 27 * 3) The sender sends an OFT PROMPT message over the OFT 28 28 * connection. 29 * 4) The receiver of the file sends back an exact copy of this 30 * OFT packet, except the cookie is filled in with the cookie 31 * from the ICBM. I think this might be an attempt to verify 32 * that the user that is connected is actually the guy that 29 * 4) The receiver of the file sends back an exact copy of this 30 * OFT packet, except the cookie is filled in with the cookie 31 * from the ICBM. I think this might be an attempt to verify 32 * that the user that is connected is actually the guy that 33 33 * we sent the ICBM to. Oh, I've been calling this the ACK. 34 * 5) The sender starts sending raw data across the connection 34 * 5) The sender starts sending raw data across the connection 35 35 * until the entire file has been sent. 36 * 6) The receiver knows the file is finished because the sender 37 * sent the file size in an earlier OFT packet. So then the 38 * receiver sends the DONE thingy (after filling in the 36 * 6) The receiver knows the file is finished because the sender 37 * sent the file size in an earlier OFT packet. So then the 38 * receiver sends the DONE thingy (after filling in the 39 39 * "received" checksum and size) and closes the connection. 40 40 */ … … 102 102 * Calculate oft checksum of buffer 103 103 * 104 * Prevcheck should be 0xFFFF0000 when starting a checksum of a file. The 105 * checksum is kind of a rolling checksum thing, so each time you get bytes 106 * of a file you just call this puppy and it updates the checksum. You can 107 * calculate the checksum of an entire file by calling this in a while or a 104 * Prevcheck should be 0xFFFF0000 when starting a checksum of a file. The 105 * checksum is kind of a rolling checksum thing, so each time you get bytes 106 * of a file you just call this puppy and it updates the checksum. You can 107 * calculate the checksum of an entire file by calling this in a while or a 108 108 * for loop, or something. 109 109 * 110 * Thanks to Graham Booker for providing this improved checksum routine, 111 * which is simpler and should be more accurate than Josh Myer's original 110 * Thanks to Graham Booker for providing this improved checksum routine, 111 * which is simpler and should be more accurate than Josh Myer's original 112 112 * code. -- wtm 113 113 * 114 * This algorithim works every time I have tried it. The other fails 115 * sometimes. So, AOL who thought this up? It has got to be the weirdest 114 * This algorithim works every time I have tried it. The other fails 115 * sometimes. So, AOL who thought this up? It has got to be the weirdest 116 116 * checksum I have ever seen. 117 117 * … … 134 134 check -= val; 135 135 /* 136 * The following appears to be necessary.... It happens 136 * The following appears to be necessary.... It happens 137 137 * every once in a while and the checksum doesn't fail. 138 138 */ … … 164 164 * Create a listening socket on a given port. 165 165 * 166 * XXX - Give the client author the responsibility of setting up a 167 * listener, then we no longer have a libfaim problem with broken 166 * XXX - Give the client author the responsibility of setting up a 167 * listener, then we no longer have a libfaim problem with broken 168 168 * solaris *innocent smile* -- jbm 169 169 * … … 187 187 perror("getaddrinfo"); 188 188 return -1; 189 } 189 } 190 190 ressave = res; 191 do { 191 do { 192 192 listenfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); 193 193 if (listenfd < 0) … … 313 313 * @param sess The session. 314 314 * @param conn The already-connected ODC connection. 315 * @param typing If 0x0002, sends a "typing" message, 0x0001 sends "typed," and 315 * @param typing If 0x0002, sends a "typing" message, 0x0001 sends "typed," and 316 316 * 0x0000 sends "stopped." 317 317 * @return Return 0 if no errors, otherwise return the error number. … … 386 386 * Send client-to-client IM over an established direct connection. 387 387 * Call this just like you would aim_send_im, to send a directim. 388 * 388 * 389 389 * @param sess The session. 390 390 * @param conn The already-connected ODC connection. … … 453 453 /* end of hdr2 */ 454 454 455 #if 0 /* XXX - this is how you send buddy icon info... */ 455 #if 0 /* XXX - this is how you send buddy icon info... */ 456 456 aimbs_put16(hdrbs, 0x0008); 457 457 aimbs_put16(hdrbs, 0x000c); … … 472 472 /** 473 473 * Get the screen name of the peer of a direct connection. 474 * 474 * 475 475 * @param conn The ODC connection. 476 476 * @return The screen name of the dude, or NULL if there was an anomaly. … … 483 483 return NULL; 484 484 485 if ((conn->type != AIM_CONN_TYPE_RENDEZVOUS) || 485 if ((conn->type != AIM_CONN_TYPE_RENDEZVOUS) || 486 486 (conn->subtype != AIM_CONN_SUBTYPE_OFT_DIRECTIM)) 487 487 return NULL; … … 497 497 * @param sess The session. 498 498 * @param sn The screen name of the buddy whose direct connection you want to find. 499 * @return The conn for the direct connection with the given buddy, or NULL if no 499 * @return The conn for the direct connection with the given buddy, or NULL if no 500 500 * connection was found. 501 501 */ … … 522 522 * For those times when we want to open up the direct connection channel ourselves. 523 523 * 524 * You'll want to set up some kind of watcher on this socket. 525 * When the state changes, call aim_handlerendconnection with 526 * the connection returned by this. aim_handlerendconnection 524 * You'll want to set up some kind of watcher on this socket. 525 * When the state changes, call aim_handlerendconnection with 526 * the connection returned by this. aim_handlerendconnection 527 527 * will accept the pending connection and stop listening. 528 528 * … … 586 586 * This is a wrapper for aim_newconn. 587 587 * 588 * If addr is NULL, the socket is not created, but the connection is 588 * If addr is NULL, the socket is not created, but the connection is 589 589 * allocated and setup to connect. 590 590 * … … 683 683 if (payloadlength - recvd >= 1024) 684 684 i = aim_recv(conn->fd, &msg[recvd], 1024); 685 else 685 else 686 686 i = aim_recv(conn->fd, &msg[recvd], payloadlength - recvd); 687 687 if (i <= 0) { … … 694 694 ret = userfunc(sess, &fr, snptr, (double)recvd / payloadlength); 695 695 } 696 696 697 697 if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING))) 698 698 ret = userfunc(sess, &fr, snptr, msg, payloadlength, encoding, isawaymsg); … … 746 746 747 747 /** 748 * Remove the given oft_info struct from the oft_info linked list, and 748 * Remove the given oft_info struct from the oft_info linked list, and 749 749 * then free its memory. 750 750 * … … 781 781 * Creates a listener socket so the other dude can connect to us. 782 782 * 783 * You'll want to set up some kind of watcher on this socket. 784 * When the state changes, call aim_handlerendconnection with 785 * the connection returned by this. aim_handlerendconnection 783 * You'll want to set up some kind of watcher on this socket. 784 * When the state changes, call aim_handlerendconnection with 785 * the connection returned by this. aim_handlerendconnection 786 786 * will accept the pending connection and stop listening. 787 787 * 788 788 * @param sess The session. 789 * @param oft_info File transfer information associated with this 789 * @param oft_info File transfer information associated with this 790 790 * connection. 791 791 * @return Return 0 if no errors, otherwise return the error number. … … 855 855 856 856 return fh; 857 } 857 } 858 858 859 859 /** … … 865 865 */ 866 866 static int aim_oft_buildheader(aim_bstream_t *bs, struct aim_fileheader_t *fh) 867 { 867 { 868 868 fu8_t *hdr; 869 869 … … 910 910 * @param sess The session. 911 911 * @param type The subtype of the OFT packet we're sending. 912 * @param oft_info The aim_oft_info struct with the connection and OFT 912 * @param oft_info The aim_oft_info struct with the connection and OFT 913 913 * info we're sending. 914 914 * @return Return 0 if no errors, otherwise return the error number. … … 923 923 #if 0 924 924 /* 925 * If you are receiving a file, the cookie should be null, if you are sending a 926 * file, the cookie should be the same as the one used in the ICBM negotiation 925 * If you are receiving a file, the cookie should be null, if you are sending a 926 * file, the cookie should be the same as the one used in the ICBM negotiation 927 927 * SNACs. 928 928 */ … … 956 956 957 957 /** 958 * Handle incoming data on a rendezvous connection. This is analogous to the 959 * consumesnac function in rxhandlers.c, and I really think this should probably 958 * Handle incoming data on a rendezvous connection. This is analogous to the 959 * consumesnac function in rxhandlers.c, and I really think this should probably 960 960 * be in rxhandlers.c as well, but I haven't finished cleaning everything up yet. 961 961 * 962 962 * @param sess The session. 963 963 * @param fr The frame allocated for the incoming data. 964 * @return Return 0 if the packet was handled correctly, otherwise return the 964 * @return Return 0 if the packet was handled correctly, otherwise return the 965 965 * error number. 966 966 */ -
libfaim/icq.c
rcf02dd6 r7869e48 110 110 * 111 111 * @param sess The oscar session 112 * @param passwd The new password. If this is longer than 8 characters it 112 * @param passwd The new password. If this is longer than 8 characters it 113 113 * will be truncated. 114 114 * @return Return 0 if no errors, otherwise return the error number. … … 322 322 323 323 /* 324 * Send an SMS message. This is the non-US way. The US-way is to IM 324 * Send an SMS message. This is the non-US way. The US-way is to IM 325 325 * their cell phone number (+19195551234). 326 326 * … … 336 336 * </icq_sms_message> 337 337 * 338 * Yeah hi Peter, whaaaat's happening. If there's any way to use 338 * Yeah hi Peter, whaaaat's happening. If there's any way to use 339 339 * a codepage other than 1252 that would be great. Thaaaanks. 340 340 */ -
libfaim/im.c
rcf02dd6 r7869e48 9 9 * is used for negotiating "rendezvous". These transactions end in 10 10 * something more complex happening, such as a chat invitation, or 11 * a file transfer. Channel 3 is used for chat messages (not in 12 * the same family as these channels). Channel 4 is used for 13 * various ICQ messages. Examples are normal messages, URLs, and 11 * a file transfer. Channel 3 is used for chat messages (not in 12 * the same family as these channels). Channel 4 is used for 13 * various ICQ messages. Examples are normal messages, URLs, and 14 14 * old-style authorization. 15 15 * … … 19 19 * use of this field. 20 20 * 21 * TODO: Split this up into an im.c file an an icbm.c file. It 21 * TODO: Split this up into an im.c file an an icbm.c file. It 22 22 * will be beautiful, you'll see. 23 23 * … … 35 35 36 36 /** 37 * Add a standard ICBM header to the given bstream with the given 37 * Add a standard ICBM header to the given bstream with the given 38 38 * information. 39 39 * … … 64 64 * Heres the current collection: 65 65 * 0501 0003 0101 0101 01 AOL Mobile Communicator, WinAIM 1.0.414 66 * 0501 0003 0101 0201 01 WinAIM 2.0.847, 2.1.1187, 3.0.1464, 66 * 0501 0003 0101 0201 01 WinAIM 2.0.847, 2.1.1187, 3.0.1464, 67 67 * 4.3.2229, 4.4.2286 68 68 * 0501 0004 0101 0102 0101 WinAIM 4.1.2010, libfaim (right here) … … 84 84 } fingerprints[] = { 85 85 /* AOL Mobile Communicator, WinAIM 1.0.414 */ 86 { AIM_CLIENTTYPE_MC, 86 { AIM_CLIENTTYPE_MC, 87 87 3, {0x01, 0x01, 0x01}}, 88 88 89 89 /* WinAIM 2.0.847, 2.1.1187, 3.0.1464, 4.3.2229, 4.4.2286 */ 90 { AIM_CLIENTTYPE_WINAIM, 90 { AIM_CLIENTTYPE_WINAIM, 91 91 3, {0x01, 0x01, 0x02}}, 92 92 … … 116 116 } 117 117 118 /** 118 /** 119 119 * Subtype 0x0002 - Set ICBM parameters. 120 120 * 121 121 * I definitly recommend sending this. If you don't, you'll be stuck 122 122 * with the rather unreasonable defaults. 123 * 123 * 124 124 */ 125 125 faim_export int aim_im_setparams(aim_session_t *sess, struct aim_icbmparameters *params) … … 145 145 146 146 /* These are all read-write */ 147 aimbs_put32(&fr->data, params->flags); 147 aimbs_put32(&fr->data, params->flags); 148 148 aimbs_put16(&fr->data, params->maxmsglen); 149 aimbs_put16(&fr->data, params->maxsenderwarn); 150 aimbs_put16(&fr->data, params->maxrecverwarn); 149 aimbs_put16(&fr->data, params->maxsenderwarn); 150 aimbs_put16(&fr->data, params->maxrecverwarn); 151 151 aimbs_put32(&fr->data, params->minmsginterval); 152 152 … … 185 185 params.maxrecverwarn = aimbs_get16(bs); 186 186 params.minmsginterval = aimbs_get32(bs); 187 187 188 188 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 189 189 return userfunc(sess, rx, ¶ms); … … 193 193 194 194 /** 195 * Subtype 0x0006 - Send an ICBM (instant message). 195 * Subtype 0x0006 - Send an ICBM (instant message). 196 196 * 197 197 * … … 207 207 * what you're doing. 208 208 * AIM_IMFLAGS_ISO_8859_1 -- The message contains the ASCII8 subset 209 * known as ISO-8859-1. 209 * known as ISO-8859-1. 210 210 * 211 211 * Generally, you should use the lowest encoding possible to send 212 212 * your message. If you only use basic punctuation and the generic 213 213 * Latin alphabet, use ASCII7 (no flags). If you happen to use non-ASCII7 214 * characters, but they are all clearly defined in ISO-8859-1, then 214 * characters, but they are all clearly defined in ISO-8859-1, then 215 215 * use that. Keep in mind that not all characters in the PC ASCII8 216 216 * character set are defined in the ISO standard. For those cases (most … … 224 224 * of the clients I use can parse those messages (and besides that, 225 225 * wchars are difficult and non-portable to handle in most UNIX environments). 226 * If you really need to include special characters, use the HTML UNICODE 227 * entities. These are of the form ߪ where 2026 is the hex 228 * representation of the UNICODE index (in this case, UNICODE 226 * If you really need to include special characters, use the HTML UNICODE 227 * entities. These are of the form ߪ where 2026 is the hex 228 * representation of the UNICODE index (in this case, UNICODE 229 229 * "Horizontal Ellipsis", or 133 in in ASCII8). 230 230 * … … 232 232 * in all of libfaim, it is written with performance in mind. As such, 233 233 * it is not as clear as it could be in respect to how this message is 234 * supposed to be layed out. Most obviously, tlvlists should be used 235 * instead of writing out the bytes manually. 234 * supposed to be layed out. Most obviously, tlvlists should be used 235 * instead of writing out the bytes manually. 236 236 * 237 237 * XXX - more precise verification that we never send SNACs larger than 8192 … … 289 289 return -ENOMEM; 290 290 291 /* XXX - should be optional */ 291 /* XXX - should be optional */ 292 292 snacid = aim_cachesnac(sess, 0x0004, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); 293 293 aim_putsnac(&fr->data, 0x0004, 0x0006, 0x0000, snacid); 294 294 295 /* 295 /* 296 296 * Generate a random message cookie 297 297 * 298 * We could cache these like we do SNAC IDs. (In fact, it 299 * might be a good idea.) In the message error functions, 300 * the 8byte message cookie is returned as well as the 298 * We could cache these like we do SNAC IDs. (In fact, it 299 * might be a good idea.) In the message error functions, 300 * the 8byte message cookie is returned as well as the 301 301 * SNAC ID. 302 302 * … … 367 367 /* 368 368 * Set the I HAVE A REALLY PURTY ICON flag. 369 * XXX - This should really only be sent on initial 369 * XXX - This should really only be sent on initial 370 370 * IMs and when you change your icon. 371 371 */ … … 397 397 398 398 /* 399 * Simple wrapper for aim_im_sendch1_ext() 399 * Simple wrapper for aim_im_sendch1_ext() 400 400 * 401 401 * You cannot use aim_send_im if you need the HASICON flag. You must … … 505 505 * You'd think this would be in icq.c, but, well, I'm trying to stick with 506 506 * the one-group-per-file scheme as much as possible. This could easily 507 * be an exception, since Rendezvous IMs are external of the Oscar core, 507 * be an exception, since Rendezvous IMs are external of the Oscar core, 508 508 * and therefore are undefined. Really I just need to think of a good way to 509 509 * make an interface similar to what AOL actually uses. But I'm not using COM. … … 613 613 aim_putsnac(&fr->data, 0x0004, 0x0006, 0x0000, snacid); 614 614 615 /* 616 * Generate a random message cookie 617 * 618 * This cookie needs to be alphanumeric and NULL-terminated to be 615 /* 616 * Generate a random message cookie 617 * 618 * This cookie needs to be alphanumeric and NULL-terminated to be 619 619 * TOC-compatible. 620 620 * … … 646 646 aim_tlvlist_add_16(&itl, 0x0005, port); 647 647 aim_tlvlist_add_noval(&itl, 0x000f); 648 648 649 649 aim_tlvlist_write(&hdrbs, &itl); 650 650 … … 833 833 * @param sess The oscar session. 834 834 * @param sn The UIN of the user of whom you wish to request info. 835 * @param type The type of info you wish to request. This should be the current 835 * @param type The type of info you wish to request. This should be the current 836 836 * state of the user, as one of the AIM_ICQ_STATE_* defines. 837 837 * @return Return 0 if no errors, otherwise return the error number. … … 931 931 * Subtype 0x0006 - Send an ICQ-esque ICBM. 932 932 * 933 * This can be used to send an ICQ authorization reply (deny or grant). It is the "old way." 934 * The new way is to use SSI. I like the new way a lot better. This seems like such a hack, 935 * mostly because it's in network byte order. Figuring this stuff out sometimes takes a while, 936 * but thats ok, because it gives me time to try to figure out what kind of drugs the AOL people 933 * This can be used to send an ICQ authorization reply (deny or grant). It is the "old way." 934 * The new way is to use SSI. I like the new way a lot better. This seems like such a hack, 935 * mostly because it's in network byte order. Figuring this stuff out sometimes takes a while, 936 * but thats ok, because it gives me time to try to figure out what kind of drugs the AOL people 937 937 * were taking when they merged the two protocols. 938 938 * … … 1073 1073 * 1074 1074 * Not only do AIM ICBM's support multiple channels. Not only do they 1075 * support multiple character sets. But they support multiple character 1075 * support multiple character sets. But they support multiple character 1076 1076 * sets / encodings within the same ICBM. 1077 1077 * … … 1079 1079 * seem utterly unnecessary by today's standards. In fact, there is only 1080 1080 * one client still in popular use that still uses this method: AOL for the 1081 * Macintosh, Version 5.0. Obscure, yes, I know. 1081 * Macintosh, Version 5.0. Obscure, yes, I know. 1082 1082 * 1083 1083 * In modern (non-"legacy") clients, if the user tries to send a character … … 1087 1087 * Multipart messages prevent this wasted space by allowing the client to 1088 1088 * only send the characters in UNICODE that need to be sent that way, and 1089 * the rest of the message can be sent in whatever the native character 1089 * the rest of the message can be sent in whatever the native character 1090 1090 * set is (probably ASCII). 1091 1091 * … … 1116 1116 static int mpmsg_addsection(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, fu8_t *data, fu16_t datalen) 1117 1117 { 1118 aim_mpmsg_section_t *sec; 1119 1118 aim_mpmsg_section_t *sec; 1119 1120 1120 if (!(sec = malloc(sizeof(aim_mpmsg_section_t)))) 1121 1121 return -1; … … 1163 1163 fu8_t *dup; 1164 1164 1165 if (!(dup = strdup(ascii))) 1165 if (!(dup = strdup(ascii))) 1166 1166 return -1; 1167 1167 … … 1193 1193 return -1; 1194 1194 } 1195 1195 1196 1196 return 0; 1197 1197 } … … 1203 1203 for (cur = mpm->parts; cur; ) { 1204 1204 aim_mpmsg_section_t *tmp; 1205 1205 1206 1206 tmp = cur->next; 1207 1207 free(cur->data); … … 1209 1209 cur = tmp; 1210 1210 } 1211 1211 1212 1212 mpm->numparts = 0; 1213 1213 mpm->parts = NULL; … … 1217 1217 1218 1218 /* 1219 * Start by building the multipart structures, then pick the first 1219 * Start by building the multipart structures, then pick the first 1220 1220 * human-readable section and stuff it into args->msg so no one gets 1221 1221 * suspicious. … … 1405 1405 * You really shouldn't advertise a zero-length icon 1406 1406 * anyway. 1407 * 1407 * 1408 1408 */ 1409 1409 if (args.iconlen) … … 1552 1552 1553 1553 /* 1554 * The relationship between AIM_CAPS_ICQSERVERRELAY and AIM_CAPS_ICQRTF is 1554 * The relationship between AIM_CAPS_ICQSERVERRELAY and AIM_CAPS_ICQRTF is 1555 1555 * kind of odd. This sends the client ICQRTF since that is all that I've seen 1556 1556 * SERVERRELAY used for. … … 1571 1571 1572 1572 msgtype = aimbs_getle16(servdata); 1573 1573 1574 1574 anslen = aimbs_getle32(servdata); 1575 1575 aim_bstream_advance(servdata, anslen); … … 1602 1602 args->destructor = (void *)incomingim_ch2_sendfile_free; 1603 1603 1604 /* Maybe there is a better way to tell what kind of sendfile 1604 /* Maybe there is a better way to tell what kind of sendfile 1605 1605 * this is? Maybe TLV t(000a)? */ 1606 1606 if (servdata) { /* Someone is sending us a file */ … … 1613 1613 1614 1614 /* 1615 * I hope to God I'm right when I guess that there is a 1616 * 32 char max filename length for single files. I think 1617 * OFT tends to do that. Gotta love inconsistency. I saw 1615 * I hope to God I'm right when I guess that there is a 1616 * 32 char max filename length for single files. I think 1617 * OFT tends to do that. Gotta love inconsistency. I saw 1618 1618 * a 26 byte filename? 1619 1619 */ 1620 1620 /* AAA - create an aimbs_getnullstr function (don't anymore)(maybe) */ 1621 /* Use an inelegant way of getting the null-terminated filename, 1621 /* Use an inelegant way of getting the null-terminated filename, 1622 1622 * since there's no easy bstream routine. */ 1623 1623 for (flen = 0; aimbs_get8(servdata); flen++); … … 1625 1625 args->info.sendfile.filename = aimbs_getstr(servdata, flen); 1626 1626 1627 /* There is sometimes more after the null-terminated filename, 1627 /* There is sometimes more after the null-terminated filename, 1628 1628 * but I'm unsure of its format. */ 1629 1629 /* I don't believe him. */ … … 1652 1652 1653 1653 /* 1654 * There's another block of TLVs embedded in the type 5 here. 1654 * There's another block of TLVs embedded in the type 5 here. 1655 1655 */ 1656 1656 block1 = aim_tlv_gettlv(tlvlist, 0x0005, 1); … … 1661 1661 * 1662 1662 * 0 is a request, 1 is a cancel, 2 is an accept 1663 */ 1663 */ 1664 1664 args.status = aimbs_get16(&bbs); 1665 1665 … … 1668 1668 */ 1669 1669 cookie2 = aimbs_getraw(&bbs, 8); 1670 if (memcmp(cookie, cookie2, 8) != 0) 1670 if (memcmp(cookie, cookie2, 8) != 0) 1671 1671 faimdprintf(sess, 0, "rend: warning cookies don't match!\n"); 1672 1672 memcpy(args.cookie, cookie2, 8); … … 1679 1679 args.reqclass = aim_locate_getcaps(sess, &bbs, 0x10); 1680 1680 1681 /* 1681 /* 1682 1682 * What follows may be TLVs or nothing, depending on the 1683 1683 * purpose of the message. … … 1761 1761 if (aim_tlv_gettlv(list2, 0x000d, 1)) 1762 1762 args.encoding = aim_tlv_getstr(list2, 0x000d, 1); 1763 1763 1764 1764 /* 1765 1765 * Language. … … 1896 1896 * Channel ID. 1897 1897 * 1898 * Channel 0x0001 is the message channel. It is 1898 * Channel 0x0001 is the message channel. It is 1899 1899 * used to send basic ICBMs. 1900 1900 * … … 1905 1905 * Channel 0x0003 is used for chat messages. 1906 1906 * 1907 * Channel 0x0004 is used for ICQ authorization, or 1907 * Channel 0x0004 is used for ICQ authorization, or 1908 1908 * possibly any system notice. 1909 1909 * … … 1918 1918 * userinfo block contains the number of TLVs that contain user 1919 1919 * information, the rest are not even though there is no seperation. 1920 * You can start reading the message TLVs after aim_info_extract() 1920 * You can start reading the message TLVs after aim_info_extract() 1921 1921 * parses out the standard userinfo block. 1922 1922 * … … 1924 1924 * userinfo block and the rest of the message, however there should 1925 1925 * never be two TLVs of the same type in one block. 1926 * 1926 * 1927 1927 */ 1928 1928 aim_info_extract(sess, bs, &userinfo); … … 1943 1943 1944 1944 /* 1945 * Read block of TLVs (not including the userinfo data). All 1945 * Read block of TLVs (not including the userinfo data). All 1946 1946 * further data is derived from what is parsed here. 1947 1947 */ … … 1970 1970 /* 1971 1971 * Subtype 0x0008 - Send a warning to sn. 1972 * 1972 * 1973 1973 * Flags: 1974 1974 * AIM_WARN_ANON Send as an anonymous (doesn't count as much) 1975 1975 * 1976 * returns -1 on error (couldn't alloc packet), 0 on success. 1976 * returns -1 on error (couldn't alloc packet), 0 on success. 1977 1977 * 1978 1978 */ … … 1991 1991 aim_putsnac(&fr->data, 0x0004, 0x0008, 0x0000, snacid); 1992 1992 1993 aimbs_put16(&fr->data, (flags & AIM_WARN_ANON) ? 0x0001 : 0x0000); 1993 aimbs_put16(&fr->data, (flags & AIM_WARN_ANON) ? 0x0001 : 0x0000); 1994 1994 aimbs_put8(&fr->data, strlen(sn)); 1995 1995 aimbs_putraw(&fr->data, sn, strlen(sn)); … … 2008 2008 aim_userinfo_t userinfo; 2009 2009 2010 while (aim_bstream_empty(bs)) { 2010 while (aim_bstream_empty(bs)) { 2011 2011 2012 2012 channel = aimbs_get16(bs); … … 2031 2031 * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer" 2032 2032 * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" 2033 * 2033 * 2034 2034 */ 2035 2035 faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const char *cookie, fu16_t code) … … 2039 2039 aim_snacid_t snacid; 2040 2040 aim_tlvlist_t *tl = NULL; 2041 2041 2042 2042 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004))) 2043 2043 return -EINVAL; … … 2048 2048 snacid = aim_cachesnac(sess, 0x0004, 0x000b, 0x0000, NULL, 0); 2049 2049 aim_putsnac(&fr->data, 0x0004, 0x000b, 0x0000, snacid); 2050 2050 2051 2051 aimbs_putraw(&fr->data, cookie, 8); 2052 2052 … … 2153 2153 * Subtype 0x000c - Receive an ack after sending an ICBM. 2154 2154 * 2155 * You have to have send the message with the AIM_IMFLAGS_ACK flag set 2156 * (TLV t(0003)). The ack contains the ICBM header of the message you 2155 * You have to have send the message with the AIM_IMFLAGS_ACK flag set 2156 * (TLV t(0003)). The ack contains the ICBM header of the message you 2157 2157 * sent. 2158 2158 * … … 2182 2182 * Subtype 0x0014 - Send a mini typing notification (mtn) packet. 2183 2183 * 2184 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, 2184 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, 2185 2185 * and Gaim 0.60 and newer. 2186 2186 * … … 2237 2237 * Subtype 0x0014 - Receive a mini typing notification (mtn) packet. 2238 2238 * 2239 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, 2239 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, 2240 2240 * and Gaim 0.60 and newer. 2241 2241 * -
libfaim/locate.c
r6e3980e r7869e48 3 3 * 4 4 * The functions here are responsible for requesting and parsing information- 5 * gathering SNACs. Or something like that. This family contains the SNACs 5 * gathering SNACs. Or something like that. This family contains the SNACs 6 6 * for getting and setting info, away messages, directory profile thingy, etc. 7 7 */ … … 14 14 15 15 /* 16 * Capability blocks. 16 * Capability blocks. 17 17 * 18 18 * These are CLSIDs. They should actually be of the form: … … 36 36 */ 37 37 {AIM_CAPS_ICHAT, 38 {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 38 {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 39 39 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 40 40 41 41 {AIM_CAPS_SECUREIM, 42 {0x09, 0x46, 0x00, 0x01, 0x4c, 0x7f, 0x11, 0xd1, 42 {0x09, 0x46, 0x00, 0x01, 0x4c, 0x7f, 0x11, 0xd1, 43 43 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 44 44 45 45 {AIM_CAPS_VIDEO, 46 {0x09, 0x46, 0x01, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 47 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 48 49 /* 50 * Not really sure about this one. In an email from 51 * 26 Sep 2003, Matthew Sachs suggested that, "this 46 {0x09, 0x46, 0x01, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 47 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 48 49 /* 50 * Not really sure about this one. In an email from 51 * 26 Sep 2003, Matthew Sachs suggested that, "this 52 52 * is probably the capability for the SMS features." 53 53 */ 54 54 {AIM_CAPS_SMS, 55 {0x09, 0x46, 0x01, 0xff, 0x4c, 0x7f, 0x11, 0xd1, 55 {0x09, 0x46, 0x01, 0xff, 0x4c, 0x7f, 0x11, 0xd1, 56 56 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 57 57 58 58 {AIM_CAPS_GENERICUNKNOWN, 59 {0x09, 0x46, 0xf0, 0x03, 0x4c, 0x7f, 0x11, 0xd1, 59 {0x09, 0x46, 0xf0, 0x03, 0x4c, 0x7f, 0x11, 0xd1, 60 60 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 61 61 62 62 {AIM_CAPS_GENERICUNKNOWN, 63 {0x09, 0x46, 0xf0, 0x04, 0x4c, 0x7f, 0x11, 0xd1, 63 {0x09, 0x46, 0xf0, 0x04, 0x4c, 0x7f, 0x11, 0xd1, 64 64 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 65 65 66 66 {AIM_CAPS_GENERICUNKNOWN, 67 {0x09, 0x46, 0xf0, 0x05, 0x4c, 0x7f, 0x11, 0xd1, 67 {0x09, 0x46, 0xf0, 0x05, 0x4c, 0x7f, 0x11, 0xd1, 68 68 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 69 69 70 70 {AIM_CAPS_HIPTOP, 71 {0x09, 0x46, 0x13, 0x23, 0x4c, 0x7f, 0x11, 0xd1, 71 {0x09, 0x46, 0x13, 0x23, 0x4c, 0x7f, 0x11, 0xd1, 72 72 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 73 73 74 74 {AIM_CAPS_VOICE, 75 {0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1, 75 {0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1, 76 76 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 77 77 78 78 {AIM_CAPS_SENDFILE, 79 {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, 79 {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, 80 80 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 81 81 82 82 {AIM_CAPS_ICQ_DIRECT, 83 {0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1, 83 {0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1, 84 84 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 85 85 86 86 {AIM_CAPS_DIRECTIM, 87 {0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1, 87 {0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1, 88 88 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 89 89 90 90 {AIM_CAPS_BUDDYICON, 91 {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1, 91 {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1, 92 92 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 93 93 … … 108 108 109 109 /* 110 * Indeed, there are two of these. The former appears to be correct, 111 * but in some versions of winaim, the second one is set. Either they 112 * forgot to fix endianness, or they made a typo. It really doesn't 110 * Indeed, there are two of these. The former appears to be correct, 111 * but in some versions of winaim, the second one is set. Either they 112 * forgot to fix endianness, or they made a typo. It really doesn't 113 113 * matter which. 114 114 */ … … 125 125 126 126 /* 127 * Setting this lets AIM users receive messages from ICQ users, and ICQ 128 * users receive messages from AIM users. It also lets ICQ users show 129 * up in buddy lists for AIM users, and AIM users show up in buddy lists 130 * for ICQ users. And ICQ privacy/invisibility acts like AIM privacy, 131 * in that if you add a user to your deny list, you will not be able to 132 * see them as online (previous you could still see them, but they 127 * Setting this lets AIM users receive messages from ICQ users, and ICQ 128 * users receive messages from AIM users. It also lets ICQ users show 129 * up in buddy lists for AIM users, and AIM users show up in buddy lists 130 * for ICQ users. And ICQ privacy/invisibility acts like AIM privacy, 131 * in that if you add a user to your deny list, you will not be able to 132 * see them as online (previous you could still see them, but they 133 133 * couldn't see you. 134 134 */ … … 149 149 */ 150 150 {AIM_CAPS_CHAT, 151 {0x74, 0x8f, 0x24, 0x20, 0x62, 0x87, 0x11, 0xd1, 151 {0x74, 0x8f, 0x24, 0x20, 0x62, 0x87, 0x11, 0xd1, 152 152 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, 153 153 … … 164 164 /* This is added by the servers and it only shows up for ourselves... */ 165 165 {AIM_CAPS_GENERICUNKNOWN, 166 {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, 166 {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, 167 167 0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x09}}, 168 168 169 {AIM_CAPS_APINFO, 169 {AIM_CAPS_APINFO, 170 170 {0xaa, 0x4a, 0x32, 0xb5, 0xf8, 0x84, 0x48, 0xc6, 171 171 0xa3, 0xd7, 0x8c, 0x50, 0x97, 0x19, 0xfd, 0x5b}}, … … 183 183 184 184 /* 185 * Add the userinfo to our linked list. If we already have userinfo 185 * Add the userinfo to our linked list. If we already have userinfo 186 186 * for this buddy, then just overwrite parts of the old data. 187 187 * @param userinfo Contains the new information for the buddy. … … 260 260 261 261 /** 262 * Remove this screen name from our queue. If this info was resquested 262 * Remove this screen name from our queue. If this info was resquested 263 263 * by our info request queue, then pop the next element off of the queue. 264 264 * 265 265 * @param sess The aim session. 266 266 * @param sn Screen name of the info we just received. 267 * @return True if the request was explicit (client requested the info), 267 * @return True if the request was explicit (client requested the info), 268 268 * false if the request was implicit (libfaim request the info). 269 269 */ … … 450 450 451 451 /* 452 * AIM is fairly regular about providing user info. This is a generic 452 * AIM is fairly regular about providing user info. This is a generic 453 453 * routine to extract it in its standard form. 454 454 */ … … 465 465 466 466 /* 467 * Screen name. Stored as an unterminated string prepended with a 467 * Screen name. Stored as an unterminated string prepended with a 468 468 * byte containing its length. 469 469 */ … … 477 477 478 478 /* 479 * TLV Count. Unsigned short representing the number of 479 * TLV Count. Unsigned short representing the number of 480 480 * Type-Length-Value triples that follow. 481 481 */ 482 482 tlvcnt = aimbs_get16(bs); 483 483 484 /* 484 /* 485 485 * Parse out the Type-Length-Value triples as they're found. 486 486 */ … … 497 497 /* 498 498 * Type = 0x0001: User flags 499 * 499 * 500 500 * Specified as any of the following ORed together: 501 501 * 0x0001 Trial (user less than 60days) … … 503 503 * 0x0004 AOL Main Service user 504 504 * 0x0008 Unknown bit 4 505 * 0x0010 Free (AIM) user 505 * 0x0010 Free (AIM) user 506 506 * 0x0020 Away 507 507 * 0x0400 ActiveBuddy … … 513 513 } else if (type == 0x0002) { 514 514 /* 515 * Type = 0x0002: Account creation time. 515 * Type = 0x0002: Account creation time. 516 516 * 517 517 * The time/date that the user originally registered for … … 532 532 * Type = 0x0003: On-Since date. 533 533 * 534 * The time/date that the user started their current 534 * The time/date that the user started their current 535 535 * session, stored in time_t format. 536 536 */ … … 542 542 * Type = 0x0004: Idle time. 543 543 * 544 * Number of minutes since the user actively used the 544 * Number of minutes since the user actively used the 545 545 * service. 546 546 * 547 547 * Note that the client tells the server when to start 548 * counting idle times, so this may or may not be 548 * counting idle times, so this may or may not be 549 549 * related to reality. 550 550 */ … … 554 554 } else if (type == 0x0005) { 555 555 /* 556 * Type = 0x0005: Member since date. 556 * Type = 0x0005: Member since date. 557 557 * 558 558 * The time/date that the user originally registered for … … 570 570 * Type = 0x0006: ICQ Online Status 571 571 * 572 * ICQ's Away/DND/etc "enriched" status. Some decoding 572 * ICQ's Away/DND/etc "enriched" status. Some decoding 573 573 * of values done by Scott <darkagl@pcnet.com> 574 574 */ … … 595 595 596 596 } else if (type == 0x000c) { 597 /* 597 /* 598 598 * Type = 0x000c 599 599 * … … 603 603 * Format is: 604 604 * 4 bytes - Our IP address, 0xc0 a8 01 2b for 192.168.1.43 605 * 605 * 606 606 * 607 607 */ … … 632 632 * Type = 0x0010: Session Length. (AOL) 633 633 * 634 * The duration, in seconds, of the user's current 634 * The duration, in seconds, of the user's current 635 635 * session. 636 636 * … … 646 646 * Type = 0x0019 647 647 * 648 * OSCAR short capability information. A shortened 648 * OSCAR short capability information. A shortened 649 649 * form of the normal capabilities. 650 650 */ … … 656 656 * Type = 0x001a 657 657 * 658 * AOL short capability information. A shortened 658 * AOL short capability information. A shortened 659 659 * form of the normal capabilities. 660 660 */ … … 673 673 * Buddy icon information and available messages. 674 674 * 675 * This almost seems like the AIM protocol guys gave 676 * the iChat guys a Type, and the iChat guys tried to 677 * cram as much cool shit into it as possible. Then 678 * the Windows AIM guys were like, "hey, that's 675 * This almost seems like the AIM protocol guys gave 676 * the iChat guys a Type, and the iChat guys tried to 677 * cram as much cool shit into it as possible. Then 678 * the Windows AIM guys were like, "hey, that's 679 679 * pretty neat, let's copy those prawns." 680 680 * 681 * In that spirit, this can contain a custom message, 682 * kind of like an away message, but you're not away 683 * (it's called an "available" message). Or it can 684 * contain information about the buddy icon the user 681 * In that spirit, this can contain a custom message, 682 * kind of like an away message, but you're not away 683 * (it's called an "available" message). Or it can 684 * contain information about the buddy icon the user 685 685 * has stored on the server. 686 686 */ … … 748 748 /* 749 749 * Reaching here indicates that either AOL has 750 * added yet another TLV for us to deal with, 750 * added yet another TLV for us to deal with, 751 751 * or the parsing has gone Terribly Wrong. 752 752 * … … 805 805 if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) 806 806 aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities); 807 807 808 808 if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN) 809 809 aim_tlvlist_add_32(&tlvlist, (fu16_t)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen); … … 846 846 847 847 /* 848 * Remove this screen name from our queue. If the client requested 849 * this buddy's info explicitly, then notify them that we do not have 848 * Remove this screen name from our queue. If the client requested 849 * this buddy's info explicitly, then notify them that we do not have 850 850 * info for this buddy. 851 851 */ … … 915 915 * away are set, respectively, and their value may or may not be 916 916 * restricted to a few choices. I am currently aware of: 917 * 917 * 918 918 * us-ascii Just that 919 919 * unicode-2-0 UCS2-BE 920 * 920 * 921 921 * profile_len and awaymsg_len MUST be set similarly, and they MUST 922 922 * be the length of their respective strings in bytes. … … 925 925 * message, set awaymsg non-NULL and awaymsg_len to 0 (this is the 926 926 * obvious equivalent). 927 * 927 * 928 928 */ 929 929 faim_export int aim_locate_setprofile(aim_session_t *sess, … … 1048 1048 1049 1049 snacid = aim_cachesnac(sess, 0x0002, 0x0005, 0x0000, NULL, 0); 1050 1050 1051 1051 aim_putsnac(&fr->data, 0x0002, 0x0005, 0x0000, snacid); 1052 1052 aimbs_put16(&fr->data, infotype); … … 1104 1104 1105 1105 /* 1106 * Remove this screen name from our queue. If the client requested 1107 * this buddy's info explicitly, then notify them that we have info 1106 * Remove this screen name from our queue. If the client requested 1107 * this buddy's info explicitly, then notify them that we have info 1108 1108 * for this buddy. 1109 1109 */ … … 1116 1116 } 1117 1117 1118 /* 1118 /* 1119 1119 * Subtype 0x0009 - Set directory profile data. 1120 1120 * … … 1123 1123 * 1124 1124 */ 1125 faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy) 1125 faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy) 1126 1126 { 1127 1127 aim_conn_t *conn; … … 1189 1189 1190 1190 snacid = aim_cachesnac(sess, 0x0002, 0x000b, 0x0000, NULL, 0); 1191 1191 1192 1192 aim_putsnac(&fr->data, 0x0002, 0x000b, 0x0000, snacid); 1193 1193 aimbs_put8(&fr->data, strlen(sn)); … … 1201 1201 /* 1202 1202 * Subtype 0x000f 1203 * 1203 * 1204 1204 * XXX pass these in better 1205 1205 * … … 1244 1244 1245 1245 /* 1246 * Subtype 0x0015 - Request the info a user using the short method. This is 1246 * Subtype 0x0015 - Request the info a user using the short method. This is 1247 1247 * what iChat uses. It normally is VERY leniently rate limited. 1248 1248 * -
libfaim/md5.h
r5e53c4a r7869e48 62 62 63 63 #ifdef __cplusplus 64 extern "C" 64 extern "C" 65 65 { 66 66 #endif -
libfaim/misc.c
rcf02dd6 r7869e48 2 2 * misc.c 3 3 * 4 * Random stuff. Basically just a few functions for sending 4 * Random stuff. Basically just a few functions for sending 5 5 * simple SNACs, and then the generic error handler. 6 6 * … … 8 8 9 9 #define FAIM_INTERNAL 10 #include <aim.h> 10 #include <aim.h> 11 11 12 12 /* … … 61 61 62 62 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4))) 63 return -ENOMEM; 63 return -ENOMEM; 64 64 65 65 snacid = aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0); … … 82 82 83 83 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2))) 84 return -ENOMEM; 84 return -ENOMEM; 85 85 86 86 snacid = aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0); -
libfaim/msgcookie.c
re374dee r7869e48 2 2 * Cookie Caching stuff. Adam wrote this, apparently just some 3 3 * derivatives of n's SNAC work. I cleaned it up, added comments. 4 * 4 * 5 5 */ 6 6 … … 26 26 * returns -1 on error, 0 on append, 1 on update. the cookie you pass 27 27 * in may be free'd, so don't count on its value after calling this! 28 * 28 * 29 29 */ 30 30 faim_internal int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie) … … 36 36 37 37 newcook = aim_checkcookie(sess, cookie->cookie, cookie->type); 38 38 39 39 if (newcook == cookie) { 40 40 newcook->addtime = time(NULL); … … 43 43 aim_cookie_free(sess, newcook); 44 44 45 cookie->addtime = time(NULL); 45 cookie->addtime = time(NULL); 46 46 47 47 cookie->next = sess->msgcookies; … … 69 69 70 70 for (prev = &sess->msgcookies; (cur = *prev); ) { 71 if ((cur->type == type) && 71 if ((cur->type == type) && 72 72 (memcmp(cur->cookie, cookie, 8) == 0)) { 73 73 *prev = cur->next; … … 90 90 * 91 91 */ 92 faim_internal aim_msgcookie_t *aim_mkcookie(fu8_t *c, int type, void *data) 92 faim_internal aim_msgcookie_t *aim_mkcookie(fu8_t *c, int type, void *data) 93 93 { 94 94 aim_msgcookie_t *cookie; … … 123 123 124 124 for (cur = sess->msgcookies; cur; cur = cur->next) { 125 if ((cur->type == type) && 125 if ((cur->type == type) && 126 126 (memcmp(cur->cookie, cookie, 8) == 0)) 127 return cur; 127 return cur; 128 128 } 129 129 … … 132 132 133 133 #if 0 /* debugging feature */ 134 faim_internal int aim_dumpcookie(aim_session_t *sess, aim_msgcookie_t *cookie) 134 faim_internal int aim_dumpcookie(aim_session_t *sess, aim_msgcookie_t *cookie) 135 135 { 136 136 … … 138 138 return -EINVAL; 139 139 140 faimdprintf(sess, 0, "\tCookie at %p: %d/%s with %p, next %p\n", cookie, 140 faimdprintf(sess, 0, "\tCookie at %p: %d/%s with %p, next %p\n", cookie, 141 141 cookie->type, cookie->cookie, cookie->data, cookie->next); 142 142 … … 158 158 * 159 159 */ 160 faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie) 160 faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie) 161 161 { 162 162 aim_msgcookie_t *cur, **prev; … … 176 176 177 177 return 0; 178 } 178 } 179 179 180 180 /* XXX I hate switch */ 181 faim_internal int aim_msgcookie_gettype(int reqclass) 181 faim_internal int aim_msgcookie_gettype(int reqclass) 182 182 { 183 183 /* XXX: hokey-assed. needs fixed. */ … … 190 190 case AIM_CAPS_SENDFILE: return AIM_COOKIETYPE_OFTSEND; 191 191 default: return AIM_COOKIETYPE_UNKNOWN; 192 } 192 } 193 193 } -
libfaim/odir.c
rcf02dd6 r7869e48 2 2 * Family 0x000f - Newer Search Method 3 3 * 4 * Used for searching for other AIM users by email address, name, 4 * Used for searching for other AIM users by email address, name, 5 5 * location, commmon interests, and a few other similar things. 6 6 * … … 52 52 * Subtype 0x0002 - Submit a User Search Request 53 53 * 54 * Search for an AIM screen name based on various info 54 * Search for an AIM screen name based on various info 55 55 * about the person. 56 56 * -
libfaim/oscar.c
rcf02dd6 r7869e48 90 90 char *oldp; 91 91 char *newp; 92 92 93 93 GSList *oscar_chats; 94 94 GSList *direct_ims; … … 150 150 /* 151 151 * Various PRPL-specific buddy info that we want to keep track of 152 * Some other info is maintained by locate.c, and I'd like to move 152 * Some other info is maintained by locate.c, and I'd like to move 153 153 * the rest of this to libfaim, mostly im.c 154 154 */ … … 301 301 fu32_t encodingflag = 0; 302 302 303 /* Determine how we can send this message. Per the warnings elsewhere 304 * in this file, these little checks determine the simplest encoding 303 /* Determine how we can send this message. Per the warnings elsewhere 304 * in this file, these little checks determine the simplest encoding 305 305 * we can use for a given message send using it. */ 306 306 while (utf8[i]) { … … 401 401 if (!name) 402 402 return NULL; 403 403 404 404 x = strchr(name, '-'); 405 405 … … 474 474 if (dim->connected) 475 475 g_snprintf(buf, sizeof buf, _("Direct IM with %s closed"), sn); 476 else 476 else 477 477 g_snprintf(buf, sizeof buf, _("Direct IM with %s failed"), sn); 478 478 … … 500 500 return; 501 501 } 502 502 503 503 od = (OscarData *)gc->proto_data; 504 504 505 505 if (!g_list_find(gaim_connections_get_all(), gc)) { 506 /* oh boy. this is probably bad. i guess the only thing we 506 /* oh boy. this is probably bad. i guess the only thing we 507 507 * can really do is return? */ 508 508 gaim_debug(GAIM_DEBUG_INFO, "oscar", … … 665 665 aim_setdebuggingcb(sess, oscar_debug); 666 666 /* 667 * We need an immediate queue because we don't use a while-loop 667 * We need an immediate queue because we don't use a while-loop 668 668 * to see if things need to be sent. 669 669 */ … … 773 773 od = gc->proto_data; 774 774 sess = od->sess; 775 bosconn = od->conn; 775 bosconn = od->conn; 776 776 bosconn->fd = source; 777 777 … … 790 790 /* BBB */ 791 791 /* 792 * This little area in oscar.c is the nexus of file transfer code, 793 * so I wrote a little explanation of what happens. I am such a 792 * This little area in oscar.c is the nexus of file transfer code, 793 * so I wrote a little explanation of what happens. I am such a 794 794 * ninja. 795 795 * 796 796 * The series of events for a file send is: 797 797 * -Create xfer and call gaim_xfer_request (this happens in oscar_ask_sendfile) 798 * -User chooses a file and oscar_xfer_init is called. It establishs a 799 * listening socket, then asks the remote user to connect to us (and 798 * -User chooses a file and oscar_xfer_init is called. It establishs a 799 * listening socket, then asks the remote user to connect to us (and 800 800 * gives them the file name, port, IP, etc.) 801 * -They connect to us and we send them an AIM_CB_OFT_PROMPT (this happens 801 * -They connect to us and we send them an AIM_CB_OFT_PROMPT (this happens 802 802 * in oscar_sendfile_estblsh) 803 803 * -They send us an AIM_CB_OFT_ACK and then we start sending data 804 * -When we finish, they send us an AIM_CB_OFT_DONE and they close the 804 * -When we finish, they send us an AIM_CB_OFT_DONE and they close the 805 805 * connection. 806 806 * -We get drunk because file transfer kicks ass. … … 808 808 * The series of events for a file receive is: 809 809 * -Create xfer and call gaim_xfer request (this happens in incomingim_chan2) 810 * -Gaim user selects file to name and location to save file to and 810 * -Gaim user selects file to name and location to save file to and 811 811 * oscar_xfer_init is called 812 812 * -It connects to the remote user using the IP they gave us earlier 813 * -After connecting, they send us an AIM_CB_OFT_PROMPT. In reply, we send 813 * -After connecting, they send us an AIM_CB_OFT_PROMPT. In reply, we send 814 814 * them an AIM_CB_OFT_ACK. 815 815 * -They begin to send us lots of raw data. 816 * -When they finish sending data we send an AIM_CB_OFT_DONE and then close 816 * -When they finish sending data we send an AIM_CB_OFT_DONE and then close 817 817 * the connectionn. 818 818 */ … … 836 836 837 837 /* 838 * First try the port specified earlier (5190). If that fails, 838 * First try the port specified earlier (5190). If that fails, 839 839 * increment by 1 and try again. 840 840 */ … … 862 862 oft_info->conn->subtype = AIM_CONN_SUBTYPE_OFT_SENDFILE; 863 863 aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_PROMPT, oscar_sendfile_prompt, 0); 864 oft_info->conn->fd = xfer->fd = gaim_proxy_connect(gaim_connection_get_account(gc), xfer->remote_ip, xfer->remote_port, 864 oft_info->conn->fd = xfer->fd = gaim_proxy_connect(gaim_connection_get_account(gc), xfer->remote_ip, xfer->remote_port, 865 865 oscar_sendfile_connected, xfer); 866 866 if (xfer->fd == -1) { … … 1094 1094 gaim_debug(GAIM_DEBUG_MISC, "oscar", "Email is NULL\n"); 1095 1095 } 1096 1096 1097 1097 gaim_debug(GAIM_DEBUG_MISC, "oscar", "BOSIP: %s\n", info->bosip); 1098 1098 gaim_debug(GAIM_DEBUG_INFO, "oscar", … … 1893 1893 struct sockaddr name; 1894 1894 socklen_t name_len = 1; 1895 1895 1896 1896 if (!g_list_find(gaim_connections_get_all(), gc)) { 1897 1897 g_free(dim); … … 1915 1915 } 1916 1916 od->direct_ims = g_slist_append(od->direct_ims, dim); 1917 1917 1918 1918 dim->watcher = gaim_input_add(dim->conn->fd, GAIM_INPUT_READ, oscar_callback, dim->conn); 1919 1919 } … … 1921 1921 /* BBB */ 1922 1922 /* 1923 * This is called after a remote AIM user has connected to us. We 1924 * want to do some voodoo with the socket file descriptors, add a 1923 * This is called after a remote AIM user has connected to us. We 1924 * want to do some voodoo with the socket file descriptors, add a 1925 1925 * callback or two, and then send the AIM_CB_OFT_PROMPT. 1926 1926 */ … … 1964 1964 1965 1965 /* 1966 * This is the gaim callback passed to gaim_proxy_connect when connecting to another AIM 1966 * This is the gaim callback passed to gaim_proxy_connect when connecting to another AIM 1967 1967 * user in order to transfer a file. 1968 1968 */ … … 1993 1993 1994 1994 /* 1995 * This is called when a buddy sends us some file info. This happens when they 1995 * This is called when a buddy sends us some file info. This happens when they 1996 1996 * are sending a file to you, and you have just established a connection to them. 1997 * You should send them the exact same info except use the real cookie. We also 1997 * You should send them the exact same info except use the real cookie. We also 1998 1998 * get like totally ready to like, receive the file, kay? 1999 1999 */ … … 2040 2040 2041 2041 /* 2042 * We are sending a file to someone else. They have just acknowledged our 2042 * We are sending a file to someone else. They have just acknowledged our 2043 2043 * prompt, so we want to start sending data like there's no tomorrow. 2044 2044 */ … … 2072 2072 2073 2073 /* 2074 * We just sent a file to someone. They said they got it and everything, 2074 * We just sent a file to someone. They said they got it and everything, 2075 2075 * so we can close our direct connection and what not. 2076 2076 */ … … 2194 2194 } 2195 2195 2196 if ((iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc))) && 2196 if ((iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc))) && 2197 2197 (args->icbmflags & AIM_IMFLAGS_BUDDYREQ) && !bi->ico_sent && bi->ico_informed) { 2198 2198 FILE *file; … … 2310 2310 struct aim_oft_info *oft_info; 2311 2311 2312 if (!args->cookie || !args->port || !args->verifiedip || 2313 !args->info.sendfile.filename || !args->info.sendfile.totsize || 2312 if (!args->cookie || !args->port || !args->verifiedip || 2313 !args->info.sendfile.filename || !args->info.sendfile.totsize || 2314 2314 !args->info.sendfile.totfiles || !args->reqclass) { 2315 2315 gaim_debug(GAIM_DEBUG_WARNING, "oscar", … … 2375 2375 } else if (args->status == AIM_RENDEZVOUS_ACCEPT) { 2376 2376 /* 2377 * This gets sent by the receiver of a file 2378 * as they connect directly to us. If we don't 2379 * get this, then maybe a third party connected 2377 * This gets sent by the receiver of a file 2378 * as they connect directly to us. If we don't 2379 * get this, then maybe a third party connected 2380 2380 * to us, and we shouldn't send them anything. 2381 2381 */ … … 2428 2428 /* 2429 2429 * Authorization Functions 2430 * Most of these are callbacks from dialogs. They're used by both 2430 * Most of these are callbacks from dialogs. They're used by both 2431 2431 * methods of authorization (SSI and old-school channel 4 ICBM) 2432 2432 */ … … 3024 3024 3025 3025 /* 3026 * We get this error when there was an error in the locate family. This 3026 * We get this error when there was an error in the locate family. This 3027 3027 * happens when you request info of someone who is offline. 3028 3028 */ … … 3146 3146 bit <<= 1; 3147 3147 } 3148 return buf; 3148 return buf; 3149 3149 } 3150 3150 … … 3420 3420 g_free(to); 3421 3421 } 3422 3422 3423 3423 if (alertitle) 3424 3424 gaim_debug(GAIM_DEBUG_MISC, "oscar", "Got an alert '%s' %s\n", alertitle, alerturl ? alerturl : ""); … … 3582 3582 fu32_t windowsize, clear, alert, limit, disconnect, currentavg, maxavg; 3583 3583 3584 va_start(ap, fr); 3584 va_start(ap, fr); 3585 3585 code = (fu16_t)va_arg(ap, unsigned int); 3586 3586 rateclass= (fu16_t)va_arg(ap, unsigned int); … … 3903 3903 * 3904 3904 * It may not be my place to do this, but... 3905 * I feel pretty strongly that the "last 2 digits" warning is ridiculously 3906 * stupid, and should not exist for % switches (%x in our case) that request 3907 * a year in the preferred representation for the current locale. For that 3905 * I feel pretty strongly that the "last 2 digits" warning is ridiculously 3906 * stupid, and should not exist for % switches (%x in our case) that request 3907 * a year in the preferred representation for the current locale. For that 3908 3908 * reason I've chosen to not use this workaround (n., see kluge). 3909 3909 * 3910 * I have a date. I want to show it to the user in the "preferred" way. 3911 * Whether that displays a 2 digit year is perfectly fine--after all, it's 3910 * I have a date. I want to show it to the user in the "preferred" way. 3911 * Whether that displays a 2 digit year is perfectly fine--after all, it's 3912 3912 * what the locale wanted. 3913 * 3914 * If I have a necessity for a full representation of the year in the current 3915 * locale, then I'll use a switch that returns a full representation of the 3913 * 3914 * If I have a necessity for a full representation of the year in the current 3915 * locale, then I'll use a switch that returns a full representation of the 3916 3916 * year. 3917 3917 * 3918 * If you think the preferred locale should show 4 digits instead of 2 digits 3918 * If you think the preferred locale should show 4 digits instead of 2 digits 3919 3919 * (because you're anal, or whatever), then change the f***ing locale. 3920 3920 * 3921 * I guess the bottom line is--I'm trying to show a date to the user how they 3921 * I guess the bottom line is--I'm trying to show a date to the user how they 3922 3922 * prefer to see it, why the hell does gcc want me to change that? 3923 3923 * … … 3930 3930 * "last 2 digits" warning. 3931 3931 */ 3932 static size_t my_strftime(char *s, size_t max, const char *fmt, 3932 static size_t my_strftime(char *s, size_t max, const char *fmt, 3933 3933 const struct tm *tm) 3934 3934 { … … 4233 4233 4234 4234 if (email) { 4235 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), 4235 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), 4236 4236 gaim_account_get_username(gaim_connection_get_account(gc)), email); 4237 4237 gaim_notify_info(gc, NULL, _("Account Info"), dialog_msg); … … 4475 4475 return; 4476 4476 } 4477 4477 4478 4478 text_html = gaim_strdup_withhtml(text); 4479 4479 flags = oscar_encoding_check(text_html); … … 4536 4536 if (flags & AIM_IMFLAGS_UNICODE) { 4537 4537 msg = g_convert(text_html, strlen(text_html), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); 4538 aim_locate_setprofile(od->sess, NULL, NULL, 0, "unicode-2-0", msg, 4538 aim_locate_setprofile(od->sess, NULL, NULL, 0, "unicode-2-0", msg, 4539 4539 (msglen > od->rights.maxawaymsglen ? od->rights.maxawaymsglen : msglen)); 4540 4540 g_free(msg); … … 4542 4542 } else if (flags & AIM_IMFLAGS_ISO_8859_1) { 4543 4543 msg = g_convert(text_html, strlen(text_html), "ISO-8859-1", "UTF-8", NULL, &msglen, NULL); 4544 aim_locate_setprofile(od->sess, NULL, NULL, 0, "iso-8859-1", msg, 4544 aim_locate_setprofile(od->sess, NULL, NULL, 0, "iso-8859-1", msg, 4545 4545 (msglen > od->rights.maxawaymsglen ? od->rights.maxawaymsglen : msglen)); 4546 4546 g_free(msg); … … 4548 4548 } else { 4549 4549 msglen = strlen(text_html); 4550 aim_locate_setprofile(od->sess, NULL, NULL, 0, "us-ascii", text_html, 4550 aim_locate_setprofile(od->sess, NULL, NULL, 0, "us-ascii", text_html, 4551 4551 (msglen > od->rights.maxawaymsglen ? od->rights.maxawaymsglen : msglen)); 4552 4552 gc->away = g_strndup(text_html, od->rights.maxawaymsglen); … … 4564 4564 g_free(errstr); 4565 4565 } 4566 4566 4567 4567 g_free(text_html); 4568 4568 return; … … 5250 5250 OscarData *od = (OscarData *)g->proto_data; 5251 5251 struct chat_connection *ccon = find_oscar_chat(g, id); 5252 5252 5253 5253 if (!ccon) 5254 5254 return; 5255 5255 5256 5256 aim_chat_invite(od->sess, od->conn, name, message ? message : "", 5257 5257 ccon->exchange, ccon->name, 0x0); … … 5279 5279 gaim_debug(GAIM_DEBUG_INFO, "oscar", 5280 5280 "Attempting to leave room %s (currently in %d rooms)\n", b->name, count); 5281 5281 5282 5282 c = find_oscar_chat(g, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b))); 5283 5283 if (c != NULL) { … … 5384 5384 if (!GAIM_BUDDY_IS_ONLINE(b)) { 5385 5385 char *gname; 5386 if ((b->name) && (od) && (od->sess->ssi.received_data) && 5387 (gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name)) && 5386 if ((b->name) && (od) && (od->sess->ssi.received_data) && 5387 (gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name)) && 5388 5388 (aim_ssi_waitingforauth(od->sess->ssi.local, gname, b->name))) { 5389 5389 emblems[i++] = "notauthorized"; … … 5408 5408 emblems[i++] = "away"; 5409 5409 } else { 5410 if (b->uc & UC_UNAVAILABLE) 5410 if (b->uc & UC_UNAVAILABLE) 5411 5411 emblems[i++] = "away"; 5412 5412 } … … 5600 5600 } 5601 5601 } else if (flags == 0x81) 5602 aim_ssi_seticon(od->sess, md5, length); 5602 aim_ssi_seticon(od->sess, md5, length); 5603 5603 } break; 5604 5604 … … 5656 5656 5657 5657 /* 5658 * This is called when each chunk of an image is received. It can be used to 5659 * update a progress bar, or to eat lots of dry cat food. Wet cat food is 5658 * This is called when each chunk of an image is received. It can be used to 5659 * update a progress bar, or to eat lots of dry cat food. Wet cat food is 5660 5660 * nasty, you sicko. 5661 5661 */ … … 5693 5693 5694 5694 /* 5695 * This is called after a direct IM has been received in its entirety. This 5696 * function is passed a long chunk of data which contains the IM with any 5695 * This is called after a direct IM has been received in its entirety. This 5696 * function is passed a long chunk of data which contains the IM with any 5697 5697 * data chunks (images) appended to it. 5698 5698 * 5699 * This function rips out all the data chunks and creates an imgstore for 5700 * each one. In order to do this, it first goes through the IM and takes 5701 * out all the IMG tags. When doing so, it rewrites the original IMG tag 5702 * with one compatable with the imgstore Gaim core code. For each one, we 5703 * then read in chunks of data from the end of the message and actually 5699 * This function rips out all the data chunks and creates an imgstore for 5700 * each one. In order to do this, it first goes through the IM and takes 5701 * out all the IMG tags. When doing so, it rewrites the original IMG tag 5702 * with one compatable with the imgstore Gaim core code. For each one, we 5703 * then read in chunks of data from the end of the message and actually 5704 5704 * create the img store using the given data. 5705 5705 * … … 5713 5713 * Yeah it is<BR> 5714 5714 * Here is another one:<BR> 5715 * <IMG SRC="Soap Bubbles.bmp" ID="2" WIDTH="256" HEIGHT="256" DATASIZE="65978"> 5715 * <IMG SRC="Soap Bubbles.bmp" ID="2" WIDTH="256" HEIGHT="256" DATASIZE="65978"> 5716 5716 * </FONT> 5717 5717 * </BODY></HTML> … … 6027 6027 6028 6028 switch(account->perm_deny) { 6029 case 1: 6029 case 1: 6030 6030 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gaim_account_get_username(account)); 6031 6031 break; … … 6258 6258 } 6259 6259 } 6260 6260 6261 6261 return m; 6262 6262 } … … 6411 6411 { 6412 6412 gaim_request_input(gc, NULL, _("Available Message:"), NULL, 6413 _("I'm doing work and hoping for a distraction--IM me!"), 6413 _("I'm doing work and hoping for a distraction--IM me!"), 6414 6414 TRUE, FALSE, 6415 6415 _("OK"), G_CALLBACK(oscar_setavailmsg), -
libfaim/popups.c
rcf02dd6 r7869e48 13 13 * 14 14 * The message is probably HTML. 15 * 15 * 16 16 */ 17 17 static int parsepopup(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) -
libfaim/rxhandlers.c
r54666e0 r7869e48 112 112 if (snac.flags & 0x0001) { 113 113 /* 114 * This means the SNAC will be followed by another SNAC with 115 * related information. We don't need to do anything about 114 * This means the SNAC will be followed by another SNAC with 115 * related information. We don't need to do anything about 116 116 * this here. 117 117 */ … … 119 119 if (snac.flags & 0x8000) { 120 120 /* 121 * This packet contains the version of the family that this SNAC is 122 * in. You get this when your SSI module is version 2 or higher. 123 * For now we have no need for this, but you could always save 121 * This packet contains the version of the family that this SNAC is 122 * in. You get this when your SSI module is version 2 or higher. 123 * For now we have no need for this, but you could always save 124 124 * it as a part of aim_modnsac_t, or something. The format is... 125 * 2 byte length of total mini-header (which is 6 bytes), then TLV 126 * of type 0x0001, length 0x0002, value is the 2 byte version 125 * 2 byte length of total mini-header (which is 6 bytes), then TLV 126 * of type 0x0001, length 0x0002, value is the 2 byte version 127 127 * number 128 128 */ … … 132 132 for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) { 133 133 134 if (!(cur->flags & AIM_MODFLAG_MULTIFAMILY) && 134 if (!(cur->flags & AIM_MODFLAG_MULTIFAMILY) && 135 135 (cur->family != snac.family)) 136 136 continue; … … 155 155 for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) { 156 156 157 if (!(cur->flags & AIM_MODFLAG_MULTIFAMILY) && 157 if (!(cur->flags & AIM_MODFLAG_MULTIFAMILY) && 158 158 (cur->family != snac.family)) 159 159 continue; … … 193 193 msg = aim_tlv_getstr(tlvlist, 0x000b, 1); 194 194 195 if ((userfunc = aim_callhandler(sess, fr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR))) 195 if ((userfunc = aim_callhandler(sess, fr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR))) 196 196 ret = userfunc(sess, fr, code, msg); 197 197 … … 221 221 }; 222 222 static const int maxchannels = 5; 223 223 224 224 /* XXX: this is ugly. and big just for debugging. */ 225 225 static const char *literals[14][25] = { 226 {"Invalid", 226 {"Invalid", 227 227 NULL 228 228 }, 229 {"General", 229 {"General", 230 230 "Invalid", 231 231 "Error", … … 252 252 "NOP" 253 253 }, 254 {"Location", 254 {"Location", 255 255 "Invalid", 256 256 "Error", 257 257 "Request Rights", 258 "Rights Information", 259 "Set user information", 260 "Request User Information", 261 "User Information", 258 "Rights Information", 259 "Set user information", 260 "Request User Information", 261 "User Information", 262 262 "Watcher Sub Request", 263 263 "Watcher Notification" 264 264 }, 265 {"Buddy List Management", 266 "Invalid", 267 "Error", 265 {"Buddy List Management", 266 "Invalid", 267 "Error", 268 268 "Request Rights", 269 269 "Rights Information", 270 "Add Buddy", 271 "Remove Buddy", 272 "Watcher List Query", 273 "Watcher List Response", 274 "Watcher SubRequest", 275 "Watcher Notification", 276 "Reject Notification", 277 "Oncoming Buddy", 270 "Add Buddy", 271 "Remove Buddy", 272 "Watcher List Query", 273 "Watcher List Response", 274 "Watcher SubRequest", 275 "Watcher Notification", 276 "Reject Notification", 277 "Oncoming Buddy", 278 278 "Offgoing Buddy" 279 279 }, 280 {"Messeging", 281 "Invalid", 282 "Error", 280 {"Messeging", 281 "Invalid", 282 "Error", 283 283 "Add ICBM Parameter", 284 "Remove ICBM Parameter", 284 "Remove ICBM Parameter", 285 285 "Request Parameter Information", 286 286 "Parameter Information", 287 "Outgoing Message", 287 "Outgoing Message", 288 288 "Incoming Message", 289 289 "Evil Request", 290 "Evil Reply", 290 "Evil Reply", 291 291 "Missed Calls", 292 "Message Error", 292 "Message Error", 293 293 "Host Ack" 294 294 }, 295 {"Advertisements", 296 "Invalid", 297 "Error", 295 {"Advertisements", 296 "Invalid", 297 "Error", 298 298 "Request Ad", 299 299 "Ad Data (GIFs)" 300 300 }, 301 {"Invitation / Client-to-Client", 301 {"Invitation / Client-to-Client", 302 302 "Invalid", 303 303 "Error", … … 305 305 "Invitation Ack" 306 306 }, 307 {"Administrative", 307 {"Administrative", 308 308 "Invalid", 309 309 "Error", … … 317 317 "Account Delete Reply" 318 318 }, 319 {"Popups", 319 {"Popups", 320 320 "Invalid", 321 321 "Error", 322 322 "Display Popup" 323 323 }, 324 {"BOS", 324 {"BOS", 325 325 "Invalid", 326 326 "Error", … … 334 334 "Server Error" 335 335 }, 336 {"User Lookup", 336 {"User Lookup", 337 337 "Invalid", 338 338 "Error", … … 340 340 "Search Response" 341 341 }, 342 {"Stats", 342 {"Stats", 343 343 "Invalid", 344 344 "Error", … … 346 346 "Report Events" 347 347 }, 348 {"Translate", 348 {"Translate", 349 349 "Invalid", 350 350 "Error", … … 352 352 "Translate Reply", 353 353 }, 354 {"Chat Navigation", 354 {"Chat Navigation", 355 355 "Invalid", 356 356 "Error", … … 360 360 "Request Occupant List", 361 361 "Search for Room", 362 "Outgoing Message", 362 "Outgoing Message", 363 363 "Incoming Message", 364 "Evil Request", 365 "Evil Reply", 364 "Evil Request", 365 "Evil Reply", 366 366 "Chat Error", 367 367 } … … 375 375 family = aimbs_get16(&frame->data); 376 376 subtype = aimbs_get16(&frame->data); 377 377 378 378 if ((family < maxf) && (subtype+1 < maxs) && (literals[family][subtype] != NULL)) 379 379 faimdprintf(sess, 0, "bleck: channel %s: null handler for %04x/%04x (%s)\n", channels[frame->hdr.flap.type], family, subtype, literals[family][subtype+1]); … … 388 388 389 389 } 390 390 391 391 return 1; 392 392 } … … 471 471 472 472 for (cur = (struct aim_rxcblist_s *)src->handlerlist; cur; cur = cur->next) { 473 aim_conn_addhandler(sess, dest, cur->family, cur->type, 473 aim_conn_addhandler(sess, dest, cur->family, cur->type, 474 474 cur->handler, cur->flags); 475 475 } … … 554 554 } 555 555 556 /* 556 /* 557 557 * This doesn't have to be called here. It could easily be done 558 558 * by a seperate thread or something. It's an administrative operation, -
libfaim/rxqueue.c
re374dee r7869e48 8 8 9 9 #define FAIM_INTERNAL 10 #include <aim.h> 10 #include <aim.h> 11 11 12 12 #ifndef _WIN32 … … 19 19 faim_internal int aim_recv(int fd, void *buf, size_t count) 20 20 { 21 int left, cur; 21 int left, cur; 22 22 23 23 for (cur = 0, left = count; left; ) { 24 24 int ret; 25 25 26 26 ret = recv(fd, ((unsigned char *)buf)+cur, left, 0); 27 27 … … 47 47 if (!bs || (fd < 0) || (count < 0)) 48 48 return -1; 49 49 50 50 if (count > (bs->len - bs->offset)) 51 51 count = bs->len - bs->offset; /* truncate to remaining space */ … … 88 88 aim_bstream_t flaphdr; 89 89 fu16_t payloadlen; 90 90 91 91 aim_bstream_init(&flaphdr, flaphdr_raw, sizeof(flaphdr_raw)); 92 92 … … 117 117 aim_conn_close(conn); 118 118 return -1; 119 } 119 } 120 120 121 121 /* we're doing FLAP if we're here */ … … 156 156 157 157 /* 158 * Grab a single command sequence off the socket, and enqueue it in the incoming event queue 158 * Grab a single command sequence off the socket, and enqueue it in the incoming event queue 159 159 * in a separate struct. 160 160 */ … … 180 180 181 181 /* 182 * Rendezvous (client to client) connections do not speak FLAP, so this 182 * Rendezvous (client to client) connections do not speak FLAP, so this 183 183 * function will break on them. 184 184 */ … … 239 239 newrx->conn->lastactivity = time(NULL); 240 240 241 return 0; 241 return 0; 242 242 } 243 243 … … 245 245 * Purge recieve queue of all handled commands (->handled==1). Also 246 246 * allows for selective freeing using ->nofree so that the client can 247 * keep the data for various purposes. 248 * 249 * If ->nofree is nonzero, the frame will be delinked from the global list, 247 * keep the data for various purposes. 248 * 249 * If ->nofree is nonzero, the frame will be delinked from the global list, 250 250 * but will not be free'ed. The client _must_ keep a pointer to the 251 251 * data -- libfaim will not! If the client marks ->nofree but … … 261 261 262 262 *prev = cur->next; 263 263 264 264 if (!cur->nofree) 265 265 aim_frame_destroy(cur); … … 286 286 if ((!currx->handled) && (currx->conn == conn)) 287 287 currx->handled = 1; 288 } 288 } 289 289 return; 290 290 } -
libfaim/search.c
rcf02dd6 r7869e48 54 54 snacid = aim_cachesnac(sess, 0x000a, 0x0002, 0x0000, strdup(address), strlen(address)+1); 55 55 aim_putsnac(&fr->data, 0x000a, 0x0002, 0x0000, snacid); 56 57 aimbs_putraw(&fr->data, address, strlen(address)); 56 57 aimbs_putraw(&fr->data, address, strlen(address)); 58 58 59 59 aim_tx_enqueue(sess, fr); … … 82 82 83 83 /* XXX uhm. 84 * This is the only place that uses something other than 1 for the 3rd 84 * This is the only place that uses something other than 1 for the 3rd 85 85 * parameter to aim_tlv_gettlv_whatever(). 86 86 */ … … 91 91 free(cur); 92 92 93 j++; 93 j++; 94 94 } 95 95 -
libfaim/service.c
rcf02dd6 r7869e48 29 29 /* 30 30 * Send only the tool versions that the server cares about (that it 31 * marked as supporting in the server ready SNAC). 31 * marked as supporting in the server ready SNAC). 32 32 */ 33 33 for (sg = ins->groups; sg; sg = sg->next) { … … 50 50 /* 51 51 * Subtype 0x0003 - Host Online 52 * 52 * 53 53 * See comments in conn.c about how the group associations are supposed 54 54 * to work, and how they really work. … … 58 58 * We don't actually call the client here. This starts off the connection 59 59 * initialization routine required by all AIM connections. The next time 60 * the client is called is the CONNINITDONE callback, which should be 60 * the client is called is the CONNINITDONE callback, which should be 61 61 * shortly after the rate information is acknowledged. 62 * 62 * 63 63 */ 64 64 static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) … … 89 89 aim_setversions(sess, rx->conn); 90 90 91 return 1; 91 return 1; 92 92 } 93 93 … … 161 161 * it. The rate classes, their limiting properties, and the definitions 162 162 * of which SNACs are belong to which class, are defined in the 163 * Rate Response packet at login to each host. 163 * Rate Response packet at login to each host. 164 164 * 165 165 * Logically, all rate offenses within one class count against further … … 194 194 * 195 195 * The only other thing of note is that class 5 (chat) has slightly looser 196 * limiting properties than class 3 (normal messages). But thats just a 196 * limiting properties than class 3 (normal messages). But thats just a 197 197 * small bit of trivia for you. 198 198 * … … 200 200 * system is how the actual numbers relate to the passing of time. This 201 201 * seems to be a big mystery. 202 * 202 * 203 203 */ 204 204 … … 289 289 * depending on the version we advertised in 1/17. If we 290 290 * didn't send 1/17 (evil!), then this will crash and you 291 * die, as it will default to the old version but we have 292 * the new version hardcoded here. 291 * die, as it will default to the old version but we have 292 * the new version hardcoded here. 293 293 */ 294 294 if (mod->version >= 3) … … 350 350 { 351 351 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; 352 aim_frame_t *fr; 352 aim_frame_t *fr; 353 353 aim_snacid_t snacid; 354 354 struct rateclass *rc; 355 355 356 356 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) 357 return -ENOMEM; 357 return -ENOMEM; 358 358 359 359 snacid = aim_cachesnac(sess, 0x0001, 0x0008, 0x0000, NULL, 0); … … 372 372 { 373 373 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; 374 aim_frame_t *fr; 374 aim_frame_t *fr; 375 375 aim_snacid_t snacid; 376 376 struct rateclass *rc; 377 377 378 378 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) 379 return -ENOMEM; 379 return -ENOMEM; 380 380 381 381 snacid = aim_cachesnac(sess, 0x0001, 0x0009, 0x0000, NULL, 0); … … 400 400 code = aimbs_get16(bs); 401 401 rateclass = aimbs_get16(bs); 402 402 403 403 windowsize = aimbs_get32(bs); 404 404 clear = aimbs_get32(bs); … … 418 418 * How Migrations work. 419 419 * 420 * The server sends a Server Pause message, which the client should respond to 421 * with a Server Pause Ack, which contains the families it needs on this 422 * connection. The server will send a Migration Notice with an IP address, and 423 * then disconnect. Next the client should open the connection and send the 420 * The server sends a Server Pause message, which the client should respond to 421 * with a Server Pause Ack, which contains the families it needs on this 422 * connection. The server will send a Migration Notice with an IP address, and 423 * then disconnect. Next the client should open the connection and send the 424 424 * cookie. Repeat the normal login process and pretend this never happened. 425 425 * … … 465 465 466 466 /* 467 * This list should have all the groups that the original 468 * Host Online / Server Ready said this host supports. And 467 * This list should have all the groups that the original 468 * Host Online / Server Ready said this host supports. And 469 469 * we want them all back after the migration. 470 470 */ … … 521 521 522 522 memset(&userinfo, 0, sizeof(aim_userinfo_t)); 523 523 524 524 newevil = aimbs_get16(bs); 525 525 … … 558 558 * 559 559 * This is the final SNAC sent on the original connection during a migration. 560 * It contains the IP and cookie used to connect to the new server, and 560 * It contains the IP and cookie used to connect to the new server, and 561 561 * optionally a list of the SNAC groups being migrated. 562 562 * … … 576 576 * moves to the new server. When not all the groups for a connection 577 577 * are migrated, or they are all migrated but some groups are moved 578 * to a different server than others, it is called a bifurcated 578 * to a different server than others, it is called a bifurcated 579 579 * migration. 580 580 * … … 624 624 * 3 System bulletin 625 625 * 4 Nothing's wrong ("top o the world" -- normal) 626 * 5 Lets-break-something. 626 * 5 Lets-break-something. 627 627 * 628 628 */ 629 629 id = aimbs_get16(bs); 630 630 631 /* 632 * TLVs follow 631 /* 632 * TLVs follow 633 633 */ 634 634 tlvlist = aim_tlvlist_read(bs); … … 646 646 } 647 647 648 /* 648 /* 649 649 * Subtype 0x0014 - Set privacy flags 650 650 * … … 663 663 * Subtype 0x0016 - No-op 664 664 * 665 * WinAIM sends these every 4min or so to keep the connection alive. Its not 665 * WinAIM sends these every 4min or so to keep the connection alive. Its not 666 666 * really necessary. 667 667 * 668 * Wha? No? Since when? I think WinAIM sends an empty channel 3 668 * Wha? No? Since when? I think WinAIM sends an empty channel 3 669 669 * SNAC as a no-op... 670 670 */ … … 674 674 } 675 675 676 /* 676 /* 677 677 * Subtype 0x0017 - Set client versions 678 678 * 679 * If you've seen the clientonline/clientready SNAC you're probably 679 * If you've seen the clientonline/clientready SNAC you're probably 680 680 * wondering what the point of this one is. And that point seems to be 681 681 * that the versions in the client online SNAC are sent too late for the 682 682 * server to be able to use them to change the protocol for the earlier 683 * login packets (client versions are sent right after Host Online is 683 * login packets (client versions are sent right after Host Online is 684 684 * received, but client online versions aren't sent until quite a bit later). 685 685 * We can see them already making use of this by changing the format of … … 705 705 /* 706 706 * Send only the versions that the server cares about (that it 707 * marked as supporting in the server ready SNAC). 707 * marked as supporting in the server ready SNAC). 708 708 */ 709 709 for (sg = ins->groups; sg; sg = sg->next) { … … 741 741 } 742 742 743 /* 743 /* 744 744 * Subtype 0x001e - Extended Status 745 745 * 746 746 * Sets your ICQ status (available, away, do not disturb, etc.) 747 747 * 748 * These are the same TLVs seen in user info. You can 748 * These are the same TLVs seen in user info. You can 749 749 * also set 0x0008 and 0x000c. 750 750 */ … … 767 767 snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0); 768 768 aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid); 769 769 770 770 aim_tlvlist_add_32(&tl, 0x0006, data); 771 771 aim_tlvlist_write(&fr->data, &tl); 772 772 aim_tlvlist_free(&tl); 773 773 774 774 aim_tx_enqueue(sess, fr); 775 775 … … 777 777 } 778 778 779 /* 779 /* 780 780 * Subtype 0x001e - Extended Status. 781 781 * 782 * Sets your "available" message. This is currently only supported by iChat 782 * Sets your "available" message. This is currently only supported by iChat 783 783 * and Gaim. 784 784 * 785 * These are the same TLVs seen in user info. You can 785 * These are the same TLVs seen in user info. You can 786 786 * also set 0x0008 and 0x000c. 787 787 */ … … 851 851 * the data that the specific client should have, the client will get the 852 852 * following message from "AOL Instant Messenger": 853 * "You have been disconnected from the AOL Instant Message Service (SM) 853 * "You have been disconnected from the AOL Instant Message Service (SM) 854 854 * for accessing the AOL network using unauthorized software. You can 855 * download a FREE, fully featured, and authorized client, here 855 * download a FREE, fully featured, and authorized client, here 856 856 * http://www.aol.com/aim/download2.html" 857 857 * The connection is then closed, recieving disconnect code 1, URL 858 * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. 859 * 860 * Note, however, that numerous inconsistencies can cause the above error, 858 * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. 859 * 860 * Note, however, that numerous inconsistencies can cause the above error, 861 861 * not just sending back a bad hash. Do not immediatly suspect this code 862 862 * if you get disconnected. AOL and the open/free software community have … … 935 935 if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && buf && (len == 0x10)) { /* we're getting a hash */ 936 936 937 aimbs_putraw(&fr->data, buf, 0x10); 937 aimbs_putraw(&fr->data, buf, 0x10); 938 938 939 939 } else if (buf && (len > 0)) { /* use input buffer */ … … 941 941 md5_byte_t digest[0x10]; 942 942 943 md5_init(&state); 943 md5_init(&state); 944 944 md5_append(&state, (const md5_byte_t *)buf, len); 945 945 md5_finish(&state, digest); … … 954 954 /* 955 955 * These MD5 routines are stupid in that you have to have 956 * at least one append. So thats why this doesn't look 956 * at least one append. So thats why this doesn't look 957 957 * real logical. 958 958 */ … … 965 965 } else { 966 966 967 /* 967 /* 968 968 * This data is correct for AIM 3.5.1670. 969 969 * … … 1006 1006 * Subtype 0x0021 - Receive our extended status 1007 1007 * 1008 * This is used for iChat's "available" messages, and maybe ICQ extended 1009 * status messages? It's also used to tell the client whether or not it 1008 * This is used for iChat's "available" messages, and maybe ICQ extended 1009 * status messages? It's also used to tell the client whether or not it 1010 1010 * needs to upload an SSI buddy icon... who engineers this stuff, anyway? 1011 1011 */ … … 1017 1017 fu8_t flags, length; 1018 1018 1019 type = aimbs_get16(bs); 1019 type = aimbs_get16(bs); 1020 1020 flags = aimbs_get8(bs); 1021 1021 length = aimbs_get8(bs); -
libfaim/snac.c
re374dee r7869e48 1 1 /* 2 2 * 3 * Various SNAC-related dodads... 3 * Various SNAC-related dodads... 4 4 * 5 5 * outstanding_snacs is a list of aim_snac_t structs. A SNAC should be added 6 6 * whenever a new SNAC is sent and it should remain in the list until the 7 * response for it has been receieved. 7 * response for it has been receieved. 8 8 * 9 9 * cleansnacs() should be called periodically by the client in order … … 74 74 75 75 /* 76 * Finds a snac structure with the passed SNAC ID, 76 * Finds a snac structure with the passed SNAC ID, 77 77 * removes it from the list/hash, and returns a pointer to it. 78 78 * … … 80 80 * 81 81 */ 82 faim_internal aim_snac_t *aim_remsnac(aim_session_t *sess, aim_snacid_t id) 82 faim_internal aim_snac_t *aim_remsnac(aim_session_t *sess, aim_snacid_t id) 83 83 { 84 84 aim_snac_t *cur, **prev; -
libfaim/ssi.c
r0154e2d r7869e48 2 2 * Family 0x0013 - Server-Side/Stored Information. 3 3 * 4 * Relatively new facility that allows certain types of information, such as 5 * a user's buddy list, permit/deny list, and permit/deny preferences, to be 4 * Relatively new facility that allows certain types of information, such as 5 * a user's buddy list, permit/deny list, and permit/deny preferences, to be 6 6 * stored on the server, so that they can be accessed from any client. 7 7 * 8 8 * We keep 2 copies of SSI data: 9 9 * 1) An exact copy of what is stored on the AIM servers. 10 * 2) A local copy that we make changes to, and then send diffs 10 * 2) A local copy that we make changes to, and then send diffs 11 11 * between this and the exact copy to keep them in sync. 12 12 * 13 * All the "aim_ssi_itemlist_bleh" functions near the top just modify the list 13 * All the "aim_ssi_itemlist_bleh" functions near the top just modify the list 14 14 * that is given to them (i.e. they don't send SNACs). 15 15 * 16 * The SNAC sending and receiving functions are lower down in the file, and 17 * they're simpler. They are in the order of the subtypes they deal with, 18 * starting with the request rights function (subtype 0x0002), then parse 16 * The SNAC sending and receiving functions are lower down in the file, and 17 * they're simpler. They are in the order of the subtypes they deal with, 18 * starting with the request rights function (subtype 0x0002), then parse 19 19 * rights (subtype 0x0003), then--well, you get the idea. 20 20 * … … 31 31 * 32 32 * @param list A pointer to a pointer to the current list of items. 33 * @param name A null terminated string containing the group name, or NULL 33 * @param name A null terminated string containing the group name, or NULL 34 34 * if you want to modify the master group. 35 35 * @return Return a pointer to the modified item. … … 87 87 * 88 88 * @param list A pointer to a pointer to the current list of items. 89 * @param name A null terminated string of the name of the new item, or NULL if the 89 * @param name A null terminated string of the name of the new item, or NULL if the 90 90 * item should have no name. 91 91 * @param gid The group ID# you want the new item to have, or 0xFFFF if we should pick something. … … 260 260 261 261 /** 262 * Locally find an item given a group name, screen name, and type. If group name 262 * Locally find an item given a group name, screen name, and type. If group name 263 263 * and screen name are null, then just return the first item of the given type. 264 264 * … … 362 362 363 363 /** 364 * Locally find the presence flag item, and return the setting. The returned setting is a 365 * bitmask of the user flags that you are visible to. See the AIM_FLAG_* #defines 364 * Locally find the presence flag item, and return the setting. The returned setting is a 365 * bitmask of the user flags that you are visible to. See the AIM_FLAG_* #defines 366 366 * in aim.h 367 367 * … … 386 386 * @param gn The group of the buddy. 387 387 * @param sn The name of the buddy. 388 * @return A pointer to a NULL terminated string that is the buddy's 388 * @return A pointer to a NULL terminated string that is the buddy's 389 389 * alias, or NULL if the buddy has no alias. You should free 390 390 * this returned value! … … 411 411 * @param gn The group of the buddy. 412 412 * @param sn The name of the buddy. 413 * @return A pointer to a NULL terminated string that is the buddy's 413 * @return A pointer to a NULL terminated string that is the buddy's 414 414 * comment, or NULL if the buddy has no comment. You should free 415 415 * this returned value! … … 436 436 * @param gn The group of the buddy. 437 437 * @param sn The name of the buddy. 438 * @return A pointer to a NULL terminated string that is the buddies 438 * @return A pointer to a NULL terminated string that is the buddies 439 439 * alias, or NULL if the buddy has no alias. You should free 440 440 * this returned value! … … 451 451 452 452 /** 453 * If there are changes, then create temporary items and 453 * If there are changes, then create temporary items and 454 454 * call addmoddel. 455 455 * … … 470 470 471 471 /* 472 * Compare the 2 lists and create an aim_ssi_tmp for each difference. 473 * We should only send either additions, modifications, or deletions 474 * before waiting for an acknowledgement. So first do deletions, then 475 * additions, then modifications. Also, both the official and the local 476 * list should be in ascending numerical order for the group ID#s and the 472 * Compare the 2 lists and create an aim_ssi_tmp for each difference. 473 * We should only send either additions, modifications, or deletions 474 * before waiting for an acknowledgement. So first do deletions, then 475 * additions, then modifications. Also, both the official and the local 476 * list should be in ascending numerical order for the group ID#s and the 477 477 * buddy ID#s, which makes things more efficient. I think. 478 478 */ … … 542 542 } 543 543 544 /* Make sure we don't send anything else between now 544 /* Make sure we don't send anything else between now 545 545 * and when we receive the ack for the following operation */ 546 546 sess->ssi.waiting_for_ack = 1; … … 885 885 886 886 /** 887 * Move a buddy from one group to another group. This basically just deletes the 887 * Move a buddy from one group to another group. This basically just deletes the 888 888 * buddy and re-adds it. 889 889 * … … 907 907 * @param gn The group that the buddy is currently in. 908 908 * @param sn The screen name of the buddy. 909 * @param alias The new alias for the buddy, or NULL if you want to remove 909 * @param alias The new alias for the buddy, or NULL if you want to remove 910 910 * a buddy's comment. 911 911 * @return Return 0 if no errors, otherwise return the error number. … … 939 939 * @param gn The group that the buddy is currently in. 940 940 * @param sn The screen name of the buddy. 941 * @param alias The new comment for the buddy, or NULL if you want to remove 941 * @param alias The new comment for the buddy, or NULL if you want to remove 942 942 * a buddy's comment. 943 943 * @return Return 0 if no errors, otherwise return the error number. … … 1003 1003 * 4 - Block only the users below 1004 1004 * 5 - Allow only users on my buddy list 1005 * @param vismask A bitmask of the class of users to whom you want to be 1005 * @param vismask A bitmask of the class of users to whom you want to be 1006 1006 * visible. See the AIM_FLAG_BLEH #defines in aim.h 1007 1007 * @return Return 0 if no errors, otherwise return the error number. … … 1069 1069 1070 1070 /** 1071 * Remove a reference to a server stored buddy icon. This will make your 1071 * Remove a reference to a server stored buddy icon. This will make your 1072 1072 * icon stop showing up to other people. 1073 1073 * … … 1173 1173 1174 1174 /* 1175 * Subtype 0x0004 - Request SSI Data when you don't have a timestamp and 1175 * Subtype 0x0004 - Request SSI Data when you don't have a timestamp and 1176 1176 * revision number. 1177 * 1177 * 1178 1178 */ 1179 1179 faim_export int aim_ssi_reqdata(aim_session_t *sess) … … 1191 1191 1192 1192 /* 1193 * Subtype 0x0005 - Request SSI Data when you have a timestamp and revision 1193 * Subtype 0x0005 - Request SSI Data when you have a timestamp and revision 1194 1194 * number. 1195 1195 * 1196 1196 * The data will only be sent if it is newer than the posted local 1197 1197 * timestamp and revision. 1198 * 1198 * 1199 1199 * Note that the client should never increment the revision, only the server. 1200 * 1200 * 1201 1201 */ 1202 1202 faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t timestamp, fu16_t numitems) … … 1281 1281 * presence information for everyone in your list and put your permit/deny 1282 1282 * settings into effect. 1283 * 1283 * 1284 1284 */ 1285 1285 faim_export int aim_ssi_enable(aim_session_t *sess) … … 1299 1299 * information. These 3 SNACs all have an identical structure. The only 1300 1300 * difference is the subtype that is set for the SNAC. 1301 * 1301 * 1302 1302 */ 1303 1303 faim_export int aim_ssi_addmoddel(aim_session_t *sess) … … 1497 1497 1498 1498 /* 1499 * If outcome is 0, then add the item to the item list, or replace the other item, 1500 * or remove the old item. If outcome is non-zero, then remove the item from the 1499 * If outcome is 0, then add the item to the item list, or replace the other item, 1500 * or remove the old item. If outcome is non-zero, then remove the item from the 1501 1501 * local list, or unmodify it, or add it. 1502 1502 */ … … 1626 1626 * 1627 1627 * Tells the server you're going to start modifying data. 1628 * 1628 * 1629 1629 */ 1630 1630 faim_export int aim_ssi_modbegin(aim_session_t *sess) … … 1806 1806 * Subtype 0x001a - Send authorization reply 1807 1807 * 1808 * Sends a reply to a request for authorization. The reply can either 1808 * Sends a reply to a request for authorization. The reply can either 1809 1809 * grant authorization or deny authorization. 1810 1810 * … … 1852 1852 /* 1853 1853 * Subtype 0x001b - Receive an authorization reply 1854 * You get this bad boy when other people respond to the authorization 1854 * You get this bad boy when other people respond to the authorization 1855 1855 * request that you have previously sent them. 1856 1856 */ -
libfaim/tlv.c
rcf02dd6 r7869e48 21 21 if (!oldtlv || !*oldtlv) 22 22 return; 23 23 24 24 free((*oldtlv)->value); 25 25 free(*oldtlv); … … 38 38 * 39 39 * XXX There should be a flag setable here to have the tlvlist contain 40 * bstream references, so that at least the ->value portion of each 40 * bstream references, so that at least the ->value portion of each 41 41 * element doesn't need to be malloc/memcpy'd. This could prove to be 42 42 * just as effecient as the in-place TLV parsing used in a couple places … … 48 48 { 49 49 aim_tlvlist_t *list = NULL, *cur; 50 50 51 51 while (aim_bstream_empty(bs) > 0) { 52 52 fu16_t type, length; … … 59 59 * Okay, so now AOL has decided that any TLV of 60 60 * type 0x0013 can only be two bytes, despite 61 * what the actual given length is. So here 61 * what the actual given length is. So here 62 62 * we dump any invalid TLVs of that sort. Hopefully 63 63 * theres no special cases to this special case. … … 92 92 } 93 93 if (cur->tlv->length > 0) { 94 cur->tlv->value = aimbs_getraw(bs, length); 94 cur->tlv->value = aimbs_getraw(bs, length); 95 95 if (!cur->tlv->value) { 96 96 freetlv(&cur->tlv); … … 118 118 * 119 119 * XXX There should be a flag setable here to have the tlvlist contain 120 * bstream references, so that at least the ->value portion of each 120 * bstream references, so that at least the ->value portion of each 121 121 * element doesn't need to be malloc/memcpy'd. This could prove to be 122 122 * just as effecient as the in-place TLV parsing used in a couple places … … 124 124 * 125 125 * @param bs Input bstream 126 * @param num The max number of TLVs that will be read, or -1 if unlimited. 127 * There are a number of places where you want to read in a tlvchain, 128 * but the chain is not at the end of the SNAC, and the chain is 126 * @param num The max number of TLVs that will be read, or -1 if unlimited. 127 * There are a number of places where you want to read in a tlvchain, 128 * but the chain is not at the end of the SNAC, and the chain is 129 129 * preceeded by the number of TLVs. So you can limit that with this. 130 130 */ … … 186 186 * 187 187 * XXX There should be a flag setable here to have the tlvlist contain 188 * bstream references, so that at least the ->value portion of each 188 * bstream references, so that at least the ->value portion of each 189 189 * element doesn't need to be malloc/memcpy'd. This could prove to be 190 190 * just as effecient as the in-place TLV parsing used in a couple places … … 193 193 * @param bs Input bstream 194 194 * @param len The max length in bytes that will be read. 195 * There are a number of places where you want to read in a tlvchain, 196 * but the chain is not at the end of the SNAC, and the chain is 195 * There are a number of places where you want to read in a tlvchain, 196 * but the chain is not at the end of the SNAC, and the chain is 197 197 * preceeded by the length of the TLVs. So you can limit that with this. 198 198 */ … … 264 264 265 265 /* 266 * Compare two TLV lists for equality. This probably is not the most 266 * Compare two TLV lists for equality. This probably is not the most 267 267 * efficient way to do this. 268 268 * … … 314 314 for (cur = *list; cur; ) { 315 315 aim_tlvlist_t *tmp; 316 316 317 317 freetlv(&cur->tlv); 318 318 … … 351 351 * 352 352 * @param list Chain to be sized 353 * @return The number of bytes that would be needed to 353 * @return The number of bytes that would be needed to 354 354 * write the passed TLV chain to a data buffer. 355 355 */ … … 528 528 * 529 529 * XXX should probably support sublists for real. 530 * 530 * 531 531 * This is so neat. 532 532 * … … 558 558 559 559 /** 560 * Substitute a TLV of a given type with a new TLV of the same type. If 561 * you attempt to replace a TLV that does not exist, this function will 560 * Substitute a TLV of a given type with a new TLV of the same type. If 561 * you attempt to replace a TLV that does not exist, this function will 562 562 * just add a new TLV as if you called aim_tlvlist_add_raw(). 563 563 * … … 591 591 592 592 /** 593 * Substitute a TLV of a given type with a new TLV of the same type. If 594 * you attempt to replace a TLV that does not exist, this function will 593 * Substitute a TLV of a given type with a new TLV of the same type. If 594 * you attempt to replace a TLV that does not exist, this function will 595 595 * just add a new TLV as if you called aim_tlvlist_add_raw(). 596 596 * … … 605 605 606 606 /** 607 * Substitute a TLV of a given type with a new TLV of the same type. If 608 * you attempt to replace a TLV that does not exist, this function will 607 * Substitute a TLV of a given type with a new TLV of the same type. If 608 * you attempt to replace a TLV that does not exist, this function will 609 609 * just add a new TLV as if you called aim_tlvlist_add_raw(). 610 610 * … … 624 624 625 625 /** 626 * Substitute a TLV of a given type with a new TLV of the same type. If 627 * you attempt to replace a TLV that does not exist, this function will 626 * Substitute a TLV of a given type with a new TLV of the same type. If 627 * you attempt to replace a TLV that does not exist, this function will 628 628 * just add a new TLV as if you called aim_tlvlist_add_raw(). 629 629 * … … 643 643 644 644 /** 645 * Remove a TLV of a given type. If you attempt to remove a TLV that 645 * Remove a TLV of a given type. If you attempt to remove a TLV that 646 646 * does not exist, nothing happens. 647 647 * … … 682 682 * 683 683 * Copies a TLV chain into a raw data buffer, writing only the number 684 * of bytes specified. This operation does not free the chain; 684 * of bytes specified. This operation does not free the chain; 685 685 * aim_tlvlist_free() must still be called to free up the memory used 686 686 * by the chain structures. 687 687 * 688 * XXX clean this up, make better use of bstreams 688 * XXX clean this up, make better use of bstreams 689 689 */ 690 690 faim_internal int aim_tlvlist_write(aim_bstream_t *bs, aim_tlvlist_t **list) … … 714 714 * Grab the Nth TLV of type type in the TLV list list. 715 715 * 716 * Returns a pointer to an aim_tlv_t of the specified type; 716 * Returns a pointer to an aim_tlv_t of the specified type; 717 717 * %NULL on error. The @nth parameter is specified starting at %1. 718 718 * In most cases, there will be no more than one TLV of any type … … 747 747 * @param type TLV type to search for. 748 748 * @param nth Index of TLV to return. 749 * @return The value of the TLV you were looking for, or NULL if one could 750 * not be found. This is a dynamic buffer and must be freed by the 749 * @return The value of the TLV you were looking for, or NULL if one could 750 * not be found. This is a dynamic buffer and must be freed by the 751 751 * caller. 752 752 */ … … 767 767 768 768 /** 769 * Retrieve the data from the nth TLV in the given TLV chain as an 8bit 769 * Retrieve the data from the nth TLV in the given TLV chain as an 8bit 770 770 * integer. 771 771 * … … 773 773 * @param type TLV type to search for. 774 774 * @param nth Index of TLV to return. 775 * @return The value the TLV you were looking for, or 0 if one could 775 * @return The value the TLV you were looking for, or 0 if one could 776 776 * not be found. 777 777 */ … … 786 786 787 787 /** 788 * Retrieve the data from the nth TLV in the given TLV chain as a 16bit 788 * Retrieve the data from the nth TLV in the given TLV chain as a 16bit 789 789 * integer. 790 790 * … … 792 792 * @param type TLV type to search for. 793 793 * @param nth Index of TLV to return. 794 * @return The value the TLV you were looking for, or 0 if one could 794 * @return The value the TLV you were looking for, or 0 if one could 795 795 * not be found. 796 796 */ … … 805 805 806 806 /** 807 * Retrieve the data from the nth TLV in the given TLV chain as a 32bit 807 * Retrieve the data from the nth TLV in the given TLV chain as a 32bit 808 808 * integer. 809 809 * … … 811 811 * @param type TLV type to search for. 812 812 * @param nth Index of TLV to return. 813 * @return The value the TLV you were looking for, or 0 if one could 813 * @return The value the TLV you were looking for, or 0 if one could 814 814 * not be found. 815 815 */ -
libfaim/translate.c
r862371b r7869e48 7 7 * 8 8 * But we advertise it anyway, because its fun. 9 * 9 * 10 10 */ 11 11 -
libfaim/txqueue.c
rcf02dd6 r7869e48 53 53 memset(fr, 0, sizeof(aim_frame_t)); 54 54 55 fr->conn = conn; 55 fr->conn = conn; 56 56 57 57 fr->hdrtype = framing; … … 65 65 fr->hdr.rend.type = chan; 66 66 67 } else 67 } else 68 68 faimdprintf(sess, 0, "tx_new: unknown framing\n"); 69 69 … … 133 133 * Basically the same as its __queuebased couterpart, however 134 134 * instead of doing a list append, it just calls aim_tx_sendframe() 135 * right here. 136 * 135 * right here. 136 * 137 137 */ 138 138 static int aim_tx_enqueue__immediate(aim_session_t *sess, aim_frame_t *fr) … … 159 159 faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *)) 160 160 { 161 161 162 162 if (what == AIM_TX_QUEUED) 163 163 sess->tx_enqueue = &aim_tx_enqueue__queuebased; 164 else if (what == AIM_TX_IMMEDIATE) 164 else if (what == AIM_TX_IMMEDIATE) 165 165 sess->tx_enqueue = &aim_tx_enqueue__immediate; 166 166 else if (what == AIM_TX_USER) { … … 176 176 faim_internal int aim_tx_enqueue(aim_session_t *sess, aim_frame_t *fr) 177 177 { 178 178 179 179 /* 180 180 * If we want to send a connection thats inprogress, we have to force … … 182 182 * want. 183 183 */ 184 if (fr && fr->conn && 184 if (fr && fr->conn && 185 185 (fr->conn->status & AIM_CONN_STATUS_INPROGRESS)) { 186 186 return aim_tx_enqueue__queuebased(sess, fr); … … 190 190 } 191 191 192 /* 192 /* 193 193 * aim_get_next_txseqnum() 194 194 * … … 202 202 { 203 203 flap_seqnum_t ret; 204 204 205 205 ret = ++conn->seqnum; 206 206 … … 238 238 239 239 if (count) { 240 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 240 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 241 241 (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM)) { 242 242 /* I strongly suspect that this is a horrible thing to do … … 246 246 while (count - wrote > 1024) { 247 247 wrote = wrote + aim_send(conn->fd, bs->data + bs->offset + wrote, 1024); 248 if ((userfunc=aim_callhandler(conn->sessv, conn, 249 AIM_CB_FAM_SPECIAL, 248 if ((userfunc=aim_callhandler(conn->sessv, conn, 249 AIM_CB_FAM_SPECIAL, 250 250 AIM_CB_SPECIAL_IMAGETRANSFER))) 251 userfunc(conn->sessv, NULL, sn, 251 userfunc(conn->sessv, NULL, sn, 252 252 count-wrote>1024 ? ((double)wrote / count) : 1); 253 253 } … … 265 265 faimdprintf(sess, 2, "\nOutgoing data: (%d bytes)", wrote); 266 266 for (i = 0; i < wrote; i++) { 267 if (!(i % 8)) 267 if (!(i % 8)) 268 268 faimdprintf(sess, 2, "\n\t"); 269 269 faimdprintf(sess, 2, "0x%02x ", *(bs->data + bs->offset + i)); … … 304 304 if (aim_bstream_send(&obs, fr->conn, obslen) != obslen) 305 305 err = -errno; 306 306 307 307 free(obs_raw); /* XXX aim_bstream_free */ 308 308 … … 372 372 */ 373 373 if ((cur->conn->lastactivity + cur->conn->forcedlatency) >= time(NULL)) { 374 /* 375 * XXX should be a break! we dont want to block the 374 /* 375 * XXX should be a break! we dont want to block the 376 376 * upper layers 377 377 * … … 394 394 /* 395 395 * aim_tx_purgequeue() 396 * 397 * This is responsable for removing sent commands from the transmit 396 * 397 * This is responsable for removing sent commands from the transmit 398 398 * queue. This is not a required operation, but it of course helps 399 * reduce memory footprint at run time! 399 * reduce memory footprint at run time! 400 400 * 401 401 */ -
libfaim/util.c
re374dee r7869e48 160 160 /* 161 161 * int snlen(const char *) 162 * 162 * 163 163 * This takes a screen name and returns its length without 164 * spaces. If there are no spaces in the SN, then the 164 * spaces. If there are no spaces in the SN, then the 165 165 * return is equal to that of strlen(). 166 166 * … … 188 188 * on screen names for AIM/AOL. Mainly, this means case and space 189 189 * insensitivity (all case differences and spacing differences are 190 * ignored, with the exception that screen names can not start with 190 * ignored, with the exception that screen names can not start with 191 191 * a space). 192 192 * -
logging.c
r0792d99 r7869e48 55 55 /* skip login/logout messages if appropriate */ 56 56 if (!owl_global_is_loglogins(&g) && owl_message_is_loginout(m)) return(0); 57 57 58 58 /* check direction */ 59 59 if ((owl_global_get_loggingdirection(&g)==OWL_LOGGING_DIRECTION_IN) && owl_message_is_direction_out(m)) { … … 83 83 buffer = g_string_new(""); 84 84 tmp = short_zuser(owl_message_get_sender(m)); 85 g_string_append_printf(buffer, "Class: %s Instance: %s", 86 owl_message_get_class(m), 85 g_string_append_printf(buffer, "Class: %s Instance: %s", 86 owl_message_get_class(m), 87 87 owl_message_get_instance(m)); 88 88 if (strcmp(owl_message_get_opcode(m), "")) { 89 g_string_append_printf(buffer, " Opcode: %s", 89 g_string_append_printf(buffer, " Opcode: %s", 90 90 owl_message_get_opcode(m)); 91 91 } 92 92 g_string_append_printf(buffer, "\n"); 93 g_string_append_printf(buffer, "Time: %s Host: %s\n", 94 owl_message_get_timestr(m), 93 g_string_append_printf(buffer, "Time: %s Host: %s\n", 94 owl_message_get_timestr(m), 95 95 owl_message_get_hostname(m)); 96 g_string_append_printf(buffer, "From: %s <%s>\n\n", 96 g_string_append_printf(buffer, "From: %s <%s>\n\n", 97 97 owl_message_get_zsig(m), tmp); 98 98 g_string_append_printf(buffer, "%s\n\n", owl_message_get_body(m)); … … 105 105 GString *buffer = NULL; 106 106 buffer = g_string_new(""); 107 g_string_append_printf(buffer, "From: <%s> To: <%s>\n", 107 g_string_append_printf(buffer, "From: <%s> To: <%s>\n", 108 108 owl_message_get_sender(m), owl_message_get_recipient(m)); 109 g_string_append_printf(buffer, "Time: %s\n\n", 109 g_string_append_printf(buffer, "Time: %s\n\n", 110 110 owl_message_get_timestr(m)); 111 111 if (owl_message_is_login(m)) { … … 124 124 buffer = g_string_new(""); 125 125 g_string_append_printf(buffer, "From: <%s> To: <%s>\n", 126 owl_message_get_sender(m), 126 owl_message_get_sender(m), 127 127 owl_message_get_recipient(m)); 128 g_string_append_printf(buffer, "Time: %s\n\n", 128 g_string_append_printf(buffer, "Time: %s\n\n", 129 129 owl_message_get_timestr(m)); 130 130 g_string_append_printf(buffer, "%s\n\n", owl_message_get_body(m)); … … 136 136 GString *buffer; 137 137 buffer = g_string_new(""); 138 g_string_append_printf(buffer, "From: <%s> To: <%s>\n", 139 owl_message_get_sender(m), 138 g_string_append_printf(buffer, "From: <%s> To: <%s>\n", 139 owl_message_get_sender(m), 140 140 owl_message_get_recipient(m)); 141 g_string_append_printf(buffer, "Time: %s\n\n", 141 g_string_append_printf(buffer, "Time: %s\n\n", 142 142 owl_message_get_timestr(m)); 143 g_string_append_printf(buffer, "%s\n\n", 143 g_string_append_printf(buffer, "%s\n\n", 144 144 owl_message_get_body(m)); 145 145 return g_string_free(buffer, FALSE); … … 183 183 void owl_log_enqueue_message(const char *buffer, const char *filename) 184 184 { 185 owl_log_entry *log_msg = NULL; 185 owl_log_entry *log_msg = NULL; 186 186 log_msg = g_new(owl_log_entry,1); 187 187 log_msg->message = g_strdup(buffer); 188 188 log_msg->filename = g_strdup(filename); 189 owl_select_post_task(owl_log_write_entry, log_msg, 189 owl_select_post_task(owl_log_write_entry, log_msg, 190 190 owl_log_entry_free, log_context); 191 191 } … … 353 353 } else if (owl_message_is_type_jabber(m)) { 354 354 if (personal) { 355 from=frombuff=g_strdup_printf("jabber:%s", 355 from=frombuff=g_strdup_printf("jabber:%s", 356 356 owl_message_get_sender(m)); 357 357 } else { 358 from=frombuff=g_strdup_printf("jabber:%s", 358 from=frombuff=g_strdup_printf("jabber:%s", 359 359 owl_message_get_recipient(m)); 360 360 } … … 362 362 from=frombuff=g_strdup("unknown"); 363 363 } 364 364 365 365 /* check for malicious sender formats */ 366 366 len=strlen(frombuff); … … 434 434 } 435 435 436 void owl_log_init(void) 436 void owl_log_init(void) 437 437 { 438 438 log_context = g_main_context_new(); … … 454 454 } 455 455 #endif 456 456 457 457 } 458 458 -
m4/pkg.m4
r650fb2c r7869e48 1 1 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 2 2 # serial 1 (pkg-config-0.24) 3 # 3 # 4 4 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 5 5 # … … 124 124 if test $_pkg_short_errors_supported = yes; then 125 125 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 126 else 126 else 127 127 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 128 128 fi -
mainwin.c
rab88b05 r7869e48 142 142 if (m==owl_view_get_element(v, curmsg)) { 143 143 wmove(recwin, savey, 0); 144 wattron(recwin, A_BOLD); 144 wattron(recwin, A_BOLD); 145 145 if (owl_global_get_curmsg_vert_offset(&g)>0) { 146 146 waddstr(recwin, "+"); -
message.c
r2354e9a r7869e48 40 40 owl_message_set_hostname(m, ""); 41 41 m->attributes = g_ptr_array_new(); 42 42 43 43 /* save the time */ 44 44 m->time = time(NULL); … … 250 250 { 251 251 const char *realm; 252 252 253 253 realm=owl_message_get_attribute_value(m, "realm"); 254 254 if (!realm) return(""); … … 382 382 return !strcasecmp(t, type); 383 383 } 384 384 385 385 int owl_message_is_type_admin(const owl_message *m) 386 386 { … … 528 528 owl_fmtext_init_null(&a); 529 529 owl_fmtext_init_null(&b); 530 530 531 531 owl_fmtext_truncate_lines(&(m->fmtext->fmtext), aline, bline-aline, &a); 532 532 owl_fmtext_truncate_cols(&a, acol, bcol, &b); … … 684 684 685 685 owl_message_format(m); /* is this necessary? */ 686 686 687 687 return owl_fmtext_search(&(m->fmtext->fmtext), re, 0) >= 0; 688 688 } … … 785 785 786 786 owl_message_init(m); 787 787 788 788 owl_message_set_type_zephyr(m); 789 789 owl_message_set_direction_in(m); 790 790 791 791 /* first save the full notice */ 792 792 m->notice = *n; … … 795 795 /* a little gross, we'll replace \r's with ' ' for now */ 796 796 owl_zephyr_hackaway_cr(&(m->notice)); 797 797 798 798 /* save the time, we need to nuke the string saved by message_init */ 799 799 if (m->timestr) g_free(m->timestr); … … 835 835 } 836 836 837 837 838 838 /* set the "isprivate" attribute if it's a private zephyr. */ 839 839 if (owl_zwrite_recip_is_personal(n->z_recipient)) { … … 922 922 memset(&(m->notice), 0, sizeof(ZNotice_t)); 923 923 #endif 924 924 925 925 longuser=long_zuser(user); 926 926 927 927 owl_message_init(m); 928 928 929 929 owl_message_set_type_zephyr(m); 930 930 owl_message_set_direction_in(m); … … 959 959 { 960 960 char *replyline; 961 961 962 962 owl_message_init(m); 963 963 … … 992 992 owl_message_set_body(m, body); 993 993 owl_message_set_zsig(m, owl_zwrite_get_zsig(z)); 994 994 995 995 /* save the hostname */ 996 996 owl_message_set_hostname(m, g_get_host_name()); … … 1008 1008 int i; 1009 1009 owl_pair *p; 1010 #ifdef HAVE_LIBZEPHYR 1010 #ifdef HAVE_LIBZEPHYR 1011 1011 if (m->has_notice) { 1012 1012 ZFreeNotice(&(m->notice)); … … 1023 1023 1024 1024 g_ptr_array_free(m->attributes, true); 1025 1025 1026 1026 owl_message_invalidate_format(m); 1027 1027 } -
msgwin.c
rd4927a7 r7869e48 19 19 werase(curswin); 20 20 if (msgwin->msg) 21 waddstr(curswin, msgwin->msg); 21 waddstr(curswin, msgwin->msg); 22 22 } 23 23 -
owl.c
r4d9e311c r7869e48 311 311 char utf8buf[7]; 312 312 memset(utf8buf, '\0', 7); 313 313 314 314 utf8buf[0] = j.ch; 315 315 316 316 if ((j.ch & 0xc0) && (~j.ch & 0x20)) bytes = 2; 317 317 else if ((j.ch & 0xe0) && (~j.ch & 0x10)) bytes = 3; … … 320 320 else if ((j.ch & 0xfc) && (~j.ch & 0x02)) bytes = 6; 321 321 else bytes = 1; 322 322 323 323 for (i = 1; i < bytes; i++) { 324 324 int tmp = wgetch(g->input_pad); … … 333 333 utf8buf[i] = tmp; 334 334 } 335 335 336 336 if (j.ch != ERR) { 337 337 if (g_utf8_validate(utf8buf, -1, NULL)) { … … 376 376 /* Send a message to the main thread. */ 377 377 owl_select_post_task(sig_handler_main_thread, 378 GINT_TO_POINTER(siginfo->si_signo), 378 GINT_TO_POINTER(siginfo->si_signo), 379 379 NULL, g_main_context_default()); 380 380 } … … 421 421 #if OWL_STDERR_REDIR 422 422 423 /* Replaces stderr with a pipe so that we can read from it. 423 /* Replaces stderr with a pipe so that we can read from it. 424 424 * Returns the fd of the pipe from which stderr can be read. */ 425 425 int stderr_replace(void) -
owl.h
rc42a8d1 r7869e48 74 74 #endif /* !OWL_VERSION_STRING */ 75 75 76 /* Feature that is being tested to redirect stderr through a pipe. 76 /* Feature that is being tested to redirect stderr through a pipe. 77 77 * There may still be some portability problems with this. */ 78 78 #define OWL_STDERR_REDIR 1 … … 243 243 int (*validate_fn)(const struct _owl_variable *v, const void *newval); 244 244 /* returns 1 if newval is valid */ 245 int (*set_fn)(struct _owl_variable *v, const void *newval); 245 int (*set_fn)(struct _owl_variable *v, const void *newval); 246 246 /* sets the variable to a value 247 247 * of the appropriate type. 248 * unless documented, this 249 * should make a copy. 248 * unless documented, this 249 * should make a copy. 250 250 * returns 0 on success. */ 251 251 int (*set_fromstring_fn)(struct _owl_variable *v, const char *newval); 252 252 /* sets the variable to a value 253 253 * of the appropriate type. 254 * unless documented, this 255 * should make a copy. 254 * unless documented, this 255 * should make a copy. 256 256 * returns 0 on success. */ 257 257 const void *(*get_fn)(const struct _owl_variable *v); … … 313 313 314 314 char *cmd_aliased_to; /* what this command is aliased to... */ 315 315 316 316 /* These don't take any context */ 317 317 CALLER_OWN char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff); … … 406 406 owl_window *cmdwin; 407 407 } owl_viewwin; 408 408 409 409 typedef struct _owl_popwin { 410 410 owl_window *border; … … 413 413 gulong sig_resize_id; 414 414 } owl_popwin; 415 415 416 416 typedef struct _owl_msgwin { 417 417 char *msg; -
perl/lib/BarnOwl.pm
rb303ba2 r7869e48 661 661 =head3 random_zephyr_signature 662 662 663 Retrieve a random line from ~/.zsigs (except those beginning with '#') 663 Retrieve a random line from ~/.zsigs (except those beginning with '#') 664 664 and use it as the zephyr signature. 665 665 -
perl/lib/BarnOwl/Complete/Filter.pm
r6dba228 r7869e48 81 81 return $INCOMPLETE if $i == $INCOMPLETE; 82 82 } 83 83 84 84 return $i; # Well, it looks like we're happy 85 85 # (Actually, I'm pretty sure this never happens...) -
perl/lib/BarnOwl/Completion/Util.pm
re6cec01 r7869e48 108 108 109 109 my ($pfx, $base) = splitfile($string); 110 110 111 111 opendir(my $dh, $dir) or return; 112 112 my @dirs = readdir($dh); … … 119 119 next; 120 120 } 121 121 122 122 my ($text, $value, $done) = ($d, "${pfx}${d}", 1); 123 123 -
perl/lib/BarnOwl/Hooks.pm
rb8a3e00 r7869e48 12 12 13 13 C<BarnOwl::Hooks> exports a set of C<BarnOwl::Hook> objects made 14 available by BarnOwl internally. 14 available by BarnOwl internally. 15 15 16 16 =head2 USAGE … … 135 135 package BarnOwl; 136 136 if(*BarnOwl::format_msg{CODE}) { 137 # if the config defines a legacy formatting function, add 'perl' as a style 137 # if the config defines a legacy formatting function, add 'perl' as a style 138 138 BarnOwl::create_style("perl", BarnOwl::Style::Legacy->new( 139 139 "BarnOwl::format_msg", … … 163 163 BarnOwl::error("Can't load BarnOwl::ModuleLoader, loadable module support disabled:\n$@"); 164 164 } 165 165 166 166 $mainLoop->check_owlconf(); 167 167 $startup->run(0); … … 171 171 sub _shutdown { 172 172 $shutdown->run; 173 173 174 174 BarnOwl::shutdown() if *BarnOwl::shutdown{CODE}; 175 175 } … … 179 179 180 180 $receiveMessage->run($m); 181 181 182 182 BarnOwl::receive_msg($m) if *BarnOwl::receive_msg{CODE}; 183 183 } … … 187 187 188 188 $newMessage->run($m); 189 189 190 190 BarnOwl::new_msg($m) if *BarnOwl::new_msg{CODE}; 191 191 } -
perl/lib/BarnOwl/Message/Zephyr.pm
r6401db3 r7869e48 165 165 } elsif($sender && !$self->is_private) { 166 166 # Possible future feature: (Optionally?) include the class and/or 167 # instance of the message being replied to in the instance of the 167 # instance of the message being replied to in the instance of the 168 168 # outgoing personal reply 169 169 $class = 'MESSAGE'; -
perl/modules/Facebook/lib/Facebook/Graph.pm
r5ef98c7 r7869e48 87 87 } 88 88 89 sub authorize { 89 sub authorize { 90 90 my ($self) = @_; 91 91 return Facebook::Graph::Authorize->new( … … 302 302 my $sarah_bownds = $fb->fetch('sarahbownds'); 303 303 my $perl_page = $fb->fetch('16665510298'); 304 304 305 305 Or better yet: 306 306 … … 311 311 ->request 312 312 ->as_hashref; 313 313 314 314 my $sarahs_picture_uri = $fb->picture('sarahbownds')->get_large->uri_as_string; 315 315 … … 319 319 ->request('https://graph.facebook.com/btaylor') 320 320 ->as_hashref; 321 322 321 322 323 323 =head2 Building A Privileged App 324 324 … … 342 342 my $q = Plack::Request->new($env); 343 343 $fb->request_access_token($q->query_param('code')); 344 344 345 345 Or if you already had the access token: 346 346 347 347 $fb->access_token($token); 348 348 349 349 Get some info: 350 350 … … 419 419 420 420 my $sarah = $fb->fetch('sarahbownds'); 421 421 422 422 my $sarah = $fb->query->find('sarahbownds')->request->as_hashref; 423 423 -
perl/modules/Facebook/lib/Facebook/Graph/Cookbook/Recipe1.pod
r2a42248 r7869e48 64 64 65 65 my $urlmap = Plack::App::URLMap->new; 66 66 67 67 # your code will go here 68 68 69 69 $urlmap->to_app; 70 70 71 All the code we have you add should go in the C<# your code will go here> block, in the order that we have you add it. 72 71 All the code we have you add should go in the C<# your code will go here> block, in the order that we have you add it. 72 73 73 =head2 Step 6: Create your Facebook::Graph object. 74 74 … … 80 80 secret => 'Put Your Application Secret Here', 81 81 ); 82 82 83 83 Now you need the URL you entered in step 3, and the application ID and secret you got in step 4. 84 84 … … 186 186 187 187 sudo plackup --port 80 app.psgi 188 188 189 189 Now we point our browser to: 190 190 191 191 http://www.yourapplication.com/facebook 192 192 193 193 Voila! You have created an authenticated Facebook app. If you would like to see this full program check out C<eg/recipe1.psgi> inside this distribution of L<Facebook::Graph>. 194 194 … … 196 196 =head1 CAVEATS 197 197 198 You should never design an application using all the poor stuff we've done here, like using a shared L<Facebook::Graph> object, not using a Framework/CMS or at least L<Plack::Builder>, not using a templating system, passing the offline access token through the URL, etc. We've made comments about these things as we did them to warn you. These choices were made here B<only> because this is example code who's primary purpose is to show you how to use L<Facebook::Graph>, and not best practices for web development. 198 You should never design an application using all the poor stuff we've done here, like using a shared L<Facebook::Graph> object, not using a Framework/CMS or at least L<Plack::Builder>, not using a templating system, passing the offline access token through the URL, etc. We've made comments about these things as we did them to warn you. These choices were made here B<only> because this is example code who's primary purpose is to show you how to use L<Facebook::Graph>, and not best practices for web development. 199 199 200 200 =head1 SEE ALSO -
perl/modules/Facebook/lib/Facebook/Graph/Cookbook/Recipe2.pod
r2a42248 r7869e48 15 15 You'll need to have all of the following modules installed in order to run this app (in addition to L<Facebook::Graph>): 16 16 17 L<DateTime::Format::ICal> L<Dancer> L<Template> L<Data::ICal> L<XML::FeedPP> 17 L<DateTime::Format::ICal> L<Dancer> L<Template> L<Data::ICal> L<XML::FeedPP> 18 18 19 19 =head2 Assumptions … … 65 65 mkdir -p /opt/webapp 66 66 cp -Rfp Facebook-Graph/eg/recipe2/* /opt/webapp 67 67 68 68 =head2 Step 6: Configure your app. 69 69 … … 73 73 vi config.yml 74 74 75 Specifically we need to set the C<app_id> and C<secret> fields with information from our Facebook application settings page. And we need to update the C<postback> with the domain pointing to our server. 75 Specifically we need to set the C<app_id> and C<secret> fields with information from our Facebook application settings page. And we need to update the C<postback> with the domain pointing to our server. 76 76 77 77 =head2 Step 7: Start it. -
perl/modules/Facebook/lib/Facebook/Graph/Picture.pm
r2a42248 r7869e48 63 63 64 64 my $fb = Facebook::Graph->new; 65 65 66 66 my $default_picture = $fb->picture('16665510298')->uri_as_string; 67 67 my $large_picture = $fb->picture('16665510298')->get_large->uri_as_string; -
perl/modules/Facebook/lib/Facebook/Graph/Publish.pm
rfe03126 r7869e48 77 77 =head1 DESCRIPTION 78 78 79 This module shouldn't be used by you directly for any purpose. 79 This module shouldn't be used by you directly for any purpose. 80 80 81 81 =head1 LEGAL -
perl/modules/Facebook/lib/Facebook/Graph/Publish/Event.pm
r2a42248 r7869e48 183 183 184 184 {"id":"1647395831_130068550371568"} 185 186 185 186 187 187 =head1 TODO 188 188 -
perl/modules/Facebook/lib/Facebook/Graph/Publish/Post.pm
r2a42248 r7869e48 381 381 =head2 set_privacy ( setting, options ) 382 382 383 A completely optional privacy setting. 383 A completely optional privacy setting. 384 384 385 385 =head2 set_properties ( properties ) … … 425 425 426 426 $post->set_target_countries( ['US'] ); 427 427 428 428 =head3 countries 429 429 … … 436 436 437 437 $post->set_target_regions( [6,53] ); 438 438 439 439 =head3 regions 440 440 … … 448 448 449 449 $post->set_target_cities( [2547804] ); 450 450 451 451 =head3 cities 452 452 … … 460 460 461 461 $post->set_target_locales( [6] ); 462 462 463 463 =head3 locales 464 464 -
perl/modules/Facebook/lib/Facebook/Graph/Query.pm
rb7fa912 r7869e48 79 79 my ($self, $limit) = @_; 80 80 $self->limit($limit); 81 return $self; 81 return $self; 82 82 } 83 83 … … 109 109 my ($self, $offset) = @_; 110 110 $self->offset($offset); 111 return $self; 111 return $self; 112 112 } 113 113 … … 215 215 216 216 my $fb = Facebook::Graph->new; 217 217 218 218 my $perl_page = $fb->find('16665510298') 219 219 ->include_metadata 220 220 ->request 221 221 ->as_hashref; 222 222 223 223 my $sarah_bownds = $fb->find('sarahbownds') 224 224 ->select_fields(qw(id name)) … … 254 254 ->request 255 255 ->as_hashref; 256 256 257 257 The above query, if you were read it like text, says: "Give me the user ids and full names of all users named Dave that have been created since yesterday, and limit the result set to the first 25." 258 258 … … 314 314 =head2 search ( query, context ) 315 315 316 Perform a keyword search on a group of items. 316 Perform a keyword search on a group of items. 317 317 318 318 If you prefer not to search by keyword see the C<from> method. -
perl/modules/Facebook/lib/Facebook/Graph/Role/Uri.pm
r2a42248 r7869e48 24 24 =head1 DESCRIPTION 25 25 26 Provides a C<uri> method in any class which returns a L<URI> object that points to the Facebook Graph API. 26 Provides a C<uri> method in any class which returns a L<URI> object that points to the Facebook Graph API. 27 27 28 28 =head1 LEGAL -
perl/modules/IRC/inc/Module/Install/Fetch.pm
r43c62e4 r7869e48 14 14 sub get_file { 15 15 my ($self, %args) = @_; 16 my ($scheme, $host, $path, $file) = 16 my ($scheme, $host, $path, $file) = 17 17 $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; 18 18 … … 20 20 $args{url} = $args{ftp_url} 21 21 or (warn("LWP support unavailable!\n"), return); 22 ($scheme, $host, $path, $file) = 22 ($scheme, $host, $path, $file) = 23 23 $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; 24 24 } -
perl/modules/IRC/inc/Module/Install/Makefile.pm
r43c62e4 r7869e48 65 65 my $clean = $self->makemaker_args->{clean} ||= {}; 66 66 %$clean = ( 67 %$clean, 67 %$clean, 68 68 FILES => join(' ', grep length, $clean->{FILES}, @_), 69 69 ); … … 74 74 my $realclean = $self->makemaker_args->{realclean} ||= {}; 75 75 %$realclean = ( 76 %$realclean, 76 %$realclean, 77 77 FILES => join(' ', grep length, $realclean->{FILES}, @_), 78 78 ); … … 181 181 my $top_version = $self->_top->VERSION || ''; 182 182 183 my $preamble = $self->preamble 183 my $preamble = $self->preamble 184 184 ? "# Preamble by $top_class $top_version\n" 185 185 . $self->preamble -
perl/modules/IRC/inc/Module/Install/Metadata.pm
r43c62e4 r7869e48 282 282 $author =~ s{E<lt>}{<}g; 283 283 $author =~ s{E<gt>}{>}g; 284 $self->author($author); 284 $self->author($author); 285 285 } 286 286 else { -
perl/modules/IRC/inc/Module/Install/Win32.pm
r43c62e4 r7869e48 17 17 $self->load('can_run'); 18 18 $self->load('get_file'); 19 19 20 20 require Config; 21 21 return unless ( -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r13ee8f2 r7869e48 412 412 $self->{reconnect_timer}->stop; 413 413 } 414 $self->{reconnect_timer} = 414 $self->{reconnect_timer} = 415 415 BarnOwl::Timer->new( { 416 416 name => 'IRC (' . $self->alias . ') reconnect_timer', … … 472 472 $body =~ s/\cC\d+(?:,\d+)?//g; 473 473 $body =~ s/\cO//g; 474 474 475 475 my @pieces = split /\cB/, $body; 476 476 my $out = ''; -
perl/modules/Jabber/inc/Module/Install/Fetch.pm
r300b470 r7869e48 14 14 sub get_file { 15 15 my ($self, %args) = @_; 16 my ($scheme, $host, $path, $file) = 16 my ($scheme, $host, $path, $file) = 17 17 $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; 18 18 … … 20 20 $args{url} = $args{ftp_url} 21 21 or (warn("LWP support unavailable!\n"), return); 22 ($scheme, $host, $path, $file) = 22 ($scheme, $host, $path, $file) = 23 23 $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; 24 24 } -
perl/modules/Jabber/inc/Module/Install/Makefile.pm
r300b470 r7869e48 65 65 my $clean = $self->makemaker_args->{clean} ||= {}; 66 66 %$clean = ( 67 %$clean, 67 %$clean, 68 68 FILES => join(' ', grep length, $clean->{FILES}, @_), 69 69 ); … … 74 74 my $realclean = $self->makemaker_args->{realclean} ||= {}; 75 75 %$realclean = ( 76 %$realclean, 76 %$realclean, 77 77 FILES => join(' ', grep length, $realclean->{FILES}, @_), 78 78 ); … … 156 156 my $top_version = $self->_top->VERSION || ''; 157 157 158 my $preamble = $self->preamble 158 my $preamble = $self->preamble 159 159 ? "# Preamble by $top_class $top_version\n" 160 160 . $self->preamble -
perl/modules/Jabber/inc/Module/Install/Metadata.pm
r300b470 r7869e48 273 273 $author =~ s{E<lt>}{<}g; 274 274 $author =~ s{E<gt>}{>}g; 275 $self->author($author); 275 $self->author($author); 276 276 } 277 277 else { -
perl/modules/Jabber/inc/Module/Install/Win32.pm
r300b470 r7869e48 17 17 $self->load('can_run'); 18 18 $self->load('get_file'); 19 19 20 20 require Config; 21 21 return unless ( -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r678f607 r7869e48 1050 1050 sid => $sid } ); 1051 1051 $jhash{type} = 'admin'; 1052 1052 1053 1053 BarnOwl::queue_message( BarnOwl::Message->new(%jhash) ); 1054 1054 } -
perl/modules/Jabber/lib/Net/Jabber/Client.pm
rc2bed55 r7869e48 70 70 use Net::Jabber::Protocol; 71 71 use base qw( Net::XMPP::Client Net::Jabber::Protocol ); 72 use vars qw( $VERSION ); 72 use vars qw( $VERSION ); 73 73 74 74 $VERSION = "2.0"; -
perl/modules/Jabber/lib/Net/Jabber/Component.pm
ra8c55b5 r7869e48 95 95 defaults for the two are localhost 96 96 and 5269. 97 97 98 98 Note: A change from previous 99 99 versions is that Component now … … 160 160 0 - Status ok, no data received. 161 161 undef - Status not ok, stop processing. 162 162 163 163 IMPORTANT: You need to check the output of every 164 164 Process. If you get an undef then the connection … … 196 196 bless($self, $proto); 197 197 $self->init(@_); 198 198 199 199 $self->{SERVER}->{port} = 5269; 200 200 $self->{SERVER}->{namespace} = "jabber:component:accept"; 201 201 $self->{SERVER}->{allow_register} = 0; 202 202 203 203 return $self; 204 204 } … … 217 217 my $self = shift; 218 218 my (%args) = @_; 219 219 220 220 $self->{STREAM}->SetCallBacks(node=>undef); 221 221 … … 248 248 my $self = shift; 249 249 my (%args) = @_; 250 250 251 251 my %connect; 252 252 $connect{componentname} = $args{componentname}; … … 257 257 $connect{tls} = $args{tls} if exists($args{tls}); 258 258 259 259 260 260 return %connect; 261 261 } -
perl/modules/Jabber/lib/Net/Jabber/Data.pm
rcdd3959 r7869e48 44 44 jabber:iq:roster 45 45 46 For more information on what these namespaces are for, visit 46 For more information on what these namespaces are for, visit 47 47 http://www.jabber.org and browse the Jabber Programmers Guide. 48 48 -
perl/modules/Jabber/lib/Net/Jabber/Dialback/Result.pm
rc2bed55 r7869e48 144 144 =head2 Test functions 145 145 146 DefinedTo() - returns 1 if the to attribute is defined in the 146 DefinedTo() - returns 1 if the to attribute is defined in the 147 147 <db:result/>, 0 otherwise. 148 148 149 DefinedFrom() - returns 1 if the from attribute is defined in the 149 DefinedFrom() - returns 1 if the from attribute is defined in the 150 150 <db:result/>, 0 otherwise. 151 151 152 DefinedType() - returns 1 if the type attribute is defined in the 152 DefinedType() - returns 1 if the type attribute is defined in the 153 153 <db:result/>, 0 otherwise. 154 154 -
perl/modules/Jabber/lib/Net/Jabber/Dialback/Verify.pm
rc2bed55 r7869e48 151 151 =head2 Test functions 152 152 153 DefinedTo() - returns 1 if the to attribute is defined in the 153 DefinedTo() - returns 1 if the to attribute is defined in the 154 154 <db:verify/>, 0 otherwise. 155 155 156 DefinedFrom() - returns 1 if the from attribute is defined in the 156 DefinedFrom() - returns 1 if the from attribute is defined in the 157 157 <db:verify/>, 0 otherwise. 158 158 159 DefinedType() - returns 1 if the type attribute is defined in the 159 DefinedType() - returns 1 if the type attribute is defined in the 160 160 <db:verify/>, 0 otherwise. 161 161 162 DefinedID() - returns 1 if the id attribute is defined in the 162 DefinedID() - returns 1 if the id attribute is defined in the 163 163 <db:verify/>, 0 otherwise. 164 164 -
perl/modules/Jabber/lib/Net/Jabber/IQ.pm
rc2bed55 r7869e48 54 54 sub DefinedQuery { my $self = shift; $self->DefinedChild(@_); } 55 55 sub NewQuery { my $self = shift; $self->RemoveFirstChild(); $self->NewFirstChild(@_); } 56 sub AddQuery { my $self = shift; $self->AddChild(@_); } 56 sub AddQuery { my $self = shift; $self->AddChild(@_); } 57 57 sub RemoveQuery { my $self = shift; $self->RemoveFirstChild(@_); } 58 58 … … 60 60 sub DefinedX { my $self = shift; $self->DefinedChild(@_); } 61 61 sub NewX { my $self = shift; $self->NewChild(@_); } 62 sub AddX { my $self = shift; $self->AddChild(@_); } 62 sub AddX { my $self = shift; $self->AddChild(@_); } 63 63 sub RemoveX { my $self = shift; $self->RemoveChild(@_); } 64 64 -
perl/modules/Jabber/lib/Net/Jabber/Key.pm
ra8c55b5 r7869e48 55 55 new(debug=>string, - creates the Key object. debug should 56 56 debugfh=>FileHandle, be set to the path for the debug 57 debuglevel=>integer) log to be written. If set to "stdout" 57 debuglevel=>integer) log to be written. If set to "stdout" 58 58 then the debug will go there. Also, you 59 59 can specify a filehandle that already … … 65 65 time and the PID. 66 66 67 Create(cacheString) - generates a key and caches it with the key 67 Create(cacheString) - generates a key and caches it with the key 68 68 of cacheString. Create returns the key. 69 69 … … 101 101 102 102 $self->{VERSION} = $VERSION; 103 103 104 104 $self->{CACHE} = {}; 105 105 … … 122 122 ########################################################################### 123 123 # 124 # Generate - returns a random string based on the PID and time and a 125 # random number. Then it creates an SHA1 Digest of that 124 # Generate - returns a random string based on the PID and time and a 125 # random number. Then it creates an SHA1 Digest of that 126 126 # string and returns it. 127 127 # -
perl/modules/Jabber/lib/Net/Jabber/Log.pm
rc2bed55 r7869e48 30 30 31 31 Net::Jabber::Log is a companion to the Net::Jabber module. 32 It provides the user a simple interface to set and retrieve all 32 It provides the user a simple interface to set and retrieve all 33 33 parts of a Jabber Log. 34 34 35 35 =head1 DESCRIPTION 36 36 37 To initialize the Log with a Jabber <log/> you must pass it the 37 To initialize the Log with a Jabber <log/> you must pass it the 38 38 XML::Parser Tree array. For example: 39 39 … … 97 97 GetFrom() - returns either a string with the Jabber Identifier, 98 98 GetFrom("jid") or a Net::Jabber::JID object for the person who 99 sent the <log/>. To get the JID object set 100 the string to "jid", otherwise leave blank for the 99 sent the <log/>. To get the JID object set 100 the string to "jid", otherwise leave blank for the 101 101 text string. 102 102 … … 125 125 126 126 SetFrom(string) - sets the from attribute. You can either pass a string 127 SetFrom(JID) or a JID object. They must be valid Jabber 127 SetFrom(JID) or a JID object. They must be valid Jabber 128 128 Identifiers or the server will return an error log. 129 129 (ie. jabber:bob@jabber.org/Silent Bob, etc...) … … 133 133 notice general logging 134 134 warn warning 135 alert critical error (can still run but not 135 alert critical error (can still run but not 136 136 correctly) 137 137 error fatal error (cannot run anymore) … … 141 141 =head2 Test functions 142 142 143 DefinedFrom() - returns 1 if the from attribute is defined in the 143 DefinedFrom() - returns 1 if the from attribute is defined in the 144 144 <log/>, 0 otherwise. 145 145 146 DefinedType() - returns 1 if the type attribute is defined in the 146 DefinedType() - returns 1 if the type attribute is defined in the 147 147 <log/>, 0 otherwise. 148 148 … … 170 170 my $class = ref($proto) || $proto; 171 171 my $self = { }; 172 172 173 173 $self->{VERSION} = $VERSION; 174 174 $self->{TIMESTAMP} = &Net::Jabber::GetTimeStamp("local"); … … 214 214 $type = "" unless defined($type); 215 215 my $treeName = "LOG"; 216 216 217 217 return "log" if ($AUTOLOAD eq "GetTag"); 218 218 return &XML::Stream::BuildXML(@{$self->{$treeName}}) if ($AUTOLOAD eq "GetXML"); -
perl/modules/Jabber/lib/Net/Jabber/Message.pm
rc2bed55 r7869e48 52 52 $VERSION = "2.0"; 53 53 54 sub GetX { my $self = shift; $self->GetChild(@_); } 54 sub GetX { my $self = shift; $self->GetChild(@_); } 55 55 sub DefinedX { my $self = shift; $self->DefinedChild(@_); } 56 56 sub NewX { my $self = shift; $self->NewChild(@_); } 57 sub AddX { my $self = shift; $self->AddChild(@_); } 57 sub AddX { my $self = shift; $self->AddChild(@_); } 58 58 sub RemoveX { my $self = shift; $self->RemoveChild(@_); } 59 59 -
perl/modules/Jabber/lib/Net/Jabber/Namespaces.pm
rc2bed55 r7869e48 487 487 ); 488 488 } 489 489 490 490 #----------------------------------------------------------------------------- 491 491 # __netjabber__:iq:rpc:methodResponse … … 514 514 ); 515 515 } 516 516 517 517 #----------------------------------------------------------------------------- 518 518 # __netjabber__:iq:rpc:fault … … 535 535 ); 536 536 } 537 537 538 538 #----------------------------------------------------------------------------- 539 539 # __netjabber__:iq:rpc:params … … 581 581 ); 582 582 } 583 583 584 584 #----------------------------------------------------------------------------- 585 585 # __netjabber__:iq:rpc:value … … 805 805 ); 806 806 } 807 807 808 808 #----------------------------------------------------------------------------- 809 809 # jabber:iq:version … … 848 848 ); 849 849 } 850 850 851 851 #----------------------------------------------------------------------------- 852 852 # jabber:x:conference … … 969 969 ); 970 970 } 971 971 972 972 #----------------------------------------------------------------------------- 973 973 # __netjabber__:x:data:item … … 1061 1061 ); 1062 1062 } 1063 1063 1064 1064 #----------------------------------------------------------------------------- 1065 1065 # jabber:x:event … … 1152 1152 ); 1153 1153 } 1154 1154 1155 1155 #----------------------------------------------------------------------------- 1156 1156 # __netjabber__:x:roster:item … … 1396 1396 ); 1397 1397 } 1398 1398 1399 1399 #----------------------------------------------------------------------------- 1400 1400 # __netjabber__:iq:disco:items:item … … 1433 1433 ); 1434 1434 } 1435 1435 1436 1436 #----------------------------------------------------------------------------- 1437 1437 # http://jabber.org/protocol/muc … … 1472 1472 }, 1473 1473 ); 1474 1474 1475 1475 } 1476 1476 -
perl/modules/Jabber/lib/Net/Jabber/Presence.pm
rc2bed55 r7869e48 52 52 $VERSION = "2.0"; 53 53 54 sub GetX { my $self = shift; $self->GetChild(@_); } 54 sub GetX { my $self = shift; $self->GetChild(@_); } 55 55 sub DefinedX { my $self = shift; $self->DefinedChild(@_); } 56 56 sub NewX { my $self = shift; $self->NewChild(@_); } 57 sub AddX { my $self = shift; $self->AddChild(@_); } 57 sub AddX { my $self = shift; $self->AddChild(@_); } 58 58 sub RemoveX { my $self = shift; $self->RemoveChild(@_); } 59 59 -
perl/modules/Jabber/lib/Net/Jabber/Protocol.pm
rcdd3959 r7869e48 62 62 comes back. You can optionally specify a timeout so that 63 63 you do not block forever. 64 64 65 65 nonblock - send the packet with an ID, but then return that id and 66 66 control to the master program. Net::Jabber is still … … 73 73 combined with the XPath function because you can register 74 74 a one shot function tied to the id you get back. 75 75 76 76 77 77 =head2 Basic Functions … … 145 145 =head2 Bystreams Functions 146 146 147 %hash = $Con->ByteStreamsProxyRequest(jid=>"proxy.server"); 147 %hash = $Con->ByteStreamsProxyRequest(jid=>"proxy.server"); 148 148 %hash = $Con->ByteStreamsProxyRequest(jid=>"proxy.server", 149 timeout=>10); 149 timeout=>10); 150 150 151 151 $id = $Con->ByteStreamsProxyRequest(jid=>"proxy.server", … … 155 155 mode=>"passthru"); 156 156 157 157 158 158 %hash = $Con->ByteStreamsProxyParse($query); 159 159 160 160 161 161 $status = $Con->ByteStreamsProxyActivate(sid=>"stream_id", 162 jid=>"proxy.server"); 162 jid=>"proxy.server"); 163 163 $status = $Con->ByteStreamsProxyActivate(sid=>"stream_id", 164 164 jid=>"proxy.server", 165 timeout=>10); 165 timeout=>10); 166 166 167 167 $id = $Con->ByteStreamsProxyActivate(sid=>"stream_id", … … 171 171 $id = $Con->ByteStreamsProxyActivate(sid=>"stream_id", 172 172 jid=>"proxy.server", 173 mode=>"passthru"); 173 mode=>"passthru"); 174 174 175 175 … … 182 182 ... 183 183 ], 184 jid=>"bob\@jabber.org"); 184 jid=>"bob\@jabber.org"); 185 185 $jid = $Con->ByteStreamsOffer(sid=>"stream_id", 186 186 streamhosts=>[{},{},...], 187 187 jid=>"bob\@jabber.org", 188 timeout=>10); 188 timeout=>10); 189 189 190 190 $id = $Con->ByteStreamsOffer(sid=>"stream_id", … … 197 197 jid=>"bob\@jabber.org", 198 198 mode=>"passthru"); 199 199 200 200 =head2 Disco Functions 201 201 … … 219 219 mode=>"passthru"); 220 220 221 221 222 222 %hash = $Con->DiscoInfoParse($query); 223 223 … … 233 233 mode=>"passthru"); 234 234 235 235 236 236 %hash = $Con->DiscoItemsParse($query); 237 237 238 238 =head2 Feature Negotiation Functions 239 239 240 240 241 241 %hash = $Con->FeatureNegRequest(jid=>"jabber.org", 242 242 features=>{ feat1=>["opt1","opt2",...], … … 259 259 $iq->AddQuery($query); 260 260 261 %hash = $Con->FeatureNegParse($query); 261 %hash = $Con->FeatureNegParse($query); 262 262 263 263 =head2 File Transfer Functions … … 568 568 See DiscoInfoParse for the format 569 569 of the resulting tree. 570 570 571 571 See MODES above for using the mode 572 572 and timeout. … … 586 586 $info{feature}->{http://jabber.org/protocol/disco#info} = 1; 587 587 $info{feature}->{http://jabber.org/protocol/muc#admin} = 1; 588 588 589 589 DiscoItemsRequest(jid=>string, - sends a disco#items request to 590 590 mode=>string, the jid passed as an argument. … … 594 594 See DiscoItemsParse for the format 595 595 of the resulting tree. 596 596 597 597 See MODES above for using the mode 598 598 and timeout. … … 618 618 See DiscoInfoQuery for the format 619 619 of the features hash ref. 620 620 621 621 See DiscoInfoParse for the format 622 622 of the resulting tree. 623 623 624 624 See MODES above for using the mode 625 625 and timeout. … … 715 715 params=>array, to the specified address. Returns 716 716 mode=>string, the above data from RPCParse. 717 timeout=>int) 717 timeout=>int) 718 718 See MODES above for using the mode 719 719 and timeout. … … 780 780 present are the required fields the 781 781 server needs. 782 782 783 783 See MODES above for using the mode 784 784 and timeout. … … 910 910 croak("You must specify functions=>'' for the function call to DefineNamespace") 911 911 if !exists($args{functions}); 912 912 913 913 my %xpath; 914 914 … … 959 959 $xpath{$name}->{$type}->{skip_xmlns} = 1; 960 960 } 961 961 962 962 if ($funcHash{$type}->[$i] eq "__netjabber__:specifyname") 963 963 { … … 977 977 next; 978 978 } 979 979 980 980 my $type = $funcHash{set}->[0]; 981 981 my $xpath = $funcHash{set}->[1]; … … 993 993 next; 994 994 } 995 995 996 996 if ($type eq "scalar") 997 997 { … … 999 999 next; 1000 1000 } 1001 1001 1002 1002 if ($type eq "flag") 1003 1003 { … … 1095 1095 return $id; 1096 1096 } 1097 1097 1098 1098 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1099 1099 … … 1131 1131 ############################################################################### 1132 1132 sub BrowseParse 1133 { 1133 { 1134 1134 my $self = shift; 1135 1135 my $item = shift; … … 1209 1209 ############################################################################### 1210 1210 # 1211 # ByteStreamsProxyRequest - This queries a proxy server to get a list of 1211 # ByteStreamsProxyRequest - This queries a proxy server to get a list of 1212 1212 # 1213 1213 ############################################################################### … … 1237 1237 return $id; 1238 1238 } 1239 1239 1240 1240 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1241 1241 … … 1289 1289 push(@hosts,\%host); 1290 1290 } 1291 1291 1292 1292 return \@hosts; 1293 1293 } … … 1296 1296 ############################################################################### 1297 1297 # 1298 # ByteStreamsProxyActivate - This tells a proxy to activate the connection 1298 # ByteStreamsProxyActivate - This tells a proxy to activate the connection 1299 1299 # 1300 1300 ############################################################################### … … 1315 1315 activate=>(ref($args{recipient}) eq "Net::Jabber::JID" ? $args{recipient}->GetJID("full") : $args{recipient}) 1316 1316 ); 1317 1317 1318 1318 #-------------------------------------------------------------------------- 1319 1319 # Send the IQ with the next available ID and wait for a reply with that … … 1327 1327 return $id; 1328 1328 } 1329 1329 1330 1330 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1331 1331 1332 1332 $iq = $self->SendAndReceiveWithID($iq,$timeout); 1333 1333 … … 1388 1388 return $id; 1389 1389 } 1390 1390 1391 1391 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1392 1392 … … 1447 1447 return $id; 1448 1448 } 1449 1449 1450 1450 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1451 1451 … … 1495 1495 $disco{feature}->{$feat->GetVar()} = 1; 1496 1496 } 1497 1497 1498 1498 return \%disco; 1499 1499 } … … 1531 1531 return $id; 1532 1532 } 1533 1533 1534 1534 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1535 1535 … … 1577 1577 $disco{$item->GetJID()}->{$item->GetNode()} = $item->GetName(); 1578 1578 } 1579 1579 1580 1580 return \%disco; 1581 1581 } … … 1603 1603 1604 1604 $iq->AddQuery($query); 1605 1605 1606 1606 #-------------------------------------------------------------------------- 1607 1607 # Send the IQ with the next available ID and wait for a reply with that … … 1615 1615 return $id; 1616 1616 } 1617 1617 1618 1618 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1619 1619 … … 1659 1659 $tag = $Net::Jabber::Query::TAGS{'http://jabber.org/protocol/feature-neg'} 1660 1660 if exists($Net::Jabber::Query::TAGS{'http://jabber.org/protocol/feature-neg'}); 1661 1661 1662 1662 my $query = Net::Jabber::Query->new($tag); 1663 1663 $query->SetXMLNS("http://jabber.org/protocol/feature-neg"); 1664 1664 my $xdata = $query->NewX("jabber:x:data"); 1665 1665 1666 1666 foreach my $feature (keys(%{$features})) 1667 1667 { … … 1692 1692 1693 1693 my $xdata = $item->GetX("jabber:x:data"); 1694 1694 1695 1695 foreach my $field ($xdata->GetFields()) 1696 1696 { 1697 1697 my @options; 1698 1698 1699 1699 foreach my $option ($field->GetOptions()) 1700 1700 { … … 1704 1704 if ($#options == -1) 1705 1705 { 1706 1706 1707 1707 $feats{$field->GetVar()} = $field->GetValue(); 1708 1708 } … … 1712 1712 } 1713 1713 } 1714 1714 1715 1715 return \%feats; 1716 1716 } … … 1749 1749 $profile->SetFile(desc=>$args{desc}) if exists($args{desc}); 1750 1750 1751 $query->SetStream(mimetype=>(-B $args{filename} ? 1751 $query->SetStream(mimetype=>(-B $args{filename} ? 1752 1752 "application/octect-stream" : 1753 1753 "text/plain" … … 1781 1781 return $id; 1782 1782 } 1783 1783 1784 1784 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1785 1785 … … 1875 1875 return %tree; 1876 1876 } 1877 1877 1878 1878 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1879 1879 … … 1921 1921 1922 1922 $tree->{size} += (-s $path); 1923 1923 1924 1924 opendir(DIR, $path); 1925 1925 foreach my $file ( sort {$a cmp $b} readdir(DIR) ) … … 1939 1939 { 1940 1940 $tree->{size} += (-s "$path/$file"); 1941 1941 1942 1942 $tree->{tree}->{"$path/$file"}->{order} = $tree->{counter}; 1943 1943 $tree->{tree}->{"$path/$file"}->{sid} = … … 1970 1970 my $waitforid = delete($args{waitforid}); 1971 1971 $args{mode} = "block" if $waitforid; 1972 1972 1973 1973 my $timeout = exists($args{timeout}) ? delete($args{timeout}) : undef; 1974 1974 … … 1985 1985 return $id; 1986 1986 } 1987 1987 1988 1988 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 1989 1989 … … 2136 2136 return $id; 2137 2137 } 2138 2138 2139 2139 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 2140 2140 … … 2427 2427 return $id; 2428 2428 } 2429 2429 2430 2430 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 2431 2431 … … 2567 2567 return $id; 2568 2568 } 2569 2569 2570 2570 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 2571 2571 … … 2624 2624 my $waitforid = delete($args{waitforid}); 2625 2625 $args{mode} = "block" if $waitforid; 2626 2626 2627 2627 my $timeout = exists($args{timeout}) ? delete($args{timeout}) : undef; 2628 2628 … … 2639 2639 return $id; 2640 2640 } 2641 2641 2642 2642 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 2643 2643 … … 2698 2698 $x->SetMUC(password=>$args{password}); 2699 2699 } 2700 2700 2701 2701 return $presence->GetXML() if exists($args{'__netjabber__:test'}); 2702 2702 $self->Send($presence); … … 2749 2749 $target->{form}->[$order]->{value} = ($field->GetValue())[0]; 2750 2750 } 2751 } 2751 } 2752 2752 my $count = 0; 2753 2753 foreach my $option ($field->GetOptions()) … … 2944 2944 $body .= "Time: ".$query->GetDisplay()."\n"; 2945 2945 $body .= "Timezone: ".$query->GetTZ()."\n"; 2946 2946 2947 2947 my $message = $self->_message(); 2948 2948 $message->SetMessage(to=>$iq->GetTo(), … … 3070 3070 if ($query->DefinedMessage()); 3071 3071 } 3072 3072 3073 3073 my $message = $self->_message(); 3074 3074 $message->SetMessage(from=>$iq->GetFrom(), -
perl/modules/Jabber/lib/Net/Jabber/Server.pm
rc2bed55 r7869e48 62 62 %status = $Server->Process(); 63 63 %status = $Server->Process(5); 64 64 65 65 $Server->Stop(); 66 66 … … 98 98 0 - Status ok, no data received. 99 99 undef - Status not ok, stop processing. 100 100 101 101 IMPORTANT: You need to check the output of every 102 102 Process. If you get an undef then the connection -
perl/modules/Jabber/lib/Net/Jabber/Stanza.pm
rc2bed55 r7869e48 90 90 91 91 =pod 92 93 For more information on what these namespaces are for, visit 92 93 For more information on what these namespaces are for, visit 94 94 http://www.jabber.org and browse the Jabber Programmers Guide. 95 95 … … 97 97 98 98 ny:private:ns 99 99 100 100 Name Type Get Set Remove Defined Add 101 101 ========================== ======= === === ====== ======= === 102 102 Foo scalar X X X X 103 Bar child X 103 Bar child X 104 104 Bars child X 105 105 Test master X X … … 108 108 109 109 GetFoo(), SetFoo(), RemoveFoo(), DefinedFoo() 110 110 111 111 AddBar() 112 112 113 113 GetBars(), DefinedBars() 114 114 115 115 GetTest(), SetMaster() 116 116 … … 125 125 Name Type Get Set Remove Defined Add 126 126 ========================== ========= === === ====== ======= === 127 Activate scalar X X X X 128 SID scalar X X X X 129 StreamHostUsedJID jid X X X X 130 StreamHost child X 131 StreamHosts child X X X 132 ByteStreams master X X 127 Activate scalar X X X X 128 SID scalar X X X X 129 StreamHostUsedJID jid X X X X 130 StreamHost child X 131 StreamHosts child X X X 132 ByteStreams master X X 133 133 134 134 =head1 http://jabber.org/protocol/bytestreams - streamhost objects … … 136 136 Name Type Get Set Remove Defined Add 137 137 ========================== ========= === === ====== ======= === 138 Host scalar X X X X 139 JID jid X X X X 140 Port scalar X X X X 141 ZeroConf scalar X X X X 142 StreamHost master X X 138 Host scalar X X X X 139 JID jid X X X X 140 Port scalar X X X X 141 ZeroConf scalar X X X X 142 StreamHost master X X 143 143 144 144 =head1 http://jabber.org/protocol/commands … … 146 146 Name Type Get Set Remove Defined Add 147 147 ========================== ========= === === ====== ======= === 148 Action scalar X X X X 149 Node scalar X X X X 150 SessionID scalar X X X X 151 Status scalar X X X X 152 Note child X 153 Notes child X X X 154 Command master X X 148 Action scalar X X X X 149 Node scalar X X X X 150 SessionID scalar X X X X 151 Status scalar X X X X 152 Note child X 153 Notes child X X X 154 Command master X X 155 155 156 156 =head1 http://jabber.org/protocol/commands - note objects … … 158 158 Name Type Get Set Remove Defined Add 159 159 ========================== ========= === === ====== ======= === 160 Message scalar X X X X 161 Type scalar X X X X 162 Note master X X 160 Message scalar X X X X 161 Type scalar X X X X 162 Note master X X 163 163 164 164 =head1 http://jabber.org/protocol/disco#info … … 166 166 Name Type Get Set Remove Defined Add 167 167 ========================== ========= === === ====== ======= === 168 Node scalar X X X X 169 Feature child X 170 Features child X X X 171 Identities child X X X 172 Identity child X 173 DiscoInfo master X X 168 Node scalar X X X X 169 Feature child X 170 Features child X X X 171 Identities child X X X 172 Identity child X 173 DiscoInfo master X X 174 174 175 175 =head1 http://jabber.org/protocol/disco#info - feature objects … … 177 177 Name Type Get Set Remove Defined Add 178 178 ========================== ========= === === ====== ======= === 179 Var scalar X X X X 180 Feature master X X 179 Var scalar X X X X 180 Feature master X X 181 181 182 182 =head1 http://jabber.org/protocol/disco#info - identity objects … … 184 184 Name Type Get Set Remove Defined Add 185 185 ========================== ========= === === ====== ======= === 186 Category scalar X X X X 187 Name scalar X X X X 188 Type scalar X X X X 189 Identity master X X 186 Category scalar X X X X 187 Name scalar X X X X 188 Type scalar X X X X 189 Identity master X X 190 190 191 191 =head1 http://jabber.org/protocol/disco#items … … 193 193 Name Type Get Set Remove Defined Add 194 194 ========================== ========= === === ====== ======= === 195 Node scalar X X X X 196 Item child X 197 Items child X X X 198 DiscoItems master X X 195 Node scalar X X X X 196 Item child X 197 Items child X X X 198 DiscoItems master X X 199 199 200 200 =head1 http://jabber.org/protocol/disco#items - item objects … … 202 202 Name Type Get Set Remove Defined Add 203 203 ========================== ========= === === ====== ======= === 204 Action scalar X X X X 205 JID jid X X X X 206 Name scalar X X X X 207 Node scalar X X X X 208 Item master X X 204 Action scalar X X X X 205 JID jid X X X X 206 Name scalar X X X X 207 Node scalar X X X X 208 Item master X X 209 209 210 210 =head1 http://jabber.org/protocol/feature-neg … … 212 212 Name Type Get Set Remove Defined Add 213 213 ========================== ========= === === ====== ======= === 214 FeatureNeg master X X 214 FeatureNeg master X X 215 215 216 216 =head1 http://jabber.org/protocol/muc … … 218 218 Name Type Get Set Remove Defined Add 219 219 ========================== ========= === === ====== ======= === 220 Password scalar X X X X 221 MUC master X X 220 Password scalar X X X X 221 MUC master X X 222 222 223 223 =head1 http://jabber.org/protocol/muc#admin … … 225 225 Name Type Get Set Remove Defined Add 226 226 ========================== ========= === === ====== ======= === 227 Item child X 228 Items child X X X 229 Admin master X X 227 Item child X 228 Items child X X X 229 Admin master X X 230 230 231 231 =head1 http://jabber.org/protocol/muc#admin - item objects … … 233 233 Name Type Get Set Remove Defined Add 234 234 ========================== ========= === === ====== ======= === 235 ActorJID jid X X X X 236 Affiliation scalar X X X X 237 JID jid X X X X 238 Nick scalar X X X X 239 Reason scalar X X X X 240 Role scalar X X X X 241 Item master X X 235 ActorJID jid X X X X 236 Affiliation scalar X X X X 237 JID jid X X X X 238 Nick scalar X X X X 239 Reason scalar X X X X 240 Role scalar X X X X 241 Item master X X 242 242 243 243 =head1 http://jabber.org/protocol/muc#user … … 245 245 Name Type Get Set Remove Defined Add 246 246 ========================== ========= === === ====== ======= === 247 Alt scalar X X X X 248 Password scalar X X X X 249 StatusCode scalar X X X X 250 Invite child X X X X 251 Item child X X X X 252 User master X X 247 Alt scalar X X X X 248 Password scalar X X X X 249 StatusCode scalar X X X X 250 Invite child X X X X 251 Item child X X X X 252 User master X X 253 253 254 254 =head1 http://jabber.org/protocol/muc#user - invite objects … … 256 256 Name Type Get Set Remove Defined Add 257 257 ========================== ========= === === ====== ======= === 258 From jid X X X X 259 Reason scalar X X X X 260 To jid X X X X 261 Invite master X X 258 From jid X X X X 259 Reason scalar X X X X 260 To jid X X X X 261 Invite master X X 262 262 263 263 =head1 http://jabber.org/protocol/muc#user - item objects … … 265 265 Name Type Get Set Remove Defined Add 266 266 ========================== ========= === === ====== ======= === 267 ActorJID jid X X X X 268 Affiliation scalar X X X X 269 JID jid X X X X 270 Nick scalar X X X X 271 Reason scalar X X X X 272 Role scalar X X X X 273 Item master X X 267 ActorJID jid X X X X 268 Affiliation scalar X X X X 269 JID jid X X X X 270 Nick scalar X X X X 271 Reason scalar X X X X 272 Role scalar X X X X 273 Item master X X 274 274 275 275 =head1 http://jabber.org/protocol/pubsub … … 277 277 Name Type Get Set Remove Defined Add 278 278 ========================== ========= === === ====== ======= === 279 Affiliations child X X X X 280 Configure child X X X X 281 Create child X X X X 282 Delete child X X X X 283 Entities child X X X X 284 Entity child X X X X 285 Item child X X X X 286 Items child X X X X 287 Options child X X X X 288 Publish child X X X X 289 Purge child X X X X 290 Retract child X X X X 291 Subscribe child X X X X 292 Unsubscribe child X X X X 293 PubSub master X X 279 Affiliations child X X X X 280 Configure child X X X X 281 Create child X X X X 282 Delete child X X X X 283 Entities child X X X X 284 Entity child X X X X 285 Item child X X X X 286 Items child X X X X 287 Options child X X X X 288 Publish child X X X X 289 Purge child X X X X 290 Retract child X X X X 291 Subscribe child X X X X 292 Unsubscribe child X X X X 293 PubSub master X X 294 294 295 295 =head1 http://jabber.org/protocol/pubsub - affiliations objects … … 297 297 Name Type Get Set Remove Defined Add 298 298 ========================== ========= === === ====== ======= === 299 Entity child X X X X 300 Affiliations master X X 299 Entity child X X X X 300 Affiliations master X X 301 301 302 302 =head1 http://jabber.org/protocol/pubsub - configure objects … … 304 304 Name Type Get Set Remove Defined Add 305 305 ========================== ========= === === ====== ======= === 306 Node scalar X X X X 307 Configure master X X 306 Node scalar X X X X 307 Configure master X X 308 308 309 309 =head1 http://jabber.org/protocol/pubsub - create objects … … 311 311 Name Type Get Set Remove Defined Add 312 312 ========================== ========= === === ====== ======= === 313 Node scalar X X X X 314 Create master X X 313 Node scalar X X X X 314 Create master X X 315 315 316 316 =head1 http://jabber.org/protocol/pubsub - delete objects … … 318 318 Name Type Get Set Remove Defined Add 319 319 ========================== ========= === === ====== ======= === 320 Node scalar X X X X 321 Delete master X X 320 Node scalar X X X X 321 Delete master X X 322 322 323 323 =head1 http://jabber.org/protocol/pubsub - entities objects … … 325 325 Name Type Get Set Remove Defined Add 326 326 ========================== ========= === === ====== ======= === 327 Entity child X X X X 328 Entities master X X 327 Entity child X X X X 328 Entities master X X 329 329 330 330 =head1 http://jabber.org/protocol/pubsub - entity objects … … 332 332 Name Type Get Set Remove Defined Add 333 333 ========================== ========= === === ====== ======= === 334 Affiliation scalar X X X X 335 JID jid X X X X 336 Node scalar X X X X 337 Subscription scalar X X X X 338 SubscribeOptions child X X X X 339 Entity master X X 334 Affiliation scalar X X X X 335 JID jid X X X X 336 Node scalar X X X X 337 Subscription scalar X X X X 338 SubscribeOptions child X X X X 339 Entity master X X 340 340 341 341 =head1 http://jabber.org/protocol/pubsub - item objects … … 343 343 Name Type Get Set Remove Defined Add 344 344 ========================== ========= === === ====== ======= === 345 ID scalar X X X X 346 Payload raw X X X X 347 Item master X X 345 ID scalar X X X X 346 Payload raw X X X X 347 Item master X X 348 348 349 349 =head1 http://jabber.org/protocol/pubsub - items objects … … 351 351 Name Type Get Set Remove Defined Add 352 352 ========================== ========= === === ====== ======= === 353 MaxItems scalar X X X X 354 Node scalar X X X X 355 Item child X X X X 356 Items master X X 353 MaxItems scalar X X X X 354 Node scalar X X X X 355 Item child X X X X 356 Items master X X 357 357 358 358 =head1 http://jabber.org/protocol/pubsub - options objects … … 360 360 Name Type Get Set Remove Defined Add 361 361 ========================== ========= === === ====== ======= === 362 JID jid X X X X 363 Node scalar X X X X 364 Options master X X 362 JID jid X X X X 363 Node scalar X X X X 364 Options master X X 365 365 366 366 =head1 http://jabber.org/protocol/pubsub - publish objects … … 368 368 Name Type Get Set Remove Defined Add 369 369 ========================== ========= === === ====== ======= === 370 Node scalar X X X X 371 Item child X X X X 372 Publish master X X 370 Node scalar X X X X 371 Item child X X X X 372 Publish master X X 373 373 374 374 =head1 http://jabber.org/protocol/pubsub - purge objects … … 376 376 Name Type Get Set Remove Defined Add 377 377 ========================== ========= === === ====== ======= === 378 Node scalar X X X X 379 Purge master X X 378 Node scalar X X X X 379 Purge master X X 380 380 381 381 =head1 http://jabber.org/protocol/pubsub - retract objects … … 383 383 Name Type Get Set Remove Defined Add 384 384 ========================== ========= === === ====== ======= === 385 Node scalar X X X X 386 Item child X X X X 387 Retract master X X 385 Node scalar X X X X 386 Item child X X X X 387 Retract master X X 388 388 389 389 =head1 http://jabber.org/protocol/pubsub - subscribe objects … … 391 391 Name Type Get Set Remove Defined Add 392 392 ========================== ========= === === ====== ======= === 393 JID jid X X X X 394 Node scalar X X X X 395 Subscribe master X X 393 JID jid X X X X 394 Node scalar X X X X 395 Subscribe master X X 396 396 397 397 =head1 http://jabber.org/protocol/pubsub - subscribe-options objects … … 399 399 Name Type Get Set Remove Defined Add 400 400 ========================== ========= === === ====== ======= === 401 Required flag X X X X 402 SubscribeOptions master X X 401 Required flag X X X X 402 SubscribeOptions master X X 403 403 404 404 =head1 http://jabber.org/protocol/pubsub - unsubscribe objects … … 406 406 Name Type Get Set Remove Defined Add 407 407 ========================== ========= === === ====== ======= === 408 JID jid X X X X 409 Node scalar X X X X 410 Unsubscribe master X X 408 JID jid X X X X 409 Node scalar X X X X 410 Unsubscribe master X X 411 411 412 412 =head1 http://jabber.org/protocol/pubsub#event … … 414 414 Name Type Get Set Remove Defined Add 415 415 ========================== ========= === === ====== ======= === 416 Delete child X X X X 417 Items child X X X X 418 Event master X X 416 Delete child X X X X 417 Items child X X X X 418 Event master X X 419 419 420 420 =head1 http://jabber.org/protocol/pubsub#event - delete objects … … 422 422 Name Type Get Set Remove Defined Add 423 423 ========================== ========= === === ====== ======= === 424 Node scalar X X X X 425 Delete master X X 424 Node scalar X X X X 425 Delete master X X 426 426 427 427 =head1 http://jabber.org/protocol/pubsub#event - item objects … … 429 429 Name Type Get Set Remove Defined Add 430 430 ========================== ========= === === ====== ======= === 431 ID scalar X X X X 432 Payload raw X X X X 433 Item master X X 431 ID scalar X X X X 432 Payload raw X X X X 433 Item master X X 434 434 435 435 =head1 http://jabber.org/protocol/pubsub#event - items objects … … 437 437 Name Type Get Set Remove Defined Add 438 438 ========================== ========= === === ====== ======= === 439 Node scalar X X X X 440 Item child X X X X 441 Items master X X 439 Node scalar X X X X 440 Item child X X X X 441 Items master X X 442 442 443 443 =head1 http://jabber.org/protocol/pubsub#owner … … 445 445 Name Type Get Set Remove Defined Add 446 446 ========================== ========= === === ====== ======= === 447 Action scalar X X X X 448 Configure child X X X X 449 Owner master X X 447 Action scalar X X X X 448 Configure child X X X X 449 Owner master X X 450 450 451 451 =head1 http://jabber.org/protocol/pubsub#owner - configure objects … … 453 453 Name Type Get Set Remove Defined Add 454 454 ========================== ========= === === ====== ======= === 455 Node scalar X X X X 456 Configure master X X 455 Node scalar X X X X 456 Configure master X X 457 457 458 458 =head1 http://jabber.org/protocol/si … … 460 460 Name Type Get Set Remove Defined Add 461 461 ========================== ========= === === ====== ======= === 462 ID scalar X X X X 463 MimeType scalar X X X X 464 Profile scalar X X X X 465 Stream master X X 462 ID scalar X X X X 463 MimeType scalar X X X X 464 Profile scalar X X X X 465 Stream master X X 466 466 467 467 =head1 http://jabber.org/protocol/si/profile/file-transfer … … 469 469 Name Type Get Set Remove Defined Add 470 470 ========================== ========= === === ====== ======= === 471 Date scalar X X X X 472 Desc scalar X X X X 473 Hash scalar X X X X 474 Name scalar X X X X 475 Range flag X X X X 476 RangeLength scalar X X X X 477 RangeOffset scalar X X X X 478 Size scalar X X X X 479 File master X X 471 Date scalar X X X X 472 Desc scalar X X X X 473 Hash scalar X X X X 474 Name scalar X X X X 475 Range flag X X X X 476 RangeLength scalar X X X X 477 RangeOffset scalar X X X X 478 Size scalar X X X X 479 File master X X 480 480 481 481 =head1 jabber:iq:agent - DEPRECATED … … 483 483 Name Type Get Set Remove Defined Add 484 484 ========================== ========= === === ====== ======= === 485 Agents flag X X X X 486 Description scalar X X X X 487 GroupChat flag X X X X 488 JID jid X X X X 489 Name scalar X X X X 490 Register flag X X X X 491 Search flag X X X X 492 Service scalar X X X X 493 Transport scalar X X X X 494 URL scalar X X X X 495 Agent master X X 485 Agents flag X X X X 486 Description scalar X X X X 487 GroupChat flag X X X X 488 JID jid X X X X 489 Name scalar X X X X 490 Register flag X X X X 491 Search flag X X X X 492 Service scalar X X X X 493 Transport scalar X X X X 494 URL scalar X X X X 495 Agent master X X 496 496 497 497 =head1 jabber:iq:agents - DEPRECATED … … 499 499 Name Type Get Set Remove Defined Add 500 500 ========================== ========= === === ====== ======= === 501 Agent child X 502 Agents child X X X 501 Agent child X 502 Agents child X X X 503 503 504 504 =head1 jabber:iq:autoupdate … … 506 506 Name Type Get Set Remove Defined Add 507 507 ========================== ========= === === ====== ======= === 508 Beta child X 509 Dev child X 510 Release child X 511 Releases child X X X 508 Beta child X 509 Dev child X 510 Release child X 511 Releases child X X X 512 512 513 513 =head1 jabber:iq:autoupdate - release objects … … 515 515 Name Type Get Set Remove Defined Add 516 516 ========================== ========= === === ====== ======= === 517 Desc scalar X X X X 518 Priority scalar X X X X 519 URL scalar X X X X 520 Version scalar X X X X 521 Release master X X 517 Desc scalar X X X X 518 Priority scalar X X X X 519 URL scalar X X X X 520 Version scalar X X X X 521 Release master X X 522 522 523 523 =head1 jabber:iq:browse - DEPRECATED … … 525 525 Name Type Get Set Remove Defined Add 526 526 ========================== ========= === === ====== ======= === 527 Category scalar X X X X 528 JID jid X X X X 529 NS array X X X X 530 Name scalar X X X X 531 Type scalar X X X X 532 Item child X 533 Items child X X X 534 Browse master X X 527 Category scalar X X X X 528 JID jid X X X X 529 NS array X X X X 530 Name scalar X X X X 531 Type scalar X X X X 532 Item child X 533 Items child X X X 534 Browse master X X 535 535 536 536 =head1 jabber:iq:browse - item objects - DEPRECATED … … 538 538 Name Type Get Set Remove Defined Add 539 539 ========================== ========= === === ====== ======= === 540 Category scalar X X X X 541 JID jid X X X X 542 NS array X X X X 543 Name scalar X X X X 544 Type scalar X X X X 545 Item child X 546 Items child X X X 547 Browse master X X 540 Category scalar X X X X 541 JID jid X X X X 542 NS array X X X X 543 Name scalar X X X X 544 Type scalar X X X X 545 Item child X 546 Items child X X X 547 Browse master X X 548 548 549 549 =head1 jabber:iq:conference … … 551 551 Name Type Get Set Remove Defined Add 552 552 ========================== ========= === === ====== ======= === 553 ID scalar X X X X 554 Name scalar X X X X 555 Nick scalar X X X X 556 Privacy flag X X X X 557 Secret scalar X X X X 558 Conference master X X 553 ID scalar X X X X 554 Name scalar X X X X 555 Nick scalar X X X X 556 Privacy flag X X X X 557 Secret scalar X X X X 558 Conference master X X 559 559 560 560 =head1 jabber:iq:filter - DEPRECATED … … 562 562 Name Type Get Set Remove Defined Add 563 563 ========================== ========= === === ====== ======= === 564 Rule child X 565 Rules child X X X 564 Rule child X 565 Rules child X X X 566 566 567 567 =head1 jabber:iq:filter - rule objects - DEPRECATED … … 569 569 Name Type Get Set Remove Defined Add 570 570 ========================== ========= === === ====== ======= === 571 Body scalar X X X X 572 Continued scalar X X X X 573 Drop scalar X X X X 574 Edit scalar X X X X 575 Error scalar X X X X 576 From scalar X X X X 577 Offline scalar X X X X 578 Reply scalar X X X X 579 Resource scalar X X X X 580 Show scalar X X X X 581 Size scalar X X X X 582 Subject scalar X X X X 583 Time scalar X X X X 584 Type scalar X X X X 585 Unavailable scalar X X X X 586 Rule master X X 571 Body scalar X X X X 572 Continued scalar X X X X 573 Drop scalar X X X X 574 Edit scalar X X X X 575 Error scalar X X X X 576 From scalar X X X X 577 Offline scalar X X X X 578 Reply scalar X X X X 579 Resource scalar X X X X 580 Show scalar X X X X 581 Size scalar X X X X 582 Subject scalar X X X X 583 Time scalar X X X X 584 Type scalar X X X X 585 Unavailable scalar X X X X 586 Rule master X X 587 587 588 588 =head1 jabber:iq:gateway … … 590 590 Name Type Get Set Remove Defined Add 591 591 ========================== ========= === === ====== ======= === 592 Desc scalar X X X X 593 JID jid X X X X 594 Prompt scalar X X X X 595 Gateway master X X 592 Desc scalar X X X X 593 JID jid X X X X 594 Prompt scalar X X X X 595 Gateway master X X 596 596 597 597 =head1 jabber:iq:last … … 599 599 Name Type Get Set Remove Defined Add 600 600 ========================== ========= === === ====== ======= === 601 Message scalar X X X X 602 Seconds scalar X X X X 603 Last master X X 601 Message scalar X X X X 602 Seconds scalar X X X X 603 Last master X X 604 604 605 605 =head1 jabber:iq:oob … … 607 607 Name Type Get Set Remove Defined Add 608 608 ========================== ========= === === ====== ======= === 609 Desc scalar X X X X 610 URL scalar X X X X 611 Oob master X X 609 Desc scalar X X X X 610 URL scalar X X X X 611 Oob master X X 612 612 613 613 =head1 jabber:iq:pass … … 615 615 Name Type Get Set Remove Defined Add 616 616 ========================== ========= === === ====== ======= === 617 Client scalar X X X X 618 ClientPort scalar X X X X 619 Close flag X X X X 620 Expire scalar X X X X 621 OneShot flag X X X X 622 Proxy scalar X X X X 623 ProxyPort scalar X X X X 624 Server scalar X X X X 625 ServerPort scalar X X X X 626 Pass master X X 617 Client scalar X X X X 618 ClientPort scalar X X X X 619 Close flag X X X X 620 Expire scalar X X X X 621 OneShot flag X X X X 622 Proxy scalar X X X X 623 ProxyPort scalar X X X X 624 Server scalar X X X X 625 ServerPort scalar X X X X 626 Pass master X X 627 627 628 628 =head1 jabber:iq:rpc … … 630 630 Name Type Get Set Remove Defined Add 631 631 ========================== ========= === === ====== ======= === 632 MethodCall child X X X X 633 MethodResponse child X X X X 632 MethodCall child X X X X 633 MethodResponse child X X X X 634 634 635 635 =head1 jabber:iq:rpc - array objects … … 637 637 Name Type Get Set Remove Defined Add 638 638 ========================== ========= === === ====== ======= === 639 Data child X 640 Datas child X X X 639 Data child X 640 Datas child X X X 641 641 642 642 =head1 jabber:iq:rpc - data objects … … 644 644 Name Type Get Set Remove Defined Add 645 645 ========================== ========= === === ====== ======= === 646 Value child X X X X 646 Value child X X X X 647 647 648 648 =head1 jabber:iq:rpc - fault objects … … 650 650 Name Type Get Set Remove Defined Add 651 651 ========================== ========= === === ====== ======= === 652 Value child X X X X 652 Value child X X X X 653 653 654 654 =head1 jabber:iq:rpc - member objects … … 656 656 Name Type Get Set Remove Defined Add 657 657 ========================== ========= === === ====== ======= === 658 Name scalar X X X X 659 Value child X X X X 660 Member master X X 658 Name scalar X X X X 659 Value child X X X X 660 Member master X X 661 661 662 662 =head1 jabber:iq:rpc - methodCall objects … … 664 664 Name Type Get Set Remove Defined Add 665 665 ========================== ========= === === ====== ======= === 666 MethodName scalar X X X X 667 Params child X X X X 668 MethodCall master X X 666 MethodName scalar X X X X 667 Params child X X X X 668 MethodCall master X X 669 669 670 670 =head1 jabber:iq:rpc - methodResponse objects … … 672 672 Name Type Get Set Remove Defined Add 673 673 ========================== ========= === === ====== ======= === 674 Fault child X X X X 675 Params child X X X X 674 Fault child X X X X 675 Params child X X X X 676 676 677 677 =head1 jabber:iq:rpc - param objects … … 679 679 Name Type Get Set Remove Defined Add 680 680 ========================== ========= === === ====== ======= === 681 Value child X X X X 681 Value child X X X X 682 682 683 683 =head1 jabber:iq:rpc - params objects … … 685 685 Name Type Get Set Remove Defined Add 686 686 ========================== ========= === === ====== ======= === 687 Param child X 688 Params child X X X 687 Param child X 688 Params child X X X 689 689 690 690 =head1 jabber:iq:rpc - struct objects … … 692 692 Name Type Get Set Remove Defined Add 693 693 ========================== ========= === === ====== ======= === 694 Member child X 695 Members child X X X 694 Member child X 695 Members child X X X 696 696 697 697 =head1 jabber:iq:rpc - value objects … … 699 699 Name Type Get Set Remove Defined Add 700 700 ========================== ========= === === ====== ======= === 701 Base64 scalar X X X X 702 Boolean scalar X X X X 703 DateTime scalar X X X X 704 Double scalar X X X X 705 I4 scalar X X X X 706 Int scalar X X X X 707 String scalar X X X X 708 Value scalar X X X X 709 Array child X X X X 710 Struct child X X X X 711 RPCValue master X X 701 Base64 scalar X X X X 702 Boolean scalar X X X X 703 DateTime scalar X X X X 704 Double scalar X X X X 705 I4 scalar X X X X 706 Int scalar X X X X 707 String scalar X X X X 708 Value scalar X X X X 709 Array child X X X X 710 Struct child X X X X 711 RPCValue master X X 712 712 713 713 =head1 jabber:iq:search … … 715 715 Name Type Get Set Remove Defined Add 716 716 ========================== ========= === === ====== ======= === 717 Email scalar X X X X 718 Family scalar X X X X 719 First scalar X X X X 720 Given scalar X X X X 721 Instructions scalar X X X X 722 Key scalar X X X X 723 Last scalar X X X X 724 Name scalar X X X X 725 Nick scalar X X X X 726 Truncated flag X X X X 727 Item child X 728 Items child X X X 729 Search master X X 717 Email scalar X X X X 718 Family scalar X X X X 719 First scalar X X X X 720 Given scalar X X X X 721 Instructions scalar X X X X 722 Key scalar X X X X 723 Last scalar X X X X 724 Name scalar X X X X 725 Nick scalar X X X X 726 Truncated flag X X X X 727 Item child X 728 Items child X X X 729 Search master X X 730 730 731 731 =head1 jabber:iq:search - item objects … … 733 733 Name Type Get Set Remove Defined Add 734 734 ========================== ========= === === ====== ======= === 735 Email scalar X X X X 736 Family scalar X X X X 737 First scalar X X X X 738 Given scalar X X X X 739 JID jid X X X X 740 Key scalar X X X X 741 Last scalar X X X X 742 Name scalar X X X X 743 Nick scalar X X X X 744 Item master X X 735 Email scalar X X X X 736 Family scalar X X X X 737 First scalar X X X X 738 Given scalar X X X X 739 JID jid X X X X 740 Key scalar X X X X 741 Last scalar X X X X 742 Name scalar X X X X 743 Nick scalar X X X X 744 Item master X X 745 745 746 746 =head1 jabber:iq:time … … 748 748 Name Type Get Set Remove Defined Add 749 749 ========================== ========= === === ====== ======= === 750 Display special X X X X 751 TZ special X X X X 752 UTC special X X X X 753 Time master X X 750 Display special X X X X 751 TZ special X X X X 752 UTC special X X X X 753 Time master X X 754 754 755 755 =head1 jabber:iq:version … … 757 757 Name Type Get Set Remove Defined Add 758 758 ========================== ========= === === ====== ======= === 759 Name scalar X X X X 760 OS special X X X X 761 Ver special X X X X 762 Version master X X 759 Name scalar X X X X 760 OS special X X X X 761 Ver special X X X X 762 Version master X X 763 763 764 764 =head1 jabber:x:autoupdate … … 766 766 Name Type Get Set Remove Defined Add 767 767 ========================== ========= === === ====== ======= === 768 JID jid X X X X 769 Autoupdate master X X 768 JID jid X X X X 769 Autoupdate master X X 770 770 771 771 =head1 jabber:x:conference … … 773 773 Name Type Get Set Remove Defined Add 774 774 ========================== ========= === === ====== ======= === 775 JID jid X X X X 776 Conference master X X 775 JID jid X X X X 776 Conference master X X 777 777 778 778 =head1 jabber:x:data … … 780 780 Name Type Get Set Remove Defined Add 781 781 ========================== ========= === === ====== ======= === 782 Form scalar X X X X 783 Instructions scalar X X X X 784 Title scalar X X X X 785 Type scalar X X X X 786 Field child X 787 Fields child X X X 788 Item child X 789 Items child X X X 790 Reported child X X X X 791 Data master X X 782 Form scalar X X X X 783 Instructions scalar X X X X 784 Title scalar X X X X 785 Type scalar X X X X 786 Field child X 787 Fields child X X X 788 Item child X 789 Items child X X X 790 Reported child X X X X 791 Data master X X 792 792 793 793 =head1 jabber:x:data - field objects … … 795 795 Name Type Get Set Remove Defined Add 796 796 ========================== ========= === === ====== ======= === 797 Desc scalar X X X X 798 Label scalar X X X X 799 Required flag X X X X 800 Type scalar X X X X 801 Value array X X X X 802 Var scalar X X X X 803 Option child X 804 Options child X X X 805 Field master X X 797 Desc scalar X X X X 798 Label scalar X X X X 799 Required flag X X X X 800 Type scalar X X X X 801 Value array X X X X 802 Var scalar X X X X 803 Option child X 804 Options child X X X 805 Field master X X 806 806 807 807 =head1 jabber:x:data - item objects … … 809 809 Name Type Get Set Remove Defined Add 810 810 ========================== ========= === === ====== ======= === 811 Field child X 812 Fields child X X X 813 Item master X X 811 Field child X 812 Fields child X X X 813 Item master X X 814 814 815 815 =head1 jabber:x:data - option objects … … 817 817 Name Type Get Set Remove Defined Add 818 818 ========================== ========= === === ====== ======= === 819 Label scalar X X X X 820 Value scalar X X X X 821 Option master X X 819 Label scalar X X X X 820 Value scalar X X X X 821 Option master X X 822 822 823 823 =head1 jabber:x:data - reported objects … … 825 825 Name Type Get Set Remove Defined Add 826 826 ========================== ========= === === ====== ======= === 827 Field child X 828 Fields child X X X 829 Reported master X X 827 Field child X 828 Fields child X X X 829 Reported master X X 830 830 831 831 =head1 jabber:x:delay … … 833 833 Name Type Get Set Remove Defined Add 834 834 ========================== ========= === === ====== ======= === 835 From jid X X X X 836 Message scalar X X X X 837 Stamp timestamp X X X X 838 Delay master X X 835 From jid X X X X 836 Message scalar X X X X 837 Stamp timestamp X X X X 838 Delay master X X 839 839 840 840 =head1 jabber:x:encrypted … … 842 842 Name Type Get Set Remove Defined Add 843 843 ========================== ========= === === ====== ======= === 844 Message scalar X X X X 845 Encrypted master X X 844 Message scalar X X X X 845 Encrypted master X X 846 846 847 847 =head1 jabber:x:event … … 849 849 Name Type Get Set Remove Defined Add 850 850 ========================== ========= === === ====== ======= === 851 Composing flag X X X X 852 Delivered flag X X X X 853 Displayed flag X X X X 854 ID scalar X X X X 855 Offline flag X X X X 856 Event master X X 851 Composing flag X X X X 852 Delivered flag X X X X 853 Displayed flag X X X X 854 ID scalar X X X X 855 Offline flag X X X X 856 Event master X X 857 857 858 858 =head1 jabber:x:expire … … 860 860 Name Type Get Set Remove Defined Add 861 861 ========================== ========= === === ====== ======= === 862 Seconds scalar X X X X 863 Expire master X X 862 Seconds scalar X X X X 863 Expire master X X 864 864 865 865 =head1 jabber:x:oob … … 867 867 Name Type Get Set Remove Defined Add 868 868 ========================== ========= === === ====== ======= === 869 Desc scalar X X X X 870 URL scalar X X X X 871 Oob master X X 869 Desc scalar X X X X 870 URL scalar X X X X 871 Oob master X X 872 872 873 873 =head1 jabber:x:roster … … 875 875 Name Type Get Set Remove Defined Add 876 876 ========================== ========= === === ====== ======= === 877 Item child X 878 Items child X X X 879 Roster master X X 877 Item child X 878 Items child X X X 879 Roster master X X 880 880 881 881 =head1 jabber:x:roster - item objects … … 883 883 Name Type Get Set Remove Defined Add 884 884 ========================== ========= === === ====== ======= === 885 Ask scalar X X X X 886 Group array X X X X 887 JID jid X X X X 888 Name scalar X X X X 889 Subscription scalar X X X X 890 Item master X X 885 Ask scalar X X X X 886 Group array X X X X 887 JID jid X X X X 888 Name scalar X X X X 889 Subscription scalar X X X X 890 Item master X X 891 891 892 892 =head1 jabber:x:signed … … 894 894 Name Type Get Set Remove Defined Add 895 895 ========================== ========= === === ====== ======= === 896 Signature scalar X X X X 897 Signed master X X 896 Signature scalar X X X X 897 Signed master X X 898 898 899 899 # DOC_BEGIN … … 902 902 Name Type Get Set Remove Defined Add 903 903 ========================== ========= === === ====== ======= === 904 Activate scalar X X X X 905 SID scalar X X X X 906 StreamHostUsedJID jid X X X X 907 StreamHost child X 908 StreamHosts child X X X 909 ByteStreams master X X 904 Activate scalar X X X X 905 SID scalar X X X X 906 StreamHostUsedJID jid X X X X 907 StreamHost child X 908 StreamHosts child X X X 909 ByteStreams master X X 910 910 911 911 =head1 http://jabber.org/protocol/bytestreams - streamhost objects … … 913 913 Name Type Get Set Remove Defined Add 914 914 ========================== ========= === === ====== ======= === 915 Host scalar X X X X 916 JID jid X X X X 917 Port scalar X X X X 918 ZeroConf scalar X X X X 919 StreamHost master X X 915 Host scalar X X X X 916 JID jid X X X X 917 Port scalar X X X X 918 ZeroConf scalar X X X X 919 StreamHost master X X 920 920 921 921 =head1 http://jabber.org/protocol/commands … … 923 923 Name Type Get Set Remove Defined Add 924 924 ========================== ========= === === ====== ======= === 925 Action scalar X X X X 926 Node scalar X X X X 927 SessionID scalar X X X X 928 Status scalar X X X X 929 Note child X 930 Notes child X X X 931 Command master X X 925 Action scalar X X X X 926 Node scalar X X X X 927 SessionID scalar X X X X 928 Status scalar X X X X 929 Note child X 930 Notes child X X X 931 Command master X X 932 932 933 933 =head1 http://jabber.org/protocol/commands - note objects … … 935 935 Name Type Get Set Remove Defined Add 936 936 ========================== ========= === === ====== ======= === 937 Message scalar X X X X 938 Type scalar X X X X 939 Note master X X 937 Message scalar X X X X 938 Type scalar X X X X 939 Note master X X 940 940 941 941 =head1 http://jabber.org/protocol/disco#info … … 943 943 Name Type Get Set Remove Defined Add 944 944 ========================== ========= === === ====== ======= === 945 Node scalar X X X X 946 Feature child X 947 Features child X X X 948 Identities child X X X 949 Identity child X 950 DiscoInfo master X X 945 Node scalar X X X X 946 Feature child X 947 Features child X X X 948 Identities child X X X 949 Identity child X 950 DiscoInfo master X X 951 951 952 952 =head1 http://jabber.org/protocol/disco#info - feature objects … … 954 954 Name Type Get Set Remove Defined Add 955 955 ========================== ========= === === ====== ======= === 956 Var scalar X X X X 957 Feature master X X 956 Var scalar X X X X 957 Feature master X X 958 958 959 959 =head1 http://jabber.org/protocol/disco#info - identity objects … … 961 961 Name Type Get Set Remove Defined Add 962 962 ========================== ========= === === ====== ======= === 963 Category scalar X X X X 964 Name scalar X X X X 965 Type scalar X X X X 966 Identity master X X 963 Category scalar X X X X 964 Name scalar X X X X 965 Type scalar X X X X 966 Identity master X X 967 967 968 968 =head1 http://jabber.org/protocol/disco#items … … 970 970 Name Type Get Set Remove Defined Add 971 971 ========================== ========= === === ====== ======= === 972 Node scalar X X X X 973 Item child X 974 Items child X X X 975 DiscoItems master X X 972 Node scalar X X X X 973 Item child X 974 Items child X X X 975 DiscoItems master X X 976 976 977 977 =head1 http://jabber.org/protocol/disco#items - item objects … … 979 979 Name Type Get Set Remove Defined Add 980 980 ========================== ========= === === ====== ======= === 981 Action scalar X X X X 982 JID jid X X X X 983 Name scalar X X X X 984 Node scalar X X X X 985 Item master X X 981 Action scalar X X X X 982 JID jid X X X X 983 Name scalar X X X X 984 Node scalar X X X X 985 Item master X X 986 986 987 987 =head1 http://jabber.org/protocol/feature-neg … … 989 989 Name Type Get Set Remove Defined Add 990 990 ========================== ========= === === ====== ======= === 991 FeatureNeg master X X 991 FeatureNeg master X X 992 992 993 993 =head1 http://jabber.org/protocol/muc … … 995 995 Name Type Get Set Remove Defined Add 996 996 ========================== ========= === === ====== ======= === 997 Password scalar X X X X 998 MUC master X X 997 Password scalar X X X X 998 MUC master X X 999 999 1000 1000 =head1 http://jabber.org/protocol/muc#admin … … 1002 1002 Name Type Get Set Remove Defined Add 1003 1003 ========================== ========= === === ====== ======= === 1004 Item child X 1005 Items child X X X 1006 Admin master X X 1004 Item child X 1005 Items child X X X 1006 Admin master X X 1007 1007 1008 1008 =head1 http://jabber.org/protocol/muc#admin - item objects … … 1010 1010 Name Type Get Set Remove Defined Add 1011 1011 ========================== ========= === === ====== ======= === 1012 ActorJID jid X X X X 1013 Affiliation scalar X X X X 1014 JID jid X X X X 1015 Nick scalar X X X X 1016 Reason scalar X X X X 1017 Role scalar X X X X 1018 Item master X X 1012 ActorJID jid X X X X 1013 Affiliation scalar X X X X 1014 JID jid X X X X 1015 Nick scalar X X X X 1016 Reason scalar X X X X 1017 Role scalar X X X X 1018 Item master X X 1019 1019 1020 1020 =head1 http://jabber.org/protocol/muc#user … … 1022 1022 Name Type Get Set Remove Defined Add 1023 1023 ========================== ========= === === ====== ======= === 1024 Alt scalar X X X X 1025 Password scalar X X X X 1026 StatusCode scalar X X X X 1027 Invite child X X X X 1028 Item child X X X X 1029 User master X X 1024 Alt scalar X X X X 1025 Password scalar X X X X 1026 StatusCode scalar X X X X 1027 Invite child X X X X 1028 Item child X X X X 1029 User master X X 1030 1030 1031 1031 =head1 http://jabber.org/protocol/muc#user - invite objects … … 1033 1033 Name Type Get Set Remove Defined Add 1034 1034 ========================== ========= === === ====== ======= === 1035 From jid X X X X 1036 Reason scalar X X X X 1037 To jid X X X X 1038 Invite master X X 1035 From jid X X X X 1036 Reason scalar X X X X 1037 To jid X X X X 1038 Invite master X X 1039 1039 1040 1040 =head1 http://jabber.org/protocol/muc#user - item objects … … 1042 1042 Name Type Get Set Remove Defined Add 1043 1043 ========================== ========= === === ====== ======= === 1044 ActorJID jid X X X X 1045 Affiliation scalar X X X X 1046 JID jid X X X X 1047 Nick scalar X X X X 1048 Reason scalar X X X X 1049 Role scalar X X X X 1050 Item master X X 1044 ActorJID jid X X X X 1045 Affiliation scalar X X X X 1046 JID jid X X X X 1047 Nick scalar X X X X 1048 Reason scalar X X X X 1049 Role scalar X X X X 1050 Item master X X 1051 1051 1052 1052 =head1 http://jabber.org/protocol/pubsub … … 1054 1054 Name Type Get Set Remove Defined Add 1055 1055 ========================== ========= === === ====== ======= === 1056 Affiliations child X X X X 1057 Configure child X X X X 1058 Create child X X X X 1059 Delete child X X X X 1060 Entities child X X X X 1061 Entity child X X X X 1062 Item child X X X X 1063 Items child X X X X 1064 Options child X X X X 1065 Publish child X X X X 1066 Purge child X X X X 1067 Retract child X X X X 1068 Subscribe child X X X X 1069 Unsubscribe child X X X X 1070 PubSub master X X 1056 Affiliations child X X X X 1057 Configure child X X X X 1058 Create child X X X X 1059 Delete child X X X X 1060 Entities child X X X X 1061 Entity child X X X X 1062 Item child X X X X 1063 Items child X X X X 1064 Options child X X X X 1065 Publish child X X X X 1066 Purge child X X X X 1067 Retract child X X X X 1068 Subscribe child X X X X 1069 Unsubscribe child X X X X 1070 PubSub master X X 1071 1071 1072 1072 =head1 http://jabber.org/protocol/pubsub - affiliations objects … … 1074 1074 Name Type Get Set Remove Defined Add 1075 1075 ========================== ========= === === ====== ======= === 1076 Entity child X X X X 1077 Affiliations master X X 1076 Entity child X X X X 1077 Affiliations master X X 1078 1078 1079 1079 =head1 http://jabber.org/protocol/pubsub - configure objects … … 1081 1081 Name Type Get Set Remove Defined Add 1082 1082 ========================== ========= === === ====== ======= === 1083 Node scalar X X X X 1084 Configure master X X 1083 Node scalar X X X X 1084 Configure master X X 1085 1085 1086 1086 =head1 http://jabber.org/protocol/pubsub - create objects … … 1088 1088 Name Type Get Set Remove Defined Add 1089 1089 ========================== ========= === === ====== ======= === 1090 Node scalar X X X X 1091 Create master X X 1090 Node scalar X X X X 1091 Create master X X 1092 1092 1093 1093 =head1 http://jabber.org/protocol/pubsub - delete objects … … 1095 1095 Name Type Get Set Remove Defined Add 1096 1096 ========================== ========= === === ====== ======= === 1097 Node scalar X X X X 1098 Delete master X X 1097 Node scalar X X X X 1098 Delete master X X 1099 1099 1100 1100 =head1 http://jabber.org/protocol/pubsub - entities objects … … 1102 1102 Name Type Get Set Remove Defined Add 1103 1103 ========================== ========= === === ====== ======= === 1104 Entity child X X X X 1105 Entities master X X 1104 Entity child X X X X 1105 Entities master X X 1106 1106 1107 1107 =head1 http://jabber.org/protocol/pubsub - entity objects … … 1109 1109 Name Type Get Set Remove Defined Add 1110 1110 ========================== ========= === === ====== ======= === 1111 Affiliation scalar X X X X 1112 JID jid X X X X 1113 Node scalar X X X X 1114 Subscription scalar X X X X 1115 SubscribeOptions child X X X X 1116 Entity master X X 1111 Affiliation scalar X X X X 1112 JID jid X X X X 1113 Node scalar X X X X 1114 Subscription scalar X X X X 1115 SubscribeOptions child X X X X 1116 Entity master X X 1117 1117 1118 1118 =head1 http://jabber.org/protocol/pubsub - item objects … … 1120 1120 Name Type Get Set Remove Defined Add 1121 1121 ========================== ========= === === ====== ======= === 1122 ID scalar X X X X 1123 Payload raw X X X X 1124 Item master X X 1122 ID scalar X X X X 1123 Payload raw X X X X 1124 Item master X X 1125 1125 1126 1126 =head1 http://jabber.org/protocol/pubsub - items objects … … 1128 1128 Name Type Get Set Remove Defined Add 1129 1129 ========================== ========= === === ====== ======= === 1130 MaxItems scalar X X X X 1131 Node scalar X X X X 1132 Item child X X X X 1133 Items master X X 1130 MaxItems scalar X X X X 1131 Node scalar X X X X 1132 Item child X X X X 1133 Items master X X 1134 1134 1135 1135 =head1 http://jabber.org/protocol/pubsub - options objects … … 1137 1137 Name Type Get Set Remove Defined Add 1138 1138 ========================== ========= === === ====== ======= === 1139 JID jid X X X X 1140 Node scalar X X X X 1141 Options master X X 1139 JID jid X X X X 1140 Node scalar X X X X 1141 Options master X X 1142 1142 1143 1143 =head1 http://jabber.org/protocol/pubsub - publish objects … … 1145 1145 Name Type Get Set Remove Defined Add 1146 1146 ========================== ========= === === ====== ======= === 1147 Node scalar X X X X 1148 Item child X X X X 1149 Publish master X X 1147 Node scalar X X X X 1148 Item child X X X X 1149 Publish master X X 1150 1150 1151 1151 =head1 http://jabber.org/protocol/pubsub - purge objects … … 1153 1153 Name Type Get Set Remove Defined Add 1154 1154 ========================== ========= === === ====== ======= === 1155 Node scalar X X X X 1156 Purge master X X 1155 Node scalar X X X X 1156 Purge master X X 1157 1157 1158 1158 =head1 http://jabber.org/protocol/pubsub - retract objects … … 1160 1160 Name Type Get Set Remove Defined Add 1161 1161 ========================== ========= === === ====== ======= === 1162 Node scalar X X X X 1163 Item child X X X X 1164 Retract master X X 1162 Node scalar X X X X 1163 Item child X X X X 1164 Retract master X X 1165 1165 1166 1166 =head1 http://jabber.org/protocol/pubsub - subscribe objects … … 1168 1168 Name Type Get Set Remove Defined Add 1169 1169 ========================== ========= === === ====== ======= === 1170 JID jid X X X X 1171 Node scalar X X X X 1172 Subscribe master X X 1170 JID jid X X X X 1171 Node scalar X X X X 1172 Subscribe master X X 1173 1173 1174 1174 =head1 http://jabber.org/protocol/pubsub - subscribe-options objects … … 1176 1176 Name Type Get Set Remove Defined Add 1177 1177 ========================== ========= === === ====== ======= === 1178 Required flag X X X X 1179 SubscribeOptions master X X 1178 Required flag X X X X 1179 SubscribeOptions master X X 1180 1180 1181 1181 =head1 http://jabber.org/protocol/pubsub - unsubscribe objects … … 1183 1183 Name Type Get Set Remove Defined Add 1184 1184 ========================== ========= === === ====== ======= === 1185 JID jid X X X X 1186 Node scalar X X X X 1187 Unsubscribe master X X 1185 JID jid X X X X 1186 Node scalar X X X X 1187 Unsubscribe master X X 1188 1188 1189 1189 =head1 http://jabber.org/protocol/pubsub#event … … 1191 1191 Name Type Get Set Remove Defined Add 1192 1192 ========================== ========= === === ====== ======= === 1193 Delete child X X X X 1194 Items child X X X X 1195 Event master X X 1193 Delete child X X X X 1194 Items child X X X X 1195 Event master X X 1196 1196 1197 1197 =head1 http://jabber.org/protocol/pubsub#event - delete objects … … 1199 1199 Name Type Get Set Remove Defined Add 1200 1200 ========================== ========= === === ====== ======= === 1201 Node scalar X X X X 1202 Delete master X X 1201 Node scalar X X X X 1202 Delete master X X 1203 1203 1204 1204 =head1 http://jabber.org/protocol/pubsub#event - item objects … … 1206 1206 Name Type Get Set Remove Defined Add 1207 1207 ========================== ========= === === ====== ======= === 1208 ID scalar X X X X 1209 Payload raw X X X X 1210 Item master X X 1208 ID scalar X X X X 1209 Payload raw X X X X 1210 Item master X X 1211 1211 1212 1212 =head1 http://jabber.org/protocol/pubsub#event - items objects … … 1214 1214 Name Type Get Set Remove Defined Add 1215 1215 ========================== ========= === === ====== ======= === 1216 Node scalar X X X X 1217 Item child X X X X 1218 Items master X X 1216 Node scalar X X X X 1217 Item child X X X X 1218 Items master X X 1219 1219 1220 1220 =head1 http://jabber.org/protocol/pubsub#owner … … 1222 1222 Name Type Get Set Remove Defined Add 1223 1223 ========================== ========= === === ====== ======= === 1224 Action scalar X X X X 1225 Configure child X X X X 1226 Owner master X X 1224 Action scalar X X X X 1225 Configure child X X X X 1226 Owner master X X 1227 1227 1228 1228 =head1 http://jabber.org/protocol/pubsub#owner - configure objects … … 1230 1230 Name Type Get Set Remove Defined Add 1231 1231 ========================== ========= === === ====== ======= === 1232 Node scalar X X X X 1233 Configure master X X 1232 Node scalar X X X X 1233 Configure master X X 1234 1234 1235 1235 =head1 http://jabber.org/protocol/si … … 1237 1237 Name Type Get Set Remove Defined Add 1238 1238 ========================== ========= === === ====== ======= === 1239 ID scalar X X X X 1240 MimeType scalar X X X X 1241 Profile scalar X X X X 1242 Stream master X X 1239 ID scalar X X X X 1240 MimeType scalar X X X X 1241 Profile scalar X X X X 1242 Stream master X X 1243 1243 1244 1244 =head1 http://jabber.org/protocol/si/profile/file-transfer … … 1246 1246 Name Type Get Set Remove Defined Add 1247 1247 ========================== ========= === === ====== ======= === 1248 Date scalar X X X X 1249 Desc scalar X X X X 1250 Hash scalar X X X X 1251 Name scalar X X X X 1252 Range flag X X X X 1253 RangeLength scalar X X X X 1254 RangeOffset scalar X X X X 1255 Size scalar X X X X 1256 File master X X 1248 Date scalar X X X X 1249 Desc scalar X X X X 1250 Hash scalar X X X X 1251 Name scalar X X X X 1252 Range flag X X X X 1253 RangeLength scalar X X X X 1254 RangeOffset scalar X X X X 1255 Size scalar X X X X 1256 File master X X 1257 1257 1258 1258 =head1 jabber:iq:agent - DEPRECATED … … 1260 1260 Name Type Get Set Remove Defined Add 1261 1261 ========================== ========= === === ====== ======= === 1262 Agents flag X X X X 1263 Description scalar X X X X 1264 GroupChat flag X X X X 1265 JID jid X X X X 1266 Name scalar X X X X 1267 Register flag X X X X 1268 Search flag X X X X 1269 Service scalar X X X X 1270 Transport scalar X X X X 1271 URL scalar X X X X 1272 Agent master X X 1262 Agents flag X X X X 1263 Description scalar X X X X 1264 GroupChat flag X X X X 1265 JID jid X X X X 1266 Name scalar X X X X 1267 Register flag X X X X 1268 Search flag X X X X 1269 Service scalar X X X X 1270 Transport scalar X X X X 1271 URL scalar X X X X 1272 Agent master X X 1273 1273 1274 1274 =head1 jabber:iq:agents - DEPRECATED … … 1276 1276 Name Type Get Set Remove Defined Add 1277 1277 ========================== ========= === === ====== ======= === 1278 Agent child X 1279 Agents child X X X 1278 Agent child X 1279 Agents child X X X 1280 1280 1281 1281 =head1 jabber:iq:autoupdate … … 1283 1283 Name Type Get Set Remove Defined Add 1284 1284 ========================== ========= === === ====== ======= === 1285 Beta child X 1286 Dev child X 1287 Release child X 1288 Releases child X X X 1285 Beta child X 1286 Dev child X 1287 Release child X 1288 Releases child X X X 1289 1289 1290 1290 =head1 jabber:iq:autoupdate - release objects … … 1292 1292 Name Type Get Set Remove Defined Add 1293 1293 ========================== ========= === === ====== ======= === 1294 Desc scalar X X X X 1295 Priority scalar X X X X 1296 URL scalar X X X X 1297 Version scalar X X X X 1298 Release master X X 1294 Desc scalar X X X X 1295 Priority scalar X X X X 1296 URL scalar X X X X 1297 Version scalar X X X X 1298 Release master X X 1299 1299 1300 1300 =head1 jabber:iq:browse - DEPRECATED … … 1302 1302 Name Type Get Set Remove Defined Add 1303 1303 ========================== ========= === === ====== ======= === 1304 Category scalar X X X X 1305 JID jid X X X X 1306 NS array X X X X 1307 Name scalar X X X X 1308 Type scalar X X X X 1309 Item child X 1310 Items child X X X 1311 Browse master X X 1304 Category scalar X X X X 1305 JID jid X X X X 1306 NS array X X X X 1307 Name scalar X X X X 1308 Type scalar X X X X 1309 Item child X 1310 Items child X X X 1311 Browse master X X 1312 1312 1313 1313 =head1 jabber:iq:browse - item objects - DEPRECATED … … 1315 1315 Name Type Get Set Remove Defined Add 1316 1316 ========================== ========= === === ====== ======= === 1317 Category scalar X X X X 1318 JID jid X X X X 1319 NS array X X X X 1320 Name scalar X X X X 1321 Type scalar X X X X 1322 Item child X 1323 Items child X X X 1324 Browse master X X 1317 Category scalar X X X X 1318 JID jid X X X X 1319 NS array X X X X 1320 Name scalar X X X X 1321 Type scalar X X X X 1322 Item child X 1323 Items child X X X 1324 Browse master X X 1325 1325 1326 1326 =head1 jabber:iq:conference … … 1328 1328 Name Type Get Set Remove Defined Add 1329 1329 ========================== ========= === === ====== ======= === 1330 ID scalar X X X X 1331 Name scalar X X X X 1332 Nick scalar X X X X 1333 Privacy flag X X X X 1334 Secret scalar X X X X 1335 Conference master X X 1330 ID scalar X X X X 1331 Name scalar X X X X 1332 Nick scalar X X X X 1333 Privacy flag X X X X 1334 Secret scalar X X X X 1335 Conference master X X 1336 1336 1337 1337 =head1 jabber:iq:filter - DEPRECATED … … 1339 1339 Name Type Get Set Remove Defined Add 1340 1340 ========================== ========= === === ====== ======= === 1341 Rule child X 1342 Rules child X X X 1341 Rule child X 1342 Rules child X X X 1343 1343 1344 1344 =head1 jabber:iq:filter - rule objects - DEPRECATED … … 1346 1346 Name Type Get Set Remove Defined Add 1347 1347 ========================== ========= === === ====== ======= === 1348 Body scalar X X X X 1349 Continued scalar X X X X 1350 Drop scalar X X X X 1351 Edit scalar X X X X 1352 Error scalar X X X X 1353 From scalar X X X X 1354 Offline scalar X X X X 1355 Reply scalar X X X X 1356 Resource scalar X X X X 1357 Show scalar X X X X 1358 Size scalar X X X X 1359 Subject scalar X X X X 1360 Time scalar X X X X 1361 Type scalar X X X X 1362 Unavailable scalar X X X X 1363 Rule master X X 1348 Body scalar X X X X 1349 Continued scalar X X X X 1350 Drop scalar X X X X 1351 Edit scalar X X X X 1352 Error scalar X X X X 1353 From scalar X X X X 1354 Offline scalar X X X X 1355 Reply scalar X X X X 1356 Resource scalar X X X X 1357 Show scalar X X X X 1358 Size scalar X X X X 1359 Subject scalar X X X X 1360 Time scalar X X X X 1361 Type scalar X X X X 1362 Unavailable scalar X X X X 1363 Rule master X X 1364 1364 1365 1365 =head1 jabber:iq:gateway … … 1367 1367 Name Type Get Set Remove Defined Add 1368 1368 ========================== ========= === === ====== ======= === 1369 Desc scalar X X X X 1370 JID jid X X X X 1371 Prompt scalar X X X X 1372 Gateway master X X 1369 Desc scalar X X X X 1370 JID jid X X X X 1371 Prompt scalar X X X X 1372 Gateway master X X 1373 1373 1374 1374 =head1 jabber:iq:last … … 1376 1376 Name Type Get Set Remove Defined Add 1377 1377 ========================== ========= === === ====== ======= === 1378 Message scalar X X X X 1379 Seconds scalar X X X X 1380 Last master X X 1378 Message scalar X X X X 1379 Seconds scalar X X X X 1380 Last master X X 1381 1381 1382 1382 =head1 jabber:iq:oob … … 1384 1384 Name Type Get Set Remove Defined Add 1385 1385 ========================== ========= === === ====== ======= === 1386 Desc scalar X X X X 1387 URL scalar X X X X 1388 Oob master X X 1386 Desc scalar X X X X 1387 URL scalar X X X X 1388 Oob master X X 1389 1389 1390 1390 =head1 jabber:iq:pass … … 1392 1392 Name Type Get Set Remove Defined Add 1393 1393 ========================== ========= === === ====== ======= === 1394 Client scalar X X X X 1395 ClientPort scalar X X X X 1396 Close flag X X X X 1397 Expire scalar X X X X 1398 OneShot flag X X X X 1399 Proxy scalar X X X X 1400 ProxyPort scalar X X X X 1401 Server scalar X X X X 1402 ServerPort scalar X X X X 1403 Pass master X X 1394 Client scalar X X X X 1395 ClientPort scalar X X X X 1396 Close flag X X X X 1397 Expire scalar X X X X 1398 OneShot flag X X X X 1399 Proxy scalar X X X X 1400 ProxyPort scalar X X X X 1401 Server scalar X X X X 1402 ServerPort scalar X X X X 1403 Pass master X X 1404 1404 1405 1405 =head1 jabber:iq:rpc … … 1407 1407 Name Type Get Set Remove Defined Add 1408 1408 ========================== ========= === === ====== ======= === 1409 MethodCall child X X X X 1410 MethodResponse child X X X X 1409 MethodCall child X X X X 1410 MethodResponse child X X X X 1411 1411 1412 1412 =head1 jabber:iq:rpc - array objects … … 1414 1414 Name Type Get Set Remove Defined Add 1415 1415 ========================== ========= === === ====== ======= === 1416 Data child X 1417 Datas child X X X 1416 Data child X 1417 Datas child X X X 1418 1418 1419 1419 =head1 jabber:iq:rpc - data objects … … 1421 1421 Name Type Get Set Remove Defined Add 1422 1422 ========================== ========= === === ====== ======= === 1423 Value child X X X X 1423 Value child X X X X 1424 1424 1425 1425 =head1 jabber:iq:rpc - fault objects … … 1427 1427 Name Type Get Set Remove Defined Add 1428 1428 ========================== ========= === === ====== ======= === 1429 Value child X X X X 1429 Value child X X X X 1430 1430 1431 1431 =head1 jabber:iq:rpc - member objects … … 1433 1433 Name Type Get Set Remove Defined Add 1434 1434 ========================== ========= === === ====== ======= === 1435 Name scalar X X X X 1436 Value child X X X X 1437 Member master X X 1435 Name scalar X X X X 1436 Value child X X X X 1437 Member master X X 1438 1438 1439 1439 =head1 jabber:iq:rpc - methodCall objects … … 1441 1441 Name Type Get Set Remove Defined Add 1442 1442 ========================== ========= === === ====== ======= === 1443 MethodName scalar X X X X 1444 Params child X X X X 1445 MethodCall master X X 1443 MethodName scalar X X X X 1444 Params child X X X X 1445 MethodCall master X X 1446 1446 1447 1447 =head1 jabber:iq:rpc - methodResponse objects … … 1449 1449 Name Type Get Set Remove Defined Add 1450 1450 ========================== ========= === === ====== ======= === 1451 Fault child X X X X 1452 Params child X X X X 1451 Fault child X X X X 1452 Params child X X X X 1453 1453 1454 1454 =head1 jabber:iq:rpc - param objects … … 1456 1456 Name Type Get Set Remove Defined Add 1457 1457 ========================== ========= === === ====== ======= === 1458 Value child X X X X 1458 Value child X X X X 1459 1459 1460 1460 =head1 jabber:iq:rpc - params objects … … 1462 1462 Name Type Get Set Remove Defined Add 1463 1463 ========================== ========= === === ====== ======= === 1464 Param child X 1465 Params child X X X 1464 Param child X 1465 Params child X X X 1466 1466 1467 1467 =head1 jabber:iq:rpc - struct objects … … 1469 1469 Name Type Get Set Remove Defined Add 1470 1470 ========================== ========= === === ====== ======= === 1471 Member child X 1472 Members child X X X 1471 Member child X 1472 Members child X X X 1473 1473 1474 1474 =head1 jabber:iq:rpc - value objects … … 1476 1476 Name Type Get Set Remove Defined Add 1477 1477 ========================== ========= === === ====== ======= === 1478 Base64 scalar X X X X 1479 Boolean scalar X X X X 1480 DateTime scalar X X X X 1481 Double scalar X X X X 1482 I4 scalar X X X X 1483 Int scalar X X X X 1484 String scalar X X X X 1485 Value scalar X X X X 1486 Array child X X X X 1487 Struct child X X X X 1488 RPCValue master X X 1478 Base64 scalar X X X X 1479 Boolean scalar X X X X 1480 DateTime scalar X X X X 1481 Double scalar X X X X 1482 I4 scalar X X X X 1483 Int scalar X X X X 1484 String scalar X X X X 1485 Value scalar X X X X 1486 Array child X X X X 1487 Struct child X X X X 1488 RPCValue master X X 1489 1489 1490 1490 =head1 jabber:iq:search … … 1492 1492 Name Type Get Set Remove Defined Add 1493 1493 ========================== ========= === === ====== ======= === 1494 Email scalar X X X X 1495 Family scalar X X X X 1496 First scalar X X X X 1497 Given scalar X X X X 1498 Instructions scalar X X X X 1499 Key scalar X X X X 1500 Last scalar X X X X 1501 Name scalar X X X X 1502 Nick scalar X X X X 1503 Truncated flag X X X X 1504 Item child X 1505 Items child X X X 1506 Search master X X 1494 Email scalar X X X X 1495 Family scalar X X X X 1496 First scalar X X X X 1497 Given scalar X X X X 1498 Instructions scalar X X X X 1499 Key scalar X X X X 1500 Last scalar X X X X 1501 Name scalar X X X X 1502 Nick scalar X X X X 1503 Truncated flag X X X X 1504 Item child X 1505 Items child X X X 1506 Search master X X 1507 1507 1508 1508 =head1 jabber:iq:search - item objects … … 1510 1510 Name Type Get Set Remove Defined Add 1511 1511 ========================== ========= === === ====== ======= === 1512 Email scalar X X X X 1513 Family scalar X X X X 1514 First scalar X X X X 1515 Given scalar X X X X 1516 JID jid X X X X 1517 Key scalar X X X X 1518 Last scalar X X X X 1519 Name scalar X X X X 1520 Nick scalar X X X X 1521 Item master X X 1512 Email scalar X X X X 1513 Family scalar X X X X 1514 First scalar X X X X 1515 Given scalar X X X X 1516 JID jid X X X X 1517 Key scalar X X X X 1518 Last scalar X X X X 1519 Name scalar X X X X 1520 Nick scalar X X X X 1521 Item master X X 1522 1522 1523 1523 =head1 jabber:iq:time … … 1525 1525 Name Type Get Set Remove Defined Add 1526 1526 ========================== ========= === === ====== ======= === 1527 Display special X X X X 1528 TZ special X X X X 1529 UTC special X X X X 1530 Time master X X 1527 Display special X X X X 1528 TZ special X X X X 1529 UTC special X X X X 1530 Time master X X 1531 1531 1532 1532 =head1 jabber:iq:version … … 1534 1534 Name Type Get Set Remove Defined Add 1535 1535 ========================== ========= === === ====== ======= === 1536 Name scalar X X X X 1537 OS special X X X X 1538 Ver special X X X X 1539 Version master X X 1536 Name scalar X X X X 1537 OS special X X X X 1538 Ver special X X X X 1539 Version master X X 1540 1540 1541 1541 =head1 jabber:x:autoupdate … … 1543 1543 Name Type Get Set Remove Defined Add 1544 1544 ========================== ========= === === ====== ======= === 1545 JID jid X X X X 1546 Autoupdate master X X 1545 JID jid X X X X 1546 Autoupdate master X X 1547 1547 1548 1548 =head1 jabber:x:conference … … 1550 1550 Name Type Get Set Remove Defined Add 1551 1551 ========================== ========= === === ====== ======= === 1552 JID jid X X X X 1553 Conference master X X 1552 JID jid X X X X 1553 Conference master X X 1554 1554 1555 1555 =head1 jabber:x:data … … 1557 1557 Name Type Get Set Remove Defined Add 1558 1558 ========================== ========= === === ====== ======= === 1559 Form scalar X X X X 1560 Instructions scalar X X X X 1561 Title scalar X X X X 1562 Type scalar X X X X 1563 Field child X 1564 Fields child X X X 1565 Item child X 1566 Items child X X X 1567 Reported child X X X X 1568 Data master X X 1559 Form scalar X X X X 1560 Instructions scalar X X X X 1561 Title scalar X X X X 1562 Type scalar X X X X 1563 Field child X 1564 Fields child X X X 1565 Item child X 1566 Items child X X X 1567 Reported child X X X X 1568 Data master X X 1569 1569 1570 1570 =head1 jabber:x:data - field objects … … 1572 1572 Name Type Get Set Remove Defined Add 1573 1573 ========================== ========= === === ====== ======= === 1574 Desc scalar X X X X 1575 Label scalar X X X X 1576 Required flag X X X X 1577 Type scalar X X X X 1578 Value array X X X X 1579 Var scalar X X X X 1580 Option child X 1581 Options child X X X 1582 Field master X X 1574 Desc scalar X X X X 1575 Label scalar X X X X 1576 Required flag X X X X 1577 Type scalar X X X X 1578 Value array X X X X 1579 Var scalar X X X X 1580 Option child X 1581 Options child X X X 1582 Field master X X 1583 1583 1584 1584 =head1 jabber:x:data - item objects … … 1586 1586 Name Type Get Set Remove Defined Add 1587 1587 ========================== ========= === === ====== ======= === 1588 Field child X 1589 Fields child X X X 1590 Item master X X 1588 Field child X 1589 Fields child X X X 1590 Item master X X 1591 1591 1592 1592 =head1 jabber:x:data - option objects … … 1594 1594 Name Type Get Set Remove Defined Add 1595 1595 ========================== ========= === === ====== ======= === 1596 Label scalar X X X X 1597 Value scalar X X X X 1598 Option master X X 1596 Label scalar X X X X 1597 Value scalar X X X X 1598 Option master X X 1599 1599 1600 1600 =head1 jabber:x:data - reported objects … … 1602 1602 Name Type Get Set Remove Defined Add 1603 1603 ========================== ========= === === ====== ======= === 1604 Field child X 1605 Fields child X X X 1606 Reported master X X 1604 Field child X 1605 Fields child X X X 1606 Reported master X X 1607 1607 1608 1608 =head1 jabber:x:delay … … 1610 1610 Name Type Get Set Remove Defined Add 1611 1611 ========================== ========= === === ====== ======= === 1612 From jid X X X X 1613 Message scalar X X X X 1614 Stamp timestamp X X X X 1615 Delay master X X 1612 From jid X X X X 1613 Message scalar X X X X 1614 Stamp timestamp X X X X 1615 Delay master X X 1616 1616 1617 1617 =head1 jabber:x:encrypted … … 1619 1619 Name Type Get Set Remove Defined Add 1620 1620 ========================== ========= === === ====== ======= === 1621 Message scalar X X X X 1622 Encrypted master X X 1621 Message scalar X X X X 1622 Encrypted master X X 1623 1623 1624 1624 =head1 jabber:x:event … … 1626 1626 Name Type Get Set Remove Defined Add 1627 1627 ========================== ========= === === ====== ======= === 1628 Composing flag X X X X 1629 Delivered flag X X X X 1630 Displayed flag X X X X 1631 ID scalar X X X X 1632 Offline flag X X X X 1633 Event master X X 1628 Composing flag X X X X 1629 Delivered flag X X X X 1630 Displayed flag X X X X 1631 ID scalar X X X X 1632 Offline flag X X X X 1633 Event master X X 1634 1634 1635 1635 =head1 jabber:x:expire … … 1637 1637 Name Type Get Set Remove Defined Add 1638 1638 ========================== ========= === === ====== ======= === 1639 Seconds scalar X X X X 1640 Expire master X X 1639 Seconds scalar X X X X 1640 Expire master X X 1641 1641 1642 1642 =head1 jabber:x:oob … … 1644 1644 Name Type Get Set Remove Defined Add 1645 1645 ========================== ========= === === ====== ======= === 1646 Desc scalar X X X X 1647 URL scalar X X X X 1648 Oob master X X 1646 Desc scalar X X X X 1647 URL scalar X X X X 1648 Oob master X X 1649 1649 1650 1650 =head1 jabber:x:roster … … 1652 1652 Name Type Get Set Remove Defined Add 1653 1653 ========================== ========= === === ====== ======= === 1654 Item child X 1655 Items child X X X 1656 Roster master X X 1654 Item child X 1655 Items child X X X 1656 Roster master X X 1657 1657 1658 1658 =head1 jabber:x:roster - item objects … … 1660 1660 Name Type Get Set Remove Defined Add 1661 1661 ========================== ========= === === ====== ======= === 1662 Ask scalar X X X X 1663 Group array X X X X 1664 JID jid X X X X 1665 Name scalar X X X X 1666 Subscription scalar X X X X 1667 Item master X X 1662 Ask scalar X X X X 1663 Group array X X X X 1664 JID jid X X X X 1665 Name scalar X X X X 1666 Subscription scalar X X X X 1667 Item master X X 1668 1668 1669 1669 =head1 jabber:x:signed … … 1671 1671 Name Type Get Set Remove Defined Add 1672 1672 ========================== ========= === === ====== ======= === 1673 Signature scalar X X X X 1674 Signed master X X 1673 Signature scalar X X X X 1674 Signed master X X 1675 1675 1676 1676 … … 1726 1726 } 1727 1727 1728 sub GetX { my $self = shift; $self->GetChild(@_); } 1728 sub GetX { my $self = shift; $self->GetChild(@_); } 1729 1729 sub DefinedX { my $self = shift; $self->DefinedChild(@_); } 1730 1730 sub NewX { my $self = shift; $self->NewChild(@_); } 1731 sub AddX { my $self = shift; $self->AddChild(@_); } 1731 sub AddX { my $self = shift; $self->AddChild(@_); } 1732 1732 sub RemoveX { my $self = shift; $self->RemoveChild(@_); } 1733 1733 … … 1735 1735 sub DefinedQuery { my $self = shift; $self->DefinedChild(@_); } 1736 1736 sub NewQuery { my $self = shift; $self->NewChild(@_); } 1737 sub AddQuery { my $self = shift; $self->AddChild(@_); } 1737 sub AddQuery { my $self = shift; $self->AddChild(@_); } 1738 1738 sub RemoveQuery { my $self = shift; $self->RemoveChild(@_); } 1739 1739 … … 1770 1770 my $self = shift; 1771 1771 my $value = shift; 1772 1772 1773 1773 if (!defined($value) && ($TIMEZONE == 1)) 1774 1774 { … … 1804 1804 my $self = shift; 1805 1805 my $value = shift; 1806 1806 1807 1807 if (defined($value)) 1808 1808 { … … 1826 1826 my %result; 1827 1827 my @xData = $item->GetX("jabber:x:data"); 1828 if ($#xData == -1) 1828 if ($#xData == -1) 1829 1829 { 1830 1830 %result = $item->GetItem(); -
perl/modules/Jabber/lib/Net/Jabber/XDB.pm
rc2bed55 r7869e48 41 41 namspaces and modules see Net::Jabber::Data. 42 42 43 To initialize the XDB with a Jabber <xdb/> you must pass it the 43 To initialize the XDB with a Jabber <xdb/> you must pass it the 44 44 XML::Parser Tree array. For example: 45 45 -
perl/modules/Jabber/lib/Net/XMPP.pm
ra8c55b5 r7869e48 40 40 like to utilize the XMPP Instant Messaging protocol. While not a 41 41 client in and of itself, it provides all of the necessary back-end 42 functions to make a CGI client or command-line perl client feasible 42 functions to make a CGI client or command-line perl client feasible 43 43 and easy to use. Net::XMPP is a wrapper around the rest of the 44 44 official Net::XMPP::xxxxxx packages. -
perl/modules/Jabber/lib/Net/XMPP/Client.pm
rc2bed55 r7869e48 143 143 sepecified account for you, if it 144 144 does not exist. 145 145 146 146 Process(integer) - takes the timeout period as an argument. If no 147 147 timeout is listed then the function blocks until … … 157 157 0 - Status ok, no data received. 158 158 undef - Status not ok, stop processing. 159 159 160 160 IMPORTANT: You need to check the output of every 161 161 Process. If you get an undef then the connection … … 190 190 bless($self, $proto); 191 191 $self->init(@_); 192 192 193 193 $self->{SERVER}->{port} = 5222; 194 194 $self->{SERVER}->{namespace} = "jabber:client"; … … 210 210 $auth{password} = $args{password}; 211 211 $auth{resource} = $args{resource} if exists($args{resource}); 212 212 213 213 return $self->AuthSend(%auth); 214 214 } … … 219 219 my $self = shift; 220 220 my (%args) = @_; 221 221 222 222 my %connect; 223 223 $connect{hostname} = $args{hostname}; -
perl/modules/Jabber/lib/Net/XMPP/Connection.pm
r3bf5516 r7869e48 59 59 60 60 bless($self, $proto); 61 61 62 62 $self->init(@_); 63 63 64 64 $self->{SERVER}->{namespace} = "unknown"; 65 65 … … 76 76 { 77 77 my $self = shift; 78 78 79 79 $self->{ARGS} = {}; 80 80 while($#_ >= 0) { $self->{ARGS}->{ lc(pop(@_)) } = pop(@_); } … … 103 103 debugtime => $self->{DEBUG}->GetTime(), 104 104 ); 105 105 106 106 $self->{RCVDB}->{currentID} = 0; 107 107 … … 132 132 $self->{DEBUG}->Log1("Connect: host($self->{SERVER}->{hostname}:$self->{SERVER}->{port}) namespace($self->{SERVER}->{namespace})"); 133 133 $self->{DEBUG}->Log1("Connect: timeout($self->{SERVER}->{timeout})"); 134 134 135 135 delete($self->{SESSION}); 136 136 $self->{SESSION} = … … 210 210 $self->{STREAM}->Disconnect($self->{SESSION}->{id}) 211 211 if ($self->{CONNECTED} == 1); 212 $self->{STREAM}->SetCallBacks(node=>undef); 212 $self->{STREAM}->SetCallBacks(node=>undef); 213 213 $self->{CONNECTED} = 0; 214 214 $self->{DISCONNECTED} = 1; … … 270 270 &{$self->{CB}->{onauthfail}}() 271 271 if exists($self->{CB}->{onauthfail}); 272 272 273 273 if (!$self->{SERVER}->{allow_register} || $args{register} == 0) 274 274 { … … 288 288 &{$self->{CB}->{onregisterfail}}() 289 289 if exists($self->{CB}->{onregisterfail}); 290 290 291 291 $self->Disconnect(); 292 292 &{$self->{CB}->{ondisconnect}}() … … 306 306 if exists($self->{CB}->{onauth}); 307 307 } 308 308 309 309 while($self->Connected()) 310 310 { -
perl/modules/Jabber/lib/Net/XMPP/Debug.pm
rb7b2a76 r7869e48 151 151 my %args; 152 152 while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); } 153 153 154 154 delete($args{file}) if (lc($args{file}) eq "stdout"); 155 155 -
perl/modules/Jabber/lib/Net/XMPP/IQ.pm
rc2bed55 r7869e48 198 198 199 199 $IQ->RemoveTo(); 200 200 201 201 RemoveFrom() - removes the from attribute from the <iq/>. 202 202 203 203 $IQ->RemoveFrom(); 204 204 205 205 RemoveID() - removes the id attribute from the <iq/>. 206 206 207 207 $IQ->RemoveID(); 208 208 209 209 RemoveType() - removes the type attribute from the <iq/>. 210 210 211 211 $IQ->RemoveType(); 212 212 213 213 RemoveError() - removes the <error/> element from the <iq/>. 214 214 215 215 $IQ->RemoveError(); 216 216 217 217 RemoveErrorCode() - removes the code attribute from the <error/> 218 218 element in the <iq/>. … … 222 222 =head2 Test functions 223 223 224 DefinedTo() - returns 1 if the to attribute is defined in the <iq/>, 224 DefinedTo() - returns 1 if the to attribute is defined in the <iq/>, 225 225 0 otherwise. 226 226 … … 232 232 $test = $IQ->DefinedFrom(); 233 233 234 DefinedID() - returns 1 if the id attribute is defined in the <iq/>, 234 DefinedID() - returns 1 if the id attribute is defined in the <iq/>, 235 235 0 otherwise. 236 236 … … 242 242 $test = $IQ->DefinedType(); 243 243 244 DefinedError() - returns 1 if <error/> is defined in the <iq/>, 244 DefinedError() - returns 1 if <error/> is defined in the <iq/>, 245 245 0 otherwise. 246 246 … … 285 285 286 286 $self->{FUNCS} = \%FUNCTIONS; 287 287 288 288 $self->_init(@_); 289 289 -
perl/modules/Jabber/lib/Net/XMPP/JID.pm
rc2bed55 r7869e48 29 29 30 30 Net::XMPP::JID is a companion to the Net::XMPP module. 31 It provides the user a simple interface to set and retrieve all 31 It provides the user a simple interface to set and retrieve all 32 32 parts of a Jabber ID (userid on a server). 33 33 … … 89 89 GetUserID() - returns a string with the userid of the JID. 90 90 If the string is an address (bob%jabber.org) then 91 the function will return it as an address 91 the function will return it as an address 92 92 (bob@jabber.org). 93 93 94 94 GetServer() - returns a string with the server of the JID. 95 95 96 GetResource() - returns a string with the resource of the JID. 96 GetResource() - returns a string with the resource of the JID. 97 97 98 98 GetJID() - returns a string that represents the JID stored … … 113 113 then both will be in the jid. If all 114 114 you pass is a string, then that string 115 is used as the JID. For valid settings 115 is used as the JID. For valid settings 116 116 read the specific Set functions below. 117 117 118 118 SetUserID(string) - sets the userid. Must be a valid userid or the 119 119 server will complain if you try to use this JID 120 to talk to the server. If the string is an 120 to talk to the server. If the string is an 121 121 address then it will be converted to the % 122 122 form suitable for using as a User ID. 123 123 124 SetServer(string) - sets the server. Must be a valid host on the 124 SetServer(string) - sets the server. Must be a valid host on the 125 125 network or the server will not be able to talk 126 126 to it. … … 283 283 my %jid; 284 284 285 if ($#_ > 0 ) { 285 if ($#_ > 0 ) { 286 286 while($#_ >= 0) { $jid{ lc pop(@_) } = pop(@_); } 287 287 -
perl/modules/Jabber/lib/Net/XMPP/Message.pm
r8574801 r7869e48 204 204 205 205 $Mess->RemoveTo(); 206 206 207 207 RemoveFrom() - removes the from attribute from the <message/>. 208 208 209 209 $Mess->RemoveFrom(); 210 210 211 211 RemoveType() - removes the type attribute from the <message/>. 212 212 213 213 $Mess->RemoveType(); 214 214 215 215 RemoveSubject() - removes the <subject/> element from the 216 216 <message/>. … … 220 220 RemoveBody() - removes the <body/> element from the 221 221 <message/>. 222 222 223 223 $Mess->RemoveBody(); 224 224 … … 226 226 227 227 $Mess->RemoveThread(); 228 228 229 229 RemoveError() - removes the <error/> element from the <message/>. 230 230 231 231 $Mess->RemoveError(); 232 232 233 233 RemoveErrorCode() - removes the code attribute from the <error/> 234 234 element in the <message/>. -
perl/modules/Jabber/lib/Net/XMPP/Namespaces.pm
rc2bed55 r7869e48 136 136 137 137 To repeat, here is an example call to add_ns(): 138 138 139 139 &add_ns(ns => "mynamespace", 140 140 tag => "mytag", … … 154 154 DefinedXXXX(), RemoveXXXX(), AddXXXX() calls. The basic options you 155 155 can pass in are: 156 156 157 157 type - This tells Stanza how to handle the call. The possible 158 158 values are: 159 159 160 160 array - The value to set and returned is an an array 161 161 reference. For example, <group/> in jabber:iq:roster. … … 265 265 ["Add"] 266 266 ["Get","Add","Defined"] 267 267 268 268 It all depends on how you want your API to look. 269 269 270 270 Once more... The following: 271 271 272 272 &add_ns(ns => "mynamespace", 273 273 tag => "mytag", … … 451 451 ); 452 452 } 453 453 454 454 #----------------------------------------------------------------------------- 455 455 # __netxmpp__:iq:privacy:list:item … … 588 588 589 589 # XXX error check... 590 590 591 591 $NS{$args{ns}}->{tag} = $args{tag} if exists($args{tag}); 592 592 $NS{$args{ns}}->{xpath} = $args{xpath}; -
perl/modules/Jabber/lib/Net/XMPP/Presence.pm
rc2bed55 r7869e48 123 123 124 124 SetTo(string) - sets the to attribute. You can either pass a string 125 SetTo(JID) or a JID object. They must be valid JIDs or the 125 SetTo(JID) or a JID object. They must be valid JIDs or the 126 126 server will return an error message. 127 127 (ie. bob@jabber.org/Silent Bob, etc...) … … 180 180 181 181 $Pres->RemoveTo(); 182 182 183 183 RemoveFrom() - removes the from attribute from the <presence/>. 184 184 185 185 $Pres->RemoveFrom(); 186 186 187 187 RemoveType() - removes the type attribute from the <presence/>. 188 188 189 189 $Pres->RemoveType(); 190 190 191 191 RemoveStatus() - removes the <status/> element from the <presence/>. 192 192 193 193 $Pres->RemoveStatus(); 194 194 195 195 RemovePriority() - removes the <priority/> element from the 196 196 <presence/>. 197 197 198 198 $Pres->RemovePriority(); 199 199 200 200 RemoveShow() - removes the <show/> element from the <presence/>. 201 201 202 202 $Pres->RemoveShow(); 203 203 204 204 =head2 Test functions 205 205 … … 264 264 265 265 $self->{FUNCS} = \%FUNCTIONS; 266 266 267 267 $self->_init(@_); 268 268 -
perl/modules/Jabber/lib/Net/XMPP/PrivacyLists.pm
rc2bed55 r7869e48 65 65 66 66 $self->{CONNECTION} = $args{connection}; 67 67 68 68 bless($self, $proto); 69 69 70 70 $self->init(); 71 71 72 72 return $self; 73 73 } … … 172 172 my $self = shift; 173 173 my $list = shift; 174 174 175 175 my $iq = $self->{CONNECTION}->PrivacyListsGet(list=>$list); 176 176 $self->handleIQ($iq); … … 251 251 { 252 252 my $query = $iq->GetChild("jabber:iq:privacy"); 253 253 254 254 my @lists = $query->GetLists(); 255 255 256 256 return unless ($#lists > -1); 257 257 258 258 my @items = $lists[0]->GetItems(); 259 259 260 260 if (($#lists == 0) && ($#items > -1)) 261 261 { … … 274 274 my $self = shift; 275 275 my $list = shift; 276 276 277 277 my $name = $list->GetName(); 278 278 … … 280 280 { 281 281 my %item = $item->GetItem(); 282 282 283 283 $self->addItem($name,%item); 284 284 } … … 290 290 my $self = shift; 291 291 my $lists = shift; 292 292 293 293 foreach my $list (@{$lists}) 294 294 { … … 326 326 { 327 327 $self->{CONNECTION}->{DEBUG}->Log3("PrivacyLists::remove: deleting $list from the DB"); 328 328 329 329 delete($self->{LISTS}->{$list}); 330 330 delete($self->{LISTS}) if (scalar(keys(%{$self->{LISTS}})) == 0); -
perl/modules/Jabber/lib/Net/XMPP/Protocol.pm
ra8c55b5 r7869e48 58 58 comes back. You can optionally specify a timeout so that 59 59 you do not block forever. 60 60 61 61 nonblock - send the packet with an ID, but then return that id and 62 62 control to the master program. Net::XMPP is still … … 69 69 combined with the XPath function because you can register 70 70 a one shot function tied to the id you get back. 71 71 72 72 73 73 =head2 Basic Functions … … 234 234 groups=>["foo"] 235 235 ); 236 236 237 237 $Con->RosterDBRemove("bob\@jabber.org"); 238 238 $Con->RosterDBRemove(Net::XMPP::JID); … … 244 244 245 245 @jids = $Con->RosterDBJIDs(); 246 246 247 247 if ($Con->RosterDBGroupExists("foo")) { ... 248 248 249 249 @groups = $Con->RosterDBGroups(); 250 250 251 251 @jids = $Con->RosterDBGroupJIDs("foo"); 252 252 253 253 @jids = $Con->RosterDBNonGroupJIDs(); 254 254 255 255 %hash = $Con->RosterDBQuery("bob\@jabber.org"); 256 256 %hash = $Con->RosterDBQuery(Net::XMPP::JID); … … 340 340 then you must *NOT* specify a callback for 341 341 presence in the SetCallBacks function. 342 342 343 343 Net::XMPP defines a few default 344 344 callbacks for various types: 345 345 346 346 "subscribe" - 347 347 replies with subscribed 348 348 349 349 "unsubscribe" - 350 350 replies with unsubscribed 351 351 352 352 "subscribed" - 353 353 replies with subscribed 354 354 355 355 "unsubscribed" - 356 356 replies with unsubscribed 357 357 358 358 359 359 SetMessageCallBacks(type=>function, - sets the callback functions for … … 441 441 0 - Status ok, no data received. 442 442 undef - Status not ok, stop processing. 443 443 444 444 IMPORTANT: You need to check the output of every 445 445 Process. If you get an undef then the connection … … 684 684 the has returned by RosterParse above, and 685 685 is the actual hash, not a reference. 686 686 687 687 RosterDBRemove(jid) - Remove a JID from the roster DB. The JID is 688 688 either a string, or a Net::XMPP::JID object. … … 696 696 RosterDBJIDs() - returns a list of Net::XMPP::JID objects that 697 697 represents all of the JIDs in the DB. 698 698 699 699 RosterDBGroups() - returns the complete list of roster groups in the 700 700 roster. 701 701 702 702 RosterDBGroupExists(group) - return 1 if the group is a group in the 703 703 roster DB, undef otherwise. … … 706 706 that represents all of the JIDs in the 707 707 specified roster group. 708 708 709 709 RosterDBNonGroupJIDs() - returns a list of Net::XMPP::JID objects 710 710 that represents all of the JIDs not in a … … 720 720 the given key. The available keys are: 721 721 name, ask, subsrcription and groups 722 The JID is either a string, or a 722 The JID is either a string, or a 723 723 Net::XMPP::JID object. 724 724 … … 827 827 my $id; 828 828 my $tree; 829 829 830 830 if (ref($object) !~ /^Net::XMPP/) 831 831 { … … 884 884 } 885 885 } 886 886 887 887 return if $direct_pass; 888 888 } … … 1093 1093 ############################################################################### 1094 1094 sub SetXPathCallBacks 1095 { 1095 { 1096 1096 my $self = shift; 1097 1097 my (%xpaths) = @_; … … 1133 1133 ############################################################################### 1134 1134 sub SetDirectXPathCallBacks 1135 { 1135 { 1136 1136 my $self = shift; 1137 1137 my (%xpaths) = @_; … … 1538 1538 1539 1539 $self->{DEBUG}->Log4("PresenceDBParse: pres(",$presence->GetXML(),")"); 1540 1540 1541 1541 my $type = $presence->GetType(); 1542 1542 $type = "" unless defined($type); … … 1942 1942 &{$self->{CB}->{update}}() if exists($self->{CB}->{update}); 1943 1943 } 1944 1944 1945 1945 #------------------------------------------------------------------------- 1946 1946 # The loop finished... but was it done? … … 1951 1951 return( "system","SASL timed out authenticating"); 1952 1952 } 1953 1953 1954 1954 #------------------------------------------------------------------------- 1955 1955 # Ok, it was done... but did we auth? … … 1960 1960 return ( "error", $self->{STREAM}->SASLClientError($sid)); 1961 1961 } 1962 1962 1963 1963 #------------------------------------------------------------------------- 1964 1964 # Phew... Restart the <stream:stream> per XMPP … … 1967 1967 $self->{SESSION} = $self->{STREAM}->OpenStream($sid); 1968 1968 $sid = $self->{SESSION}->{id}; 1969 1969 1970 1970 $self->{DEBUG}->Log1("AuthSASL: We got a new session. sid($sid)"); 1971 1971 … … 2012 2012 $iq->SetIQ(type=>"set"); 2013 2013 my $bind = $iq->NewChild(&ConstXMLNS("xmpp-bind")); 2014 2014 2015 2015 if (defined($resource) && ($resource ne "")) 2016 2016 { … … 2037 2037 $iq->SetIQ(type=>"set"); 2038 2038 my $session = $iq->NewChild(&ConstXMLNS("xmpp-session")); 2039 2039 2040 2040 my $result = $self->SendAndReceiveWithID($iq); 2041 2041 } … … 2096 2096 my %args; 2097 2097 while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); } 2098 2098 2099 2099 my $iq = $self->_iq(); 2100 2100 $iq->SetIQ(type=>"get"); … … 2122 2122 my %args; 2123 2123 while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); } 2124 2124 2125 2125 my $iq = $self->_iq(); 2126 2126 $iq->SetIQ(type=>"set"); … … 2181 2181 return $id; 2182 2182 } 2183 2183 2184 2184 return $self->SendWithID($iq) if ($args{mode} eq "nonblock"); 2185 2185 … … 2443 2443 $jid = $jid->GetJID(); 2444 2444 } 2445 2445 2446 2446 return unless exists($self->{ROSTERDB}); 2447 2447 return unless exists($self->{ROSTERDB}->{JIDS}); … … 2611 2611 $jid = $jid->GetJID(); 2612 2612 } 2613 2613 2614 2614 return unless $self->RosterDBExists($jid); 2615 2615 if (defined($key)) … … 2619 2619 } 2620 2620 return %{$self->{ROSTERDB}->{JIDS}->{$jid}}; 2621 } 2621 } 2622 2622 2623 2623 … … 2645 2645 } 2646 2646 } 2647 2647 2648 2648 delete($self->{ROSTERDB}->{JIDS}->{$jid}); 2649 2649 } … … 2692 2692 $self->TLSClientFailure($node); 2693 2693 } 2694 2694 2695 2695 if ($tag eq "proceed") 2696 2696 { … … 2711 2711 $timeout = 120 unless defined($timeout); 2712 2712 $timeout = 120 if ($timeout eq ""); 2713 2713 2714 2714 $self->TLSSendStartTLS(); 2715 2715 … … 2751 2751 $self->{TLS}->{error} = $message; 2752 2752 } 2753 2753 2754 2754 $self->RemoveDirectXPathCallBacks('/[@xmlns="'.&ConstXMLNS("xmpp-tls").'"]'=>$TLS_CALLBACK); 2755 2755 } … … 2764 2764 { 2765 2765 my $self = shift; 2766 2766 2767 2767 return $self->{TLS}->{secure}; 2768 2768 } … … 2777 2777 { 2778 2778 my $self = shift; 2779 2779 2780 2780 return $self->{TLS}->{done}; 2781 2781 } … … 2790 2790 { 2791 2791 my $self = shift; 2792 2792 2793 2793 return $self->{TLS}->{error}; 2794 2794 } … … 2804 2804 my $self = shift; 2805 2805 my $node = shift; 2806 2806 2807 2807 my $type = &XML::Stream::XPath($node,"*/name()"); 2808 2808 … … 2821 2821 my $self = shift; 2822 2822 my $type = shift; 2823 2823 2824 2824 $self->Send("<failure xmlns='".&ConstXMLNS('xmpp-tls')."'><${type}/></failure>"); 2825 2825 } … … 2880 2880 $self->SASLAnswerChallenge($node); 2881 2881 } 2882 2882 2883 2883 if ($tag eq "failure") 2884 2884 { 2885 2885 $self->SASLClientFailure($node); 2886 2886 } 2887 2887 2888 2888 if ($tag eq "success") 2889 2889 { … … 2906 2906 my $challenge64 = &XML::Stream::XPath($node,"text()"); 2907 2907 my $challenge = MIME::Base64::decode_base64($challenge64); 2908 2908 2909 2909 my $response = $self->SASLGetClient()->client_step($challenge); 2910 2910 … … 2929 2929 2930 2930 return unless defined($mechanisms); 2931 2931 2932 2932 my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}), 2933 2933 callback=>{ user => $username, … … 2954 2954 { 2955 2955 my $self = shift; 2956 2956 2957 2957 return $self->{SASL}->{authed}; 2958 2958 } … … 2967 2967 { 2968 2968 my $self = shift; 2969 2969 2970 2970 return $self->{SASL}->{done}; 2971 2971 } … … 2980 2980 { 2981 2981 my $self = shift; 2982 2982 2983 2983 return $self->{SASL}->{error}; 2984 2984 } … … 2994 2994 my $self = shift; 2995 2995 my $node = shift; 2996 2996 2997 2997 my $type = &XML::Stream::XPath($node,"*/name()"); 2998 2998 … … 3011 3011 my $self = shift; 3012 3012 my $node = shift; 3013 3013 3014 3014 $self->{SASL}->{authed} = 1; 3015 3015 $self->{SASL}->{done} = 1; … … 3027 3027 { 3028 3028 my $self = shift; 3029 3029 3030 3030 return $self->{SASL}->{client}; 3031 3031 } … … 3068 3068 my $self = shift; 3069 3069 my $type = shift; 3070 3070 3071 3071 $self->Send("<failure xmlns='".&ConstXMLNS('xmpp-sasl')."'><${type}/></failure>"); 3072 3072 } … … 3232 3232 } 3233 3233 3234 3234 3235 3235 ############################################################################## 3236 3236 # … … 3309 3309 { 3310 3310 my $const = shift; 3311 3311 3312 3312 return $XMLNS{$const}; 3313 3313 } -
perl/modules/Jabber/lib/Net/XMPP/Roster.pm
rc2bed55 r7869e48 30 30 Net::XMPP::Roster is a module that provides a developer an easy 31 31 interface to an XMPP roster. It provides high level functions to 32 query, update, and manage a user's roster. 32 query, update, and manage a user's roster. 33 33 34 34 =head1 DESCRIPTION … … 38 38 registers with the connection to receivce the correct packets so 39 39 that it can track all roster updates, and presence packets. 40 40 41 41 =head2 Basic Functions 42 42 … … 91 91 These functions are only needed if you want to manually control 92 92 the Roster. 93 93 94 94 $Roster->add('bob@jabber.org', 95 95 name=>"Bob", … … 131 131 otherwise. The jid can either be a string, or a 132 132 Net::XMPP::JID object. 133 133 134 134 groupExists(group) - return 1 if the group exists in the database, 135 135 undef otherwise. … … 236 236 237 237 $self->{CONNECTION} = $args{connection}; 238 238 239 239 bless($self, $proto); 240 240 241 241 $self->init(); 242 242 243 243 return $self; 244 244 } … … 365 365 366 366 $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID"); 367 367 368 368 return unless exists($self->{JIDS}); 369 369 return unless exists($self->{JIDS}->{$jid}); … … 489 489 my $resource = $jid->GetResource(); 490 490 $resource = " " unless ($resource ne ""); 491 491 492 492 $jid = $jid->GetJID(); 493 493 $jid = "" unless defined($jid); … … 505 505 { 506 506 my %item; 507 507 508 508 $item{priority} = $presence->GetPriority(); 509 509 $item{priority} = 0 unless defined($item{priority}); … … 547 547 } 548 548 } 549 549 550 550 if ($type eq "group") 551 551 { … … 597 597 598 598 $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID"); 599 599 600 600 if (defined($resource)) 601 601 { … … 604 604 return $self->{JIDS}->{$jid}->{resources}->{$resource}->{priority}; 605 605 } 606 606 607 607 return unless exists($self->{JIDS}->{$jid}->{priorities}); 608 608 my @priorities = sort{ $b <=> $a } keys(%{$self->{JIDS}->{$jid}->{priorities}}); … … 623 623 624 624 $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID"); 625 625 626 626 return unless $self->exists($jid); 627 627 if (defined($key)) … … 649 649 { 650 650 $self->{CONNECTION}->{DEBUG}->Log3("Roster::remove: deleting $jid from the DB"); 651 651 652 652 if (defined($self->query($jid,"groups"))) 653 653 { … … 661 661 } 662 662 } 663 663 664 664 delete($self->{JIDS}->{$jid}); 665 665 delete($self->{JIDS}) if (scalar(keys(%{$self->{JIDS}})) == 0); … … 696 696 if ($self->{JIDS}->{$jid}->{priorities}->{$oldPriority}->[$index]->{resource} eq $resource); 697 697 } 698 698 699 699 splice(@{$self->{JIDS}->{$jid}->{priorities}->{$oldPriority}},$loc,1); 700 700 … … 742 742 my $jid = shift; 743 743 my $resource = shift; 744 744 745 745 $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID"); 746 746 … … 765 765 766 766 $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID"); 767 767 768 768 return unless $self->resourceExists($jid,$resource); 769 769 if (defined($key)) -
perl/modules/Jabber/lib/Net/XMPP/Stanza.pm
rc2bed55 r7869e48 59 59 60 60 =pod 61 62 For more information on what these namespaces are for, visit 61 62 For more information on what these namespaces are for, visit 63 63 http://www.jabber.org and browse the Jabber Programmers Guide. 64 64 … … 66 66 67 67 ny:private:ns 68 68 69 69 Name Type Get Set Remove Defined Add 70 70 ========================== ======= === === ====== ======= === 71 71 Foo scalar X X X X 72 Bar child X 72 Bar child X 73 73 Bars child X 74 74 Test master X X … … 77 77 78 78 GetFoo(), SetFoo(), RemoveFoo(), DefinedFoo() 79 79 80 80 AddBar() 81 81 82 82 GetBars(), DefinedBars() 83 83 84 84 GetTest(), SetMaster() 85 85 … … 94 94 Name Type Get Set Remove Defined Add 95 95 ========================== ========= === === ====== ======= === 96 Digest scalar X X X X 97 Hash scalar X X X X 98 Password scalar X X X X 99 Resource scalar X X X X 100 Sequence scalar X X X X 101 Token scalar X X X X 102 Username scalar X X X X 103 Auth master X X 96 Digest scalar X X X X 97 Hash scalar X X X X 98 Password scalar X X X X 99 Resource scalar X X X X 100 Sequence scalar X X X X 101 Token scalar X X X X 102 Username scalar X X X X 103 Auth master X X 104 104 105 105 =head1 jabber:iq:privacy … … 107 107 Name Type Get Set Remove Defined Add 108 108 ========================== ========= === === ====== ======= === 109 Active scalar X X X X 110 Default scalar X X X X 111 List child X 112 Lists child X X X 113 Privacy master X X 109 Active scalar X X X X 110 Default scalar X X X X 111 List child X 112 Lists child X X X 113 Privacy master X X 114 114 115 115 =head1 jabber:iq:privacy - item objects … … 117 117 Name Type Get Set Remove Defined Add 118 118 ========================== ========= === === ====== ======= === 119 Action scalar X X X X 120 IQ flag X X X X 121 Message flag X X X X 122 Order scalar X X X X 123 PresenceIn flag X X X X 124 PresenceOut flag X X X X 125 Type scalar X X X X 126 Value scalar X X X X 127 Item master X X 119 Action scalar X X X X 120 IQ flag X X X X 121 Message flag X X X X 122 Order scalar X X X X 123 PresenceIn flag X X X X 124 PresenceOut flag X X X X 125 Type scalar X X X X 126 Value scalar X X X X 127 Item master X X 128 128 129 129 =head1 jabber:iq:privacy - list objects … … 131 131 Name Type Get Set Remove Defined Add 132 132 ========================== ========= === === ====== ======= === 133 Name scalar X X X X 134 Item child X 135 Items child X X X 136 List master X X 133 Name scalar X X X X 134 Item child X 135 Items child X X X 136 List master X X 137 137 138 138 =head1 jabber:iq:register … … 140 140 Name Type Get Set Remove Defined Add 141 141 ========================== ========= === === ====== ======= === 142 Address scalar X X X X 143 City scalar X X X X 144 Date scalar X X X X 145 Email scalar X X X X 146 First scalar X X X X 147 Instructions scalar X X X X 148 Key scalar X X X X 149 Last scalar X X X X 150 Misc scalar X X X X 151 Name scalar X X X X 152 Nick scalar X X X X 153 Password scalar X X X X 154 Phone scalar X X X X 155 Registered flag X X X X 156 Remove flag X X X X 157 State scalar X X X X 158 Text scalar X X X X 159 URL scalar X X X X 160 Username scalar X X X X 161 Zip scalar X X X X 162 Register master X X 142 Address scalar X X X X 143 City scalar X X X X 144 Date scalar X X X X 145 Email scalar X X X X 146 First scalar X X X X 147 Instructions scalar X X X X 148 Key scalar X X X X 149 Last scalar X X X X 150 Misc scalar X X X X 151 Name scalar X X X X 152 Nick scalar X X X X 153 Password scalar X X X X 154 Phone scalar X X X X 155 Registered flag X X X X 156 Remove flag X X X X 157 State scalar X X X X 158 Text scalar X X X X 159 URL scalar X X X X 160 Username scalar X X X X 161 Zip scalar X X X X 162 Register master X X 163 163 164 164 =head1 jabber:iq:roster … … 166 166 Name Type Get Set Remove Defined Add 167 167 ========================== ========= === === ====== ======= === 168 Item child X 169 Items child X 170 Roster master X X 168 Item child X 169 Items child X 170 Roster master X X 171 171 172 172 =head1 jabber:iq:roster - item objects … … 174 174 Name Type Get Set Remove Defined Add 175 175 ========================== ========= === === ====== ======= === 176 Ask scalar X X X X 177 Group array X X X X 178 JID jid X X X X 179 Name scalar X X X X 180 Subscription scalar X X X X 181 Item master X X 176 Ask scalar X X X X 177 Group array X X X X 178 JID jid X X X X 179 Name scalar X X X X 180 Subscription scalar X X X X 181 Item master X X 182 182 183 183 =head1 urn:ietf:params:xml:ns:xmpp-bind … … 185 185 Name Type Get Set Remove Defined Add 186 186 ========================== ========= === === ====== ======= === 187 JID jid X X X X 188 Resource scalar X X X X 189 Bind master X X 187 JID jid X X X X 188 Resource scalar X X X X 189 Bind master X X 190 190 191 191 =head1 urn:ietf:params:xml:ns:xmpp-session … … 193 193 Name Type Get Set Remove Defined Add 194 194 ========================== ========= === === ====== ======= === 195 Session master X X 195 Session master X X 196 196 197 197 … … 233 233 234 234 $self->{FUNCS} = \%FUNCTIONS; 235 235 236 236 my $result = $self->_init(@_); 237 237 238 238 return $result if defined($result); 239 239 240 240 return $self; 241 241 } … … 309 309 # 310 310 ############################################################################## 311 sub GetXML 311 sub GetXML 312 312 { 313 313 my $self = shift; … … 324 324 { 325 325 my $self = shift; 326 326 327 327 return $self->{TAG}; 328 328 } … … 345 345 $node->remove_attrib("xmlns") 346 346 if (exists($self->{SKIPXMLNS}) && ($keepXMLNS == 0)); 347 347 348 348 foreach my $child (@{$self->{CHILDREN}}) 349 349 { … … 365 365 366 366 return $node; 367 } 367 } 368 368 369 369 … … 379 379 my $xmlns = shift; 380 380 my $tag = shift; 381 381 382 382 return unless exists($Net::XMPP::Namespaces::NS{$xmlns}); 383 383 … … 388 388 if exists($Net::XMPP::Namespaces::NS{$xmlns}); 389 389 } 390 390 391 391 my $node = new XML::Stream::Node($tag); 392 392 $node->put_attrib(xmlns=>$xmlns); … … 445 445 my $xmlns = shift; 446 446 my $tag = shift; 447 447 448 448 return unless exists($Net::XMPP::Namespaces::NS{$xmlns}); 449 449 … … 454 454 if exists($Net::XMPP::Namespaces::NS{$xmlns}); 455 455 } 456 456 457 457 my $node = new XML::Stream::Node($tag); 458 458 $node->put_attrib(xmlns=>$xmlns); … … 592 592 593 593 #$self->_debug("_xpath_AUTOLOAD: setFuncs(",join(",",@setFuncs),")"); 594 595 594 595 596 596 my $type = (exists($funcs->{$var}->{type}) ? 597 597 $funcs->{$var}->{type} : … … 607 607 608 608 my $child = ""; 609 609 610 610 #------------------------------------------------------------------------- 611 611 # When this is a master function... change the above variables... … … 630 630 (ref($funcType) eq "ARRAY")); 631 631 } 632 632 633 633 $child = \@newSetFuncs; 634 634 } … … 644 644 { 645 645 $child = $funcs->{$var}->{child}; 646 646 647 647 #$self->_debug("_xpath_AUTOLOAD: child($child)"); 648 648 649 649 if (exists($child->{ns})) 650 650 { 651 651 my $addXMLNS = $child->{ns}; 652 652 653 653 my $addFuncs = $Net::XMPP::Namespaces::NS{$addXMLNS}->{xpath}; 654 654 my @calls = … … 691 691 692 692 my $funcs; 693 693 694 694 my $coreFuncs = $self->{FUNCS}; 695 695 #eval "\$coreFuncs = \\%".$package."::FUNCTIONS"; … … 750 750 751 751 #$self->_debug("_xpath: call($call) args(",join(",",@_),")"); 752 752 753 753 if ($call eq "Get") { return $self->_xpath_get(@_) ; } 754 754 elsif ($call eq "Set") { return $self->_xpath_set(@_); } … … 761 761 ############################################################################## 762 762 # 763 # _xpath_get - returns the value stored in the node 763 # _xpath_get - returns the value stored in the node 764 764 # 765 765 ############################################################################## … … 771 771 my $childtype = shift; 772 772 my ($arg0) = shift; 773 773 774 774 #$self->_debug("_xpath_get: self($self) type($type) xpath($xpath) childtype($childtype)"); 775 775 #$self->{TREE}->debug(); … … 777 777 my $subType; 778 778 ($type,$subType) = $self->_xpath_resolve_types($type); 779 779 780 780 781 781 #------------------------------------------------------------------------- … … 785 785 { 786 786 my %fields; 787 787 788 788 foreach my $func (sort {$a cmp $b} @{$childtype}) 789 789 { … … 808 808 return %fields; 809 809 } 810 810 811 811 #------------------------------------------------------------------------- 812 812 # type == node … … 814 814 # XXX Remove this if there are no problems 815 815 #if ($type eq "node") 816 #{ 816 #{ 817 817 #$self->_debug("_xpath_get: node: xmlns($arg0)") if defined($arg0); 818 818 … … 825 825 #push(@results,$child) 826 826 # if (!defined($arg0) || 827 # ($arg0 eq "") || 827 # ($arg0 eq "") || 828 828 # ($child->GetTree(1)->get_attrib("xmlns") eq $arg0)); 829 829 #} … … 866 866 return $#nodes > -1; 867 867 } 868 868 869 869 #------------------------------------------------------------------------- 870 870 # type == array … … 875 875 return $nodes[0]; 876 876 } 877 877 878 878 #------------------------------------------------------------------------- 879 879 # type == raw … … 884 884 885 885 return join("",@{$self->{RAWXML}}) if ($#{$self->{RAWXML}} > -1); 886 886 887 887 foreach my $node (@nodes) 888 888 { … … 1047 1047 #$self->_debug("_xpath_set: val($val)") unless !defined($val); 1048 1048 #$self->_debug("_xpath_set: path($path)"); 1049 1049 1050 1050 my $childPath = ""; 1051 1051 while(($path !~ /^\/?\@/) && ($path !~ /^\/?text\(\)/)) … … 1056 1056 #$self->_debug("_xpath_set: path($path)"); 1057 1057 #$self->_debug("_xpath_set: childPath($childPath)"); 1058 1058 1059 1059 if (($type eq "scalar") || ($type eq "jid") || ($type eq "timestamp")) 1060 1060 { 1061 1061 my $tmpPath = $child; 1062 1062 $tmpPath = "$childPath/$child" if ($childPath ne ""); 1063 1063 1064 1064 my @nodes = $self->{TREE}->XPath("$tmpPath"); 1065 1065 #$self->_debug("_xpath_set: \$#nodes($#nodes)"); … … 1092 1092 return; 1093 1093 } 1094 1094 1095 1095 $childPath .= "/" unless ($childPath eq ""); 1096 1096 $childPath .= $child; … … 1098 1098 1099 1099 my ($piece) = ($path =~ /^\/?([^\/]+)/); 1100 1100 1101 1101 #$self->_debug("_xpath_set: piece($piece)"); 1102 1102 … … 1145 1145 my @nodes = $self->{TREE}->XPath($xpath); 1146 1146 my $defined = ($#nodes > -1); 1147 1147 1148 1148 #$self->_debug("_xpath_defined: nodes(",join(",",@nodes),")"); 1149 1149 #$self->_debug("_xpath_defined: ",$#nodes); 1150 1150 1151 1151 if (!$defined && (($type eq "child") || ($type eq "children") || ($type eq "node"))) 1152 1152 { … … 1155 1155 $ns = $childtype->{ns}; 1156 1156 } 1157 1157 1158 1158 foreach my $packet (@{$self->{CHILDREN}}) 1159 1159 { … … 1174 1174 ############################################################################## 1175 1175 # 1176 # _xpath_add - returns the value stored in the node 1176 # _xpath_add - returns the value stored in the node 1177 1177 # 1178 1178 ############################################################################## … … 1242 1242 1243 1243 #$self->_debug("_xpath_remove: nodes($#nodes)"); 1244 1244 1245 1245 if ($xpath =~ /\@(\S+)/) 1246 1246 { 1247 1247 my $attrib = $1; 1248 1248 #$self->_debug("_xpath_remove: attrib($attrib)"); 1249 1249 1250 1250 if ($nodePath eq "") 1251 1251 { … … 1261 1261 return; 1262 1262 } 1263 1263 1264 1264 foreach my $node (@nodes) 1265 1265 { … … 1292 1292 my $self = shift; 1293 1293 my $type = shift; 1294 1294 1295 1295 my $subType = ""; 1296 1296 if (ref($type) eq "ARRAY") … … 1307 1307 } 1308 1308 } 1309 1309 1310 1310 #$self->_debug("_xpath_resolve_types: type($type) subtype($subType)"); 1311 1311 -
perl/modules/Jabber/lib/XML/Stream.pm
ra8d5a39 r7869e48 317 317 318 318 my $lc = lc($module); 319 319 320 320 eval("\$HANDLERS{\$lc}->{startElement} = \\&XML::Stream::${module}::_handle_element;"); 321 321 eval("\$HANDLERS{\$lc}->{endElement} = \\&XML::Stream::${module}::_handle_close;"); … … 600 600 601 601 my $root = $self->GetRoot($sid); 602 602 603 603 if ($root->{xmlns} ne $self->{SIDS}->{$serverid}->{namespace}) 604 604 { … … 668 668 } 669 669 while($#_ >= 0) { $self->{SIDS}->{newconnection}->{ lc pop(@_) } = pop(@_); } 670 670 671 671 my $timeout = exists($self->{SIDS}->{newconnection}->{timeout}) ? 672 672 delete($self->{SIDS}->{newconnection}->{timeout}) : … … 674 674 675 675 $self->debug(4,"Connect: timeout($timeout)"); 676 676 677 677 678 678 if (exists($self->{SIDS}->{newconnection}->{srv})) … … 683 683 my $res = Net::DNS::Resolver->new(); 684 684 my $query = $res->query($self->{SIDS}->{newconnection}->{srv}.".".$self->{SIDS}->{newconnection}->{hostname},"SRV"); 685 685 686 686 if ($query) 687 { 687 { 688 688 $self->{SIDS}->{newconnection}->{hostname} = ($query->answer)[0]->target(); 689 689 $self->{SIDS}->{newconnection}->{port} = ($query->answer)[0]->port(); … … 771 771 $self->{SIDS}->{newconnection}->{sock} = 772 772 new FileHandle(">&STDOUT"); 773 } 773 } 774 774 775 775 #--------------------------------------------------------------------------- … … 1030 1030 #--------------------------------------------------------------------------- 1031 1031 my %stream_args; 1032 1032 1033 1033 if (($self->{SIDS}->{$currsid}->{connectiontype} eq "tcpip") || 1034 1034 ($self->{SIDS}->{$currsid}->{connectiontype} eq "http")) … … 1036 1036 $stream_args{to}= $self->{SIDS}->{$currsid}->{hostname} 1037 1037 unless exists($self->{SIDS}->{$currsid}->{to}); 1038 1038 1039 1039 $stream_args{to} = $self->{SIDS}->{$currsid}->{to} 1040 1040 if exists($self->{SIDS}->{$currsid}->{to}); … … 1044 1044 ($self->{SIDS}->{$currsid}->{myhostname} ne "") 1045 1045 ); 1046 1046 1047 1047 $stream_args{from} = $self->{SIDS}->{$currsid}->{from} 1048 1048 if exists($self->{SIDS}->{$currsid}->{from}); 1049 1049 1050 1050 $stream_args{id} = $self->{SIDS}->{$currsid}->{id} 1051 1051 if (exists($self->{SIDS}->{$currsid}->{id}) && … … 1055 1055 $stream_args{namespaces} = $self->{SIDS}->{$currsid}->{namespaces}; 1056 1056 } 1057 1057 1058 1058 my $stream = 1059 1059 $self->StreamHeader( … … 1172 1172 } 1173 1173 } 1174 1174 1175 1175 return $self->GetRoot($sid); 1176 1176 } … … 1333 1333 #--------------------------------------------------------------------------- 1334 1334 $self->{SIDS}->{$sid}->{streamfeatures}->{received} = 0; 1335 1335 1336 1336 #--------------------------------------------------------------------------- 1337 1337 # First acitivty is the connection... duh. =) … … 1522 1522 $self->debug(4,"Process: sid($sid) time(",time,") timeout(undef)"); 1523 1523 } 1524 1524 1525 1525 $self->Respond($sid) 1526 1526 if (exists($self->{SIDS}->{$sid}->{activitytimeout}) && … … 1637 1637 $self->debug(3,"Send: sid($sid)"); 1638 1638 $self->debug(3,"Send: status($self->{SIDS}->{$sid}->{status})"); 1639 1639 1640 1640 $self->{SIDS}->{$sid}->{keepalive} = time; 1641 1641 … … 1677 1677 return; 1678 1678 } 1679 1679 1680 1680 $self->debug(4,"Send: SENDWRITTEN($self->{SENDWRITTEN})"); 1681 1681 … … 1736 1736 } 1737 1737 } 1738 1738 1739 1739 #------------------------------------------------------------------------- 1740 1740 # XMPP-TLS - 1.0 … … 1753 1753 } 1754 1754 } 1755 1755 1756 1756 #------------------------------------------------------------------------- 1757 1757 # XMPP-Bind - 1.0 … … 1762 1762 $self->{SIDS}->{$sid}->{streamfeatures}->{'xmpp-bind'} = 1; 1763 1763 } 1764 1764 1765 1765 #------------------------------------------------------------------------- 1766 1766 # XMPP-Session - 1.0 … … 1771 1771 $self->{SIDS}->{$sid}->{streamfeatures}->{'xmpp-session'} = 1; 1772 1772 } 1773 1773 1774 1774 } 1775 1775 … … 1833 1833 $self->TLSClientFailure($sid,$node); 1834 1834 } 1835 1835 1836 1836 if ($tag eq "proceed") 1837 1837 { … … 1853 1853 $timeout = 120 unless defined($timeout); 1854 1854 $timeout = 120 if ($timeout eq ""); 1855 1855 1856 1856 $self->TLSStartTLS($sid); 1857 1857 … … 1904 1904 return; 1905 1905 } 1906 1906 1907 1907 IO::Socket::SSL->start_SSL($self->{SIDS}->{$sid}->{sock},{SSL_verify_mode=>0x00}); 1908 1908 … … 1910 1910 $self->debug(1,"TLSClientProceed: SSL: We are secure") 1911 1911 if ($self->{SIDS}->{$sid}->{sock}); 1912 1912 1913 1913 $self->{SIDS}->{$sid}->{tls}->{done} = 1; 1914 1914 $self->{SIDS}->{$sid}->{tls}->{secure} = 1; … … 1925 1925 my $self = shift; 1926 1926 my $sid = shift; 1927 1927 1928 1928 return $self->{SIDS}->{$sid}->{tls}->{secure}; 1929 1929 } … … 1939 1939 my $self = shift; 1940 1940 my $sid = shift; 1941 1941 1942 1942 return $self->{SIDS}->{$sid}->{tls}->{done}; 1943 1943 } … … 1953 1953 my $self = shift; 1954 1954 my $sid = shift; 1955 1955 1956 1956 return $self->{SIDS}->{$sid}->{tls}->{error}; 1957 1957 } … … 1968 1968 my $sid = shift; 1969 1969 my $node = shift; 1970 1970 1971 1971 my $type = &XPath($node,"*/name()"); 1972 1972 … … 1986 1986 my $sid = shift; 1987 1987 my $type = shift; 1988 1988 1989 1989 $self->Send($sid,"<failure xmlns='".&ConstXMLNS('xmpp-tls')."'><${type}/></failure>"); 1990 1990 } … … 2018 2018 $self->SASLAnswerChallenge($sid,$node); 2019 2019 } 2020 2020 2021 2021 if ($tag eq "failure") 2022 2022 { 2023 2023 $self->SASLClientFailure($sid,$node); 2024 2024 } 2025 2025 2026 2026 if ($tag eq "success") 2027 2027 { … … 2045 2045 my $challenge64 = &XPath($node,"text()"); 2046 2046 my $challenge = MIME::Base64::decode_base64($challenge64); 2047 2047 2048 2048 #------------------------------------------------------------------------- 2049 2049 # As far as I can tell, if the challenge contains rspauth, then we authed. … … 2112 2112 2113 2113 return unless defined($mechanisms); 2114 2114 2115 2115 my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}), 2116 2116 callback=>{ … … 2140 2140 my $self = shift; 2141 2141 my $sid = shift; 2142 2142 2143 2143 return $self->{SIDS}->{$sid}->{sasl}->{authed}; 2144 2144 } … … 2154 2154 my $self = shift; 2155 2155 my $sid = shift; 2156 2156 2157 2157 return $self->{SIDS}->{$sid}->{sasl}->{done}; 2158 2158 } … … 2168 2168 my $self = shift; 2169 2169 my $sid = shift; 2170 2170 2171 2171 return $self->{SIDS}->{$sid}->{sasl}->{error}; 2172 2172 } … … 2183 2183 my $sid = shift; 2184 2184 my $node = shift; 2185 2185 2186 2186 my $type = &XPath($node,"*/name()"); 2187 2187 … … 2201 2201 my $sid = shift; 2202 2202 my $node = shift; 2203 2203 2204 2204 $self->{SIDS}->{$sid}->{sasl}->{authed} = 1; 2205 2205 $self->{SIDS}->{$sid}->{sasl}->{done} = 1; … … 2217 2217 my $sid = shift; 2218 2218 my $type = shift; 2219 2219 2220 2220 $self->Send($sid,"<failure xmlns='".&ConstXMLNS('xmpp-sasl')."'><${type}/></failure>"); 2221 2221 } … … 2292 2292 # Make sure we are receiving a valid stream on the same namespace. 2293 2293 #--------------------------------------------------------------------- 2294 2294 2295 2295 $self->debug(3,"_handle_root: ($self->{SIDS}->{$self->{SIDS}->{$sid}->{serverid}}->{namespace})"); 2296 2296 $self->{SIDS}->{$sid}->{status} = … … 2328 2328 } 2329 2329 } 2330 2330 2331 2331 #------------------------------------------------------------------------- 2332 2332 # Sometimes we will get an error, so let's parse the tag assuming that we … … 2335 2335 my $stream_prefix = $self->StreamPrefix($sid); 2336 2336 $self->debug(5,"_handle_root: stream_prefix($stream_prefix)"); 2337 2337 2338 2338 if ($tag eq $stream_prefix.":error") 2339 2339 { … … 2441 2441 $self->{SIDS}->{$sid}->{streamerror}->{type} = "unknown"; 2442 2442 $self->{SIDS}->{$sid}->{streamerror}->{node} = $node; 2443 2443 2444 2444 #------------------------------------------------------------------------- 2445 2445 # Check for older 0.9 streams and handle the errors for them. … … 2676 2676 my $tree = shift; 2677 2677 my $path = shift; 2678 2678 2679 2679 my $query = new XML::Stream::XPath::Query($path); 2680 2680 my $result = $query->execute($tree); … … 2683 2683 my %attribs = $result->getAttribs(); 2684 2684 return %attribs if (scalar(keys(%attribs)) > 0); 2685 2685 2686 2686 my @values = $result->getValues(); 2687 2687 @values = $result->getList() unless ($#values > -1); … … 2703 2703 my $tree = shift; 2704 2704 my $path = shift; 2705 2705 2706 2706 my $query = new XML::Stream::XPath::Query($path); 2707 2707 my $result = $query->execute($tree); … … 2891 2891 { 2892 2892 my $const = shift; 2893 2893 2894 2894 return $XMLNS{$const}; 2895 2895 } … … 2905 2905 my $self = shift; 2906 2906 my $sid = shift; 2907 2907 2908 2908 return $self->ns2prefix($sid,&ConstXMLNS("stream")); 2909 2909 } … … 2991 2991 2992 2992 $self->debug(1,"LoadSSL: Load the IO::Socket::SSL module"); 2993 2993 2994 2994 if (defined($SSL) && ($SSL == 1)) 2995 2995 { … … 2997 2997 return 1; 2998 2998 } 2999 2999 3000 3000 if (defined($SSL) && ($SSL == 0)) 3001 3001 { … … 3106 3106 $stream .= " ".$ns->GetStream(); 3107 3107 } 3108 3108 3109 3109 $stream .= ">"; 3110 3110 -
perl/modules/Jabber/lib/XML/Stream/Namespace.pm
rc2bed55 r7869e48 25 25 =head1 NAME 26 26 27 XML::Stream::Namespace - Object to make defining Namespaces easier in 27 XML::Stream::Namespace - Object to make defining Namespaces easier in 28 28 XML::Stream. 29 29 … … 49 49 GetAttributes() returns a hash ( attrib1=>"value1",attrib2=>"value2") 50 50 GetStream() returns the following string: 51 "xmlns:mynamespace='http://www.nynamespace.com/xmlns' 52 mynamespace:attrib1='value1' 51 "xmlns:mynamespace='http://www.nynamespace.com/xmlns' 52 mynamespace:attrib1='value1' 53 53 mynamespace:attrib2='value2'" 54 54 … … 71 71 # of the stream to foo.bar.org:1234... 72 72 # 73 # <stream:stream 73 # <stream:stream 74 74 # xmlns:stream="http://etherx.jabber.org/streams" 75 75 # to="foo.bar.org" 76 # xmlns="foo:bar" 76 # xmlns="foo:bar" 77 77 # xmlns:mynamespace="http://www.mynamespace.org/xmlns" 78 78 # mynamespace:foo="bar" 79 79 # mynamespace:bob="vila"> 80 80 # 81 81 82 82 83 83 =head1 AUTHOR … … 183 183 $string .= "='".$self->GetAttributes($attrib)."'"; 184 184 } 185 185 186 186 return $string; 187 187 } -
perl/modules/Jabber/lib/XML/Stream/Node.pm
rc2bed55 r7869e48 85 85 86 86 remove_child(node) - removes the child node from the current node. 87 87 88 88 remove_cdata() - removes all of the cdata children from the current node. 89 89 … … 120 120 121 121 XPath(path) - run XML::Stream::XPath on this node. 122 122 123 123 XPathCheck(path) - run XML::Stream::XPath on this node and return 1 or 0 124 124 to see if it matches or not. … … 266 266 267 267 return $cdata; 268 } 268 } 269 269 270 270 … … 286 286 splice(@{$self->{CHILDREN}},$index,1); 287 287 } 288 } 288 } 289 289 290 290 … … 294 294 return () unless exists($self->{ATTRIBS}); 295 295 return %{$self->{ATTRIBS}}; 296 } 296 } 297 297 298 298 … … 308 308 309 309 sub put_attrib 310 { 310 { 311 311 my $self = shift; 312 312 my (%att) = @_; … … 366 366 my ($tag) = @_; 367 367 368 $self->{TAG} = $tag; 368 $self->{TAG} = $tag; 369 369 } 370 370 … … 513 513 514 514 $self->debug(2,"Node: _handle_close: check2(",$#{$self->{SIDS}->{$sid}->{node}},")"); 515 515 516 516 if($#{$self->{SIDS}->{$sid}->{node}} == -1) 517 517 { … … 521 521 { 522 522 my $stream_prefix = $self->StreamPrefix($sid); 523 523 524 524 if(defined($self->{SIDS}->{$sid}->{node}->[0]) && 525 525 ($self->{SIDS}->{$sid}->{node}->[0]->get_tag() =~ /^${stream_prefix}\:/)) … … 542 542 { 543 543 my $xmlns = $node->get_attrib("xmlns"); 544 544 545 545 $self->ProcessSASLPacket($sid,$node) 546 546 if ($xmlns eq &XML::Stream::ConstXMLNS("xmpp-sasl")); -
perl/modules/Jabber/lib/XML/Stream/Parser.pm
rc2bed55 r7869e48 324 324 $self->{CNAME}->[$self->{CURR}] = $name; 325 325 } 326 326 327 327 $self->{XML} = substr($self->{XML},$close+1,length($self->{XML})-$close-1); 328 328 next; … … 337 337 return $self->returnData(0); 338 338 } 339 339 340 340 &{$self->{HANDLER}->{characters}}($self,substr($self->{XML},9,$cdataclose-9)); 341 341 342 342 $self->{XML} = substr($self->{XML},$cdataclose+3,length($self->{XML})-$cdataclose-3); 343 343 next; … … 510 510 return unless ($self->{DOC} == 1); 511 511 512 if ($self->{STYLE} eq "debug") 512 if ($self->{STYLE} eq "debug") 513 513 { 514 514 my $str = $cdata; … … 530 530 push @{$self->{TREE}[$#{$self->{TREE}}]}, 0; 531 531 push @{$self->{TREE}[$#{$self->{TREE}}]}, $cdata; 532 } 532 } 533 533 } 534 534 } -
perl/modules/Jabber/lib/XML/Stream/Tree.pm
rc2bed55 r7869e48 142 142 push @{$self->{SIDS}->{$sid}->{tree}[$#{$self->{SIDS}->{$sid}->{tree}}]}, 0; 143 143 push @{$self->{SIDS}->{$sid}->{tree}[$#{$self->{SIDS}->{$sid}->{tree}}]}, $cdata; 144 } 144 } 145 145 } 146 146 … … 187 187 if(defined($self->{SIDS}->{$sid}->{tree}->[0]) && 188 188 ($self->{SIDS}->{$sid}->{tree}->[0] =~ /^${stream_prefix}\:/)) 189 { 189 { 190 190 my @tree = @{$self->{SIDS}->{$sid}->{tree}}; 191 191 $self->{SIDS}->{$sid}->{tree} = []; … … 196 196 my @tree = @{$self->{SIDS}->{$sid}->{tree}}; 197 197 $self->{SIDS}->{$sid}->{tree} = []; 198 198 199 199 my @special = 200 200 &XML::Stream::XPath( … … 384 384 return 1; 385 385 } 386 386 387 387 #--------------------------------------------------------------------- 388 388 # Return the raw CDATA value without mark ups, or the value of the … … 592 592 593 593 my $str = ""; 594 if (ref($parseTree->[0]) eq "") 594 if (ref($parseTree->[0]) eq "") 595 595 { 596 596 if ($parseTree->[0] eq "0") … … 608 608 { 609 609 $str .= ">"; 610 610 611 611 my $index = 1; 612 612 while($index <= $#{$parseTree->[1]}) … … 616 616 $index += 2; 617 617 } 618 618 619 619 $str .= $rawXML if defined($rawXML); 620 620 $str .= "</".$parseTree->[0].">"; -
perl/modules/Jabber/lib/XML/Stream/XPath/Op.pm
rc2bed55 r7869e48 50 50 $self->{TYPE} = shift; 51 51 $self->{VALUE} = shift; 52 52 53 53 return $self; 54 54 } … … 165 165 { 166 166 push(@valid_elems,$elem); 167 } 168 } 169 170 $$ctxt->setList(@valid_elems); 171 167 } 168 } 169 170 $$ctxt->setList(@valid_elems); 171 172 172 if ($#valid_elems == -1) 173 173 { … … 224 224 225 225 my @valid_elems; 226 226 227 227 foreach my $elem (@elems) 228 228 { 229 229 push(@valid_elems,$self->descend($elem)); 230 230 } 231 231 232 232 $$ctxt->setList(@valid_elems); 233 233 … … 247 247 248 248 my @valid_elems; 249 249 250 250 if (($self->{VALUE} eq "*") || (&XML::Stream::GetXMLData("tag",$elem) eq $self->{VALUE})) 251 251 { 252 252 push(@valid_elems,$elem); 253 253 } 254 254 255 255 foreach my $child (&XML::Stream::GetXMLData("child array",$elem,"*")) 256 256 { 257 257 push(@valid_elems,$self->descend($child)); 258 258 } 259 259 260 260 return @valid_elems; 261 261 } … … 326 326 } 327 327 } 328 328 329 329 $$ctxt->setList(@valid_elems); 330 330 … … 343 343 my $elem = shift; 344 344 return &XML::Stream::GetXMLData("value",$elem); 345 } 345 } 346 346 347 347 … … 374 374 $tmp_ctxt->setList($$ctxt->getList()); 375 375 $tmp_ctxt->in_context(0); 376 376 377 377 if (!$self->{OP_L}->isValid(\$tmp_ctxt) || !$self->{OP_R}->isValid(\$tmp_ctxt)) 378 378 { … … 393 393 @valid_elems = $$ctxt->getList(); 394 394 } 395 395 396 396 $$ctxt->setList(@valid_elems); 397 397 … … 414 414 print $space," op_l: "; 415 415 $self->{OP_L}->display($space." "); 416 416 417 417 print $space," op_r: "; 418 418 $self->{OP_R}->display($space." "); … … 449 449 $tmp_ctxt->setList($$ctxt->getList()); 450 450 $tmp_ctxt->in_context(0); 451 451 452 452 if (!$self->{OP_L}->isValid(\$tmp_ctxt) || !$self->{OP_R}->isValid(\$tmp_ctxt)) 453 453 { … … 468 468 @valid_elems = $$ctxt->getList(); 469 469 } 470 470 471 471 $$ctxt->setList(@valid_elems); 472 472 … … 489 489 print $space," op_l: "; 490 490 $self->{OP_L}->display($space." "); 491 491 492 492 print $space," op_r: "; 493 493 $self->{OP_R}->display($space." "); … … 524 524 my @values; 525 525 my %attribs; 526 526 527 527 foreach my $elem (@elems) 528 528 { … … 558 558 return; 559 559 } 560 560 561 561 return 1; 562 562 } … … 607 607 my $opl = $self->{OP_L}->isValid($ctxt); 608 608 my $opr = $self->{OP_R}->isValid($ctxt); 609 609 610 610 if ($opl && $opr) 611 611 { … … 628 628 print $space," op_l: \n"; 629 629 $self->{OP_L}->display($space." "); 630 630 631 631 print $space," op_r: \n"; 632 632 $self->{OP_R}->display($space." "); … … 672 672 my $opl = $self->{OP_L}->isValid(\$tmp_ctxt_l); 673 673 my $opr = $self->{OP_R}->isValid(\$tmp_ctxt_r); 674 674 675 675 if ($opl || $opr) 676 676 { 677 677 push(@valid_elems,$elem); 678 } 679 } 680 681 $$ctxt->setList(@valid_elems); 682 678 } 679 } 680 681 $$ctxt->setList(@valid_elems); 682 683 683 if ($#valid_elems == -1) 684 684 { … … 699 699 print "$space op_l: "; 700 700 $self->{OP_L}->display("$space "); 701 701 702 702 print "$space op_r: "; 703 703 $self->{OP_R}->display("$space "); … … 750 750 my $self = shift; 751 751 my $elem = shift; 752 752 753 753 my $result; 754 754 eval("\$result = &{\$XML::Stream::XPath::VALUES{\$self->{VALUE}}}(\$elem);"); … … 790 790 push(@valid_elems,$elem); 791 791 push(@valid_values,$text); 792 } 792 } 793 793 } 794 794 795 795 $$ctxt->setList(@valid_elems); 796 796 $$ctxt->setValues(@valid_values); 797 797 798 798 if ($#valid_elems == -1) 799 799 { … … 819 819 { 820 820 push(@valid_elems,$elem); 821 } 822 } 823 824 $$ctxt->setList(@valid_elems); 825 821 } 822 } 823 824 $$ctxt->setList(@valid_elems); 825 826 826 if ($#valid_elems == -1) 827 827 { … … 848 848 push(@valid_elems,$elem); 849 849 push(@valid_values,$text); 850 } 850 } 851 851 } 852 852 853 853 $$ctxt->setList(@valid_elems); 854 854 $$ctxt->setValues(@valid_values); 855 855 856 856 if ($#valid_elems == -1) 857 857 { … … 878 878 { 879 879 push(@valid_elems,$elem); 880 } 881 } 882 883 $$ctxt->setList(@valid_elems); 884 880 } 881 } 882 883 $$ctxt->setList(@valid_elems); 884 885 885 if ($#valid_elems == -1) 886 886 { -
perl/modules/Jabber/lib/XML/Stream/XPath/Query.pm
rc2bed55 r7869e48 37 37 bless($self,$proto); 38 38 39 $self->{TOKENS} = [ '/','[',']','@','"',"'",'=','!','(',')',':',' ',',']; 39 $self->{TOKENS} = [ '/','[',']','@','"',"'",'=','!','(',')',':',' ',',']; 40 40 $self->{QUERY} = shift; 41 41 42 42 if (!defined($self->{QUERY}) || ($self->{QUERY} eq "")) 43 43 { 44 44 confess("No query string specified"); 45 45 } 46 46 47 47 $self->parseQuery(); 48 48 49 49 return $self; 50 50 } … … 52 52 53 53 sub getNextToken 54 { 54 { 55 55 my $self = shift; 56 56 my $pos = shift; … … 104 104 my $token_start = ++$$pos; 105 105 my $ident; 106 106 107 107 if (defined($token)) 108 108 { … … 193 193 return; 194 194 } 195 195 196 196 $$pos = $token_start; 197 197 my $val = $self->getNextIdentifier($pos); … … 234 234 235 235 $self->getOp($pos,$token); 236 236 237 237 foreach my $arg ($op_pos..$#{$self->{OPS}}) 238 238 { … … 241 241 242 242 splice(@{$self->{OPS}},$op_pos); 243 243 244 244 } 245 245 elsif ($token eq ")") … … 261 261 confess("Found ',' but not in a function"); 262 262 } 263 263 264 264 } 265 265 elsif ($token eq "=") … … 280 280 } 281 281 $$pos++; 282 282 283 283 my $tmp_op; 284 284 while(!defined($tmp_op)) … … 307 307 confess("Token undefined"); 308 308 } 309 309 310 310 $loop = 0 unless $in_context; 311 311 } -
perl/modules/Jabber/lib/XML/Stream/XPath/Value.pm
rc2bed55 r7869e48 96 96 97 97 sub getAttribs 98 { 98 { 99 99 my $self = shift; 100 100 return unless (scalar(keys(%{$self->{ATTRIBS}})) > 0); -
perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm
rb8a3e00 r7869e48 137 137 my $twitter_args = { username => $cfg->{user}, 138 138 password => $cfg->{password}, 139 source => 'barnowl', 139 source => 'barnowl', 140 140 }; 141 141 if (defined $cfg->{service}) { … … 230 230 my $handle = find_account($account); 231 231 $handle->twitter(@_); 232 } 232 } 233 233 else { 234 234 # broadcast … … 258 258 summary => 'Send a Twitter @ message', 259 259 usage => 'twitter-atreply USER [ACCOUNT]', 260 description => 'Send a Twitter @reply Message to USER on ACCOUNT (defaults to default_sender,' 260 description => 'Send a Twitter @reply Message to USER on ACCOUNT (defaults to default_sender,' 261 261 . "\nor first service if no default is provided)" 262 262 } -
perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm
r4ebbfbc r7869e48 397 397 type => 'Twitter', 398 398 sender => $self->{cfg}->{user} || $self->{user}, 399 recipient => $who, 399 recipient => $who, 400 400 direction => 'out', 401 401 body => $msg, -
perl/modules/WordWrap/inc/Module/Install/Metadata.pm
r1375a6a r7869e48 482 482 sub _perl_version { 483 483 my $v = $_[-1]; 484 $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; 484 $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; 485 485 $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; 486 486 $v =~ s/(\.\d\d\d)000$/$1/; … … 505 505 sub write_mymeta { 506 506 my $self = shift; 507 507 508 508 # If there's no existing META.yml there is nothing we can do 509 509 return unless -f 'META.yml'; -
perlconfig.c
r6401db3 r7869e48 117 117 owl_new_sv(owl_pair_get_value(pair)),0); 118 118 } 119 119 120 120 MSG2H(h, type); 121 121 MSG2H(h, direction); … … 132 132 MSG2H(h, zwriteline); 133 133 if (owl_message_get_header(m)) { 134 MSG2H(h, header); 134 MSG2H(h, header); 135 135 } 136 136 (void)hv_store(h, "time", strlen("time"), owl_new_sv(owl_message_get_timestr(m)),0); … … 232 232 SV *msgref, *srv; 233 233 char *out; 234 234 235 235 ENTER ; 236 236 SAVETMPS; 237 237 238 238 PUSHMARK(SP) ; 239 239 msgref = owl_perlconfig_message2hashref(m); 240 240 XPUSHs(sv_2mortal(msgref)); 241 241 PUTBACK ; 242 242 243 243 count = call_pv(subname, G_SCALAR|G_EVAL); 244 244 245 245 SPAGAIN ; 246 246 … … 263 263 out = NULL; 264 264 } 265 265 266 266 PUTBACK ; 267 267 FREETMPS ; … … 543 543 XPUSHs(sv_2mortal(newSViv(success))); 544 544 PUTBACK; 545 545 546 546 call_sv(cb, G_DISCARD|G_EVAL); 547 547 -
perlglue.xs
rb303ba2 r7869e48 171 171 CODE: 172 172 { 173 owl_function_adminmsg(header, body); 174 } 175 176 177 const char * 173 owl_function_adminmsg(header, body); 174 } 175 176 177 const char * 178 178 get_data_dir () 179 179 CODE: … … 182 182 RETVAL 183 183 184 const char * 184 const char * 185 185 get_config_dir () 186 186 CODE: 187 187 RETVAL = owl_global_get_confdir(&g); 188 188 OUTPUT: 189 RETVAL 190 191 void 192 popless_text(text) 189 RETVAL 190 191 void 192 popless_text(text) 193 193 const char *text 194 194 CODE: … … 198 198 199 199 void 200 popless_ztext(text) 200 popless_ztext(text) 201 201 const char *text 202 202 CODE: … … 210 210 211 211 void 212 error(text) 212 error(text) 213 213 const char *text 214 214 CODE: … … 273 273 CODE: 274 274 rv = owl_text_wordwrap(in, cols); 275 RETVAL = rv; 275 RETVAL = rv; 276 276 OUTPUT: 277 277 RETVAL -
popexec.c
re146cd7 r7869e48 94 94 if (!pe) return FALSE; 95 95 96 /* If pe->winactive is 0 then the vwin has closed. 96 /* If pe->winactive is 0 then the vwin has closed. 97 97 * If pe->pid is 0 then the child has already been reaped. 98 98 * if d->fd is -1 then the fd has been closed out. … … 119 119 owl_function_debugmsg("waitpid got child status: <%d>\n", status); 120 120 pe->pid = 0; 121 if (pe->winactive) { 121 if (pe->winactive) { 122 122 owl_viewwin_append_text(pe->vwin, "\n"); 123 123 } -
regex.c
rf271129 r7869e48 13 13 char *errbuf; 14 14 const char *ptr; 15 15 16 16 re->string=g_strdup(string); 17 17 … … 43 43 char *quoted; 44 44 int ret; 45 45 46 46 quoted = owl_text_quote(string, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 47 47 ret = owl_regex_create(re, quoted); … … 59 59 return(0); 60 60 } 61 61 62 62 ret=regexec(&(re->re), string, 1, &match, 0); 63 63 out=ret; -
sepbar.c
r6eb3ed9 r7869e48 114 114 getyx(sepwin, y, x); 115 115 wmove(sepwin, y, owl_global_get_cols(&g)-1); 116 116 117 117 wattroff(sepwin, A_BOLD); 118 118 wattroff(sepwin, A_REVERSE); -
stubgen.pl
rca54fd6 r7869e48 29 29 print "int owl_global_get_$altvarname(const owl_global *g) {\n"; 30 30 print " return owl_variable_get_int(owl_variable_get_var(&g->vars, \"$varname\"));\n}\n"; 31 } 31 } 32 32 } 33 33 } -
style.c
r14be3a5 r7869e48 48 48 49 49 SV *sv = NULL; 50 50 51 51 /* Call the perl object */ 52 52 OWL_PERL_CALL_METHOD(s->perlobj, -
t/completion.t
re59d775 r7869e48 21 21 my $before_point = shift; 22 22 my $after_point = shift; 23 23 24 24 my $ctx = BarnOwl::Completion::Context->new($before_point, 25 25 $after_point); … … 57 57 my $after_point = shift; 58 58 my $shift = shift; 59 59 60 60 my $ctx = BarnOwl::Completion::Context->new($before_point, 61 61 $after_point); … … 207 207 my $words = shift; 208 208 my $complete = shift || \&complete_zwrite; 209 209 210 210 my $ctx = BarnOwl::Completion::Context->new($before, $after); 211 211 … … 346 346 my $files = shift; 347 347 348 my $expect = [ sort {$a->[1] cmp $b->[1]} 348 my $expect = [ sort {$a->[1] cmp $b->[1]} 349 349 ((map {["$_/", defined($pfx)?"$pfx/$_/":"$_/", 0]} @$dirs), 350 350 (map {["$_", defined($pfx)?"$pfx/$_" :$_ , 1]} @$files)) -
tester.c
r97cdbaf5 r7869e48 151 151 owl_text_substitute("~/meep", "~", "/u/foo")); 152 152 153 FAIL_UNLESS("skiptokens 1", 153 FAIL_UNLESS("skiptokens 1", 154 154 !strcmp("bar quux", skiptokens("foo bar quux", 1))); 155 FAIL_UNLESS("skiptokens 2", 155 FAIL_UNLESS("skiptokens 2", 156 156 !strcmp("meep", skiptokens("foo 'bar quux' meep", 2))); 157 157 … … 329 329 l = owl_dict_get_keys(&d); 330 330 FAIL_UNLESS("get_keys result size", 3 == l->len); 331 331 332 332 /* these assume the returned keys are sorted */ 333 333 FAIL_UNLESS("get_keys result val", 0 == strcmp("a", l->pdata[0])); -
text.c
rf271129 r7869e48 58 58 ptr1=in; 59 59 end=in+strlen(in); 60 60 61 61 while(ptr1<end) { 62 62 /* look for an open bracket */ … … 76 76 /* find the close bracket */ 77 77 ptr3=strchr(ptr2, '>'); 78 78 79 79 /* if there is no close, copy as you are and exit */ 80 80 if (!ptr3) { -
util.c
r7b89e8c r7869e48 255 255 owl_string_vappendf_quoted(buf, tmpl, ap); 256 256 va_end(ap); 257 return g_string_free(buf, false); 257 return g_string_free(buf, false); 258 258 } 259 259 … … 306 306 { 307 307 /* 32 chosen for first attempt because timestr will end up being 308 * something like "Www Mmm dd hh:mm:ss AM yyyy UTC\0" */ 308 * something like "Www Mmm dd hh:mm:ss AM yyyy UTC\0" */ 309 309 size_t timestr_size = 16; 310 310 char *timestr = NULL; … … 385 385 CALLER_OWN char *owl_util_stripnewlines(const char *in) 386 386 { 387 387 388 388 char *tmp, *ptr1, *ptr2, *out; 389 389 … … 643 643 int owl_util_can_break_after(gunichar c) 644 644 { 645 645 646 646 if (c == ' ') return 1; 647 647 if (c >= 0x3000 && c <= 0x312f) { … … 803 803 /* 804 804 * There are three ways the signal could come to an end: 805 * 805 * 806 806 * 1. The user explicitly disconnects it with the returned signal_id. 807 807 * - In that case, the disconnection unref's the closure, causing it -
variable.c
rd126a19 r7869e48 93 93 94 94 OWLVAR_BOOL( "logging" /* %OwlVarStub */, 0, 95 "turn personal logging on or off", 95 "turn personal logging on or off", 96 96 "If this is set to on, personal messages are\n" 97 97 "logged in the directory specified\n" … … 103 103 "If this is set to on, class messages are\n" 104 104 "logged in the directory specified\n" 105 "by the 'classlogpath' variable.\n" 105 "by the 'classlogpath' variable.\n" 106 106 "The filename in that directory is derived from\n" 107 107 "the name of the class to which the message was sent.\n" ), … … 172 172 173 173 OWLVAR_PATH( "logpath" /* %OwlVarStub */, "~/zlog/people", 174 "path for logging personal zephyrs", 174 "path for logging personal zephyrs", 175 175 "Specifies a directory which must exist.\n" 176 176 "Files will be created in the directory for each sender.\n"), … … 185 185 "This file will be logged to if 'debug' is set to 'on'.\n" 186 186 "BarnOwl will append a dot and the current process's pid to the filename."), 187 187 188 188 OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsigproc */, NULL, 189 189 "name of a program to run that will generate zsigs", … … 230 230 "turn zaway on or off", "" ), 231 231 232 OWLVAR_STRING( "zaway_msg" /* %OwlVarStub */, 232 OWLVAR_STRING( "zaway_msg" /* %OwlVarStub */, 233 233 OWL_DEFAULT_ZAWAYMSG, 234 234 "zaway msg for responding to zephyrs when away", "" ), 235 235 236 OWLVAR_STRING( "zaway_msg_default" /* %OwlVarStub */, 236 OWLVAR_STRING( "zaway_msg_default" /* %OwlVarStub */, 237 237 OWL_DEFAULT_ZAWAYMSG, 238 238 "default zaway message", "" ), … … 243 243 NULL, owl_variable_aaway_set, NULL), 244 244 245 OWLVAR_STRING( "aaway_msg" /* %OwlVarStub */, 245 OWLVAR_STRING( "aaway_msg" /* %OwlVarStub */, 246 246 OWL_DEFAULT_AAWAYMSG, 247 247 "AIM away msg for responding when away", "" ), 248 248 249 OWLVAR_STRING( "aaway_msg_default" /* %OwlVarStub */, 249 OWLVAR_STRING( "aaway_msg_default" /* %OwlVarStub */, 250 250 OWL_DEFAULT_AAWAYMSG, 251 251 "default AIM away message", "" ), 252 252 253 253 OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all", 254 "home view to switch to after 'X' and 'V'", 254 "home view to switch to after 'X' and 'V'", 255 255 "SEE ALSO: view, filter\n" ), 256 256 … … 300 300 "notifications of buddies as soon as you login, set it to 0 instead."), 301 301 302 303 OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */, 302 303 OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */, 304 304 OWL_TYPWIN_SIZE, 305 "number of lines in the typing window", 305 "number of lines in the typing window", 306 306 "This specifies the height of the window at the\n" 307 307 "bottom of the screen where commands are entered\n" … … 529 529 } 530 530 531 /* note that changing the value of this will clobber 531 /* note that changing the value of this will clobber 532 532 * any user setting of this */ 533 533 int owl_variable_disable_ctrl_d_set(owl_variable *v, const void *newval) … … 541 541 owl_function_command_norv("bindkey editmulti C-d command edit:done"); 542 542 } 543 } 544 return owl_variable_int_set_default(v, newval); 543 } 544 return owl_variable_int_set_default(v, newval); 545 545 } 546 546 … … 593 593 break; 594 594 case OWL_VARIABLE_STRING: 595 if (!cur->validate_fn) 595 if (!cur->validate_fn) 596 596 cur->validate_fn = owl_variable_string_validate_default; 597 if (!cur->set_fn) 597 if (!cur->set_fn) 598 598 cur->set_fn = owl_variable_string_set_default; 599 if (!cur->set_fromstring_fn) 599 if (!cur->set_fromstring_fn) 600 600 cur->set_fromstring_fn = owl_variable_string_set_fromstring_default; 601 if (!cur->get_fn) 601 if (!cur->get_fn) 602 602 cur->get_fn = owl_variable_get_default; 603 if (!cur->get_tostring_fn) 604 cur->get_tostring_fn = owl_variable_string_get_tostring_default; 603 if (!cur->get_tostring_fn) 604 cur->get_tostring_fn = owl_variable_string_get_tostring_default; 605 605 if (!cur->delete_fn) 606 606 cur->delete_fn = owl_variable_delete_default; … … 609 609 break; 610 610 case OWL_VARIABLE_BOOL: 611 if (!cur->validate_fn) 611 if (!cur->validate_fn) 612 612 cur->validate_fn = owl_variable_bool_validate_default; 613 if (!cur->set_fn) 613 if (!cur->set_fn) 614 614 cur->set_fn = owl_variable_bool_set_default; 615 if (!cur->set_fromstring_fn) 615 if (!cur->set_fromstring_fn) 616 616 cur->set_fromstring_fn = owl_variable_bool_set_fromstring_default; 617 if (!cur->get_fn) 617 if (!cur->get_fn) 618 618 cur->get_fn = owl_variable_get_default; 619 if (!cur->get_tostring_fn) 620 cur->get_tostring_fn = owl_variable_bool_get_tostring_default; 619 if (!cur->get_tostring_fn) 620 cur->get_tostring_fn = owl_variable_bool_get_tostring_default; 621 621 if (!cur->delete_fn) 622 622 cur->delete_fn = owl_variable_delete_default; … … 625 625 break; 626 626 case OWL_VARIABLE_INT: 627 if (!cur->validate_fn) 627 if (!cur->validate_fn) 628 628 cur->validate_fn = owl_variable_int_validate_default; 629 if (!cur->set_fn) 629 if (!cur->set_fn) 630 630 cur->set_fn = owl_variable_int_set_default; 631 if (!cur->set_fromstring_fn) 631 if (!cur->set_fromstring_fn) 632 632 cur->set_fromstring_fn = owl_variable_int_set_fromstring_default; 633 if (!cur->get_fn) 633 if (!cur->get_fn) 634 634 cur->get_fn = owl_variable_get_default; 635 if (!cur->get_tostring_fn) 636 cur->get_tostring_fn = owl_variable_int_get_tostring_default; 635 if (!cur->get_tostring_fn) 636 cur->get_tostring_fn = owl_variable_int_get_tostring_default; 637 637 if (!cur->delete_fn) 638 638 cur->delete_fn = owl_variable_delete_default; … … 793 793 if (!v->set_fromstring_fn) { 794 794 if (msg) owl_function_error("Variable %s is read-only", owl_variable_get_name(v)); 795 return -1; 795 return -1; 796 796 } 797 797 if (0 != v->set_fromstring_fn(v, value)) { … … 807 807 owl_function_makemsg("%s = <null>", owl_variable_get_name(v)); 808 808 g_free(tostring); 809 } 809 } 810 810 return 0; 811 811 } 812 812 813 813 int owl_variable_set_string(owl_variable *v, const char *newval) 814 814 { … … 816 816 return v->set_fn(v, newval); 817 817 } 818 818 819 819 int owl_variable_set_int(owl_variable *v, int newval) 820 820 { … … 822 822 return v->set_fn(v, &newval); 823 823 } 824 824 825 825 int owl_variable_set_bool_on(owl_variable *v) 826 826 { … … 1035 1035 } else { 1036 1036 return g_strdup_printf("%d", *(const int*)val); 1037 } 1037 } 1038 1038 } 1039 1039 1040 1040 /* default functions for enums (a variant of integers) */ 1041 1041 1042 int owl_variable_enum_validate(const owl_variable *v, const void *newval) { 1042 int owl_variable_enum_validate(const owl_variable *v, const void *newval) { 1043 1043 char **enums; 1044 1044 int nenums, val; -
view.c
r219f52c r7869e48 88 88 } 89 89 90 /* Returns the position in the view with a message closest 90 /* Returns the position in the view with a message closest 91 91 * to the passed msgid. */ 92 92 int owl_view_get_nearest_to_msgid(const owl_view *v, int targetid) -
wcwidth.c
r49a8434 r7869e48 188 188 /* if we arrive here, ucs is not a combining or C0/C1 control character */ 189 189 190 return 1 + 190 return 1 + 191 191 (ucs >= 0x1100 && 192 192 (ucs <= 0x115f || /* Hangul Jamo init. consonants */ -
zephyr.c
r9b3167b r7869e48 320 320 subs = g_renew(ZSubscription_t, subs, subSize); 321 321 } 322 322 323 323 /* add it to the list of subs */ 324 324 if ((tmp = strtok(start, ",\n\r")) == NULL) … … 649 649 else if (!strcasecmp(n->z_default_format, "New transaction [$1] entered in $2\nFrom: $3 ($5)\nSubject: $4") || 650 650 !strcasecmp(n->z_default_format, "New transaction [$1] entered in $2\nFrom: $3\nSubject: $4")) { 651 651 652 652 msg = g_strdup_printf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", 653 653 fields[1], fields[2], fields[3], fields[5], fields[4]); … … 707 707 ZNotice_t notice; 708 708 char *zsender = NULL; 709 709 710 710 memset(¬ice, 0, sizeof(notice)); 711 711 … … 713 713 714 714 if (!zsig) zsig=""; 715 715 716 716 notice.z_kind=ACKED; 717 717 notice.z_port=0; … … 738 738 /* ret=ZSendNotice(¬ice, ZAUTH); */ 739 739 ret=ZSrvSendNotice(¬ice, ZAUTH, send_zephyr_helper); 740 740 741 741 /* free then check the return */ 742 742 g_free(notice.z_message); … … 771 771 { 772 772 char *tmp; 773 773 774 774 /* if it's an HMACK ignore it */ 775 775 if (retnotice->z_kind == HMACK) return; … … 880 880 } 881 881 #endif 882 882 883 883 void owl_zephyr_zaway(const owl_message *m) 884 884 { … … 886 886 char *tmpbuff, *myuser, *to; 887 887 owl_zwrite *z; 888 888 889 889 /* bail if it doesn't look like a message we should reply to. Some 890 890 * of this defined by the way zaway(1) works … … 1032 1032 char *line, *subsfile; 1033 1033 int linesdeleted; 1034 1034 1035 1035 line=owl_zephyr_makesubline(class, inst, recip); 1036 1036 line[strlen(line)-1]='\0'; 1037 1037 1038 1038 subsfile = owl_zephyr_dotfile(".zephyr.subs", filename); 1039 1039 1040 1040 linesdeleted = owl_util_file_deleteline(subsfile, line, 1); 1041 1041 if (linesdeleted > 0) { … … 1082 1082 char *filename; 1083 1083 FILE *file; 1084 1084 1085 1085 filename = owl_zephyr_dotfile(".anyone", NULL); 1086 1086 file = fopen(filename, "a"); … … 1118 1118 } else { 1119 1119 return ("UNKNOWN"); 1120 } 1120 } 1121 1121 } 1122 1122 #else … … 1254 1254 return 0; 1255 1255 } 1256 1256 1257 1257 /* Strip a local realm fron the zephyr user name. 1258 1258 * The caller must free the return -
zwrite.c
r919cbf2 r7869e48 42 42 int badargs = 0; 43 43 char *msg = NULL; 44 44 45 45 /* start with null entries */ 46 46 z->cmd=NULL; … … 177 177 178 178 if (z->noping) return; 179 179 180 180 if (strcasecmp(z->class, "message")) { 181 181 return;
Note: See TracChangeset
for help on using the changeset viewer.