Commit graph

309 commits

Author SHA1 Message Date
Aaron Weiss
2dc47006ce Fixed compilation for rust master. 2015-01-04 01:18:26 -05:00
Aaron Weiss
48788fee5f Added get_source_nickname() to Message. 2015-01-02 15:20:26 -05:00
Aaron Weiss
dace078b1c Updated for mutex changes. 2015-01-01 20:40:58 -05:00
Aaron Weiss
dbd0e4b65b More clean-up around ToMessage, and removed debug messages from CTCP
implementation.
2014-12-31 20:26:44 -05:00
Aaron Weiss
a6146bc135 Clean up after #11, including unit tests. 2014-12-31 20:05:10 -05:00
Simon Bernier St-Pierre
ed84a41e57 Implement ToMessage for Command and Message and use ToMessage in Connection. 2014-12-31 18:39:00 -05:00
Aaron Weiss
5a59945ffc Updated travis build file and added doc notes about CTCP requiring CTCP
feature.
2014-12-23 13:32:35 -05:00
Aaron Weiss
b9357ee671 Fixed CTCP tests. 2014-12-23 13:31:10 -05:00
Aaron Weiss
4fdf801fb3 Updated away from deprecated code in library. 2014-12-23 12:53:30 -05:00
Aaron Weiss
b44ff8b196 Fixed build. 2014-12-23 12:15:41 -05:00
Aaron Weiss
06cd54f39e Added CTCP response tests. 2014-12-22 17:24:56 -05:00
Aaron Weiss
fdfe03d1b2 Added colons to fix tests. 2014-12-22 17:15:35 -05:00
Aaron Weiss
ddda80d00e Added tests for sending CTCP requests. 2014-12-22 17:11:54 -05:00
Aaron Weiss
2cd160a72f Added commands to send CTCP requests as per #7. 2014-12-22 16:43:37 -05:00
Aaron Weiss
1b51c69a23 Added CTCP feature with automatic responses to a set of CTCP commands
as per #7.
2014-12-22 16:35:56 -05:00
Aaron Weiss
86a5faaa1d Reconnection no longer requires mutability, Wrapper now has
send_quit(...).
2014-12-20 20:12:29 -05:00
Aaron Weiss
49c96e9ece Removed unnecessary constructors that set timeouts on construction. 2014-12-20 17:57:55 -05:00
Aaron Weiss
5d45515578 Added set_timeout to Connection. 2014-12-20 17:53:27 -05:00
Aaron Weiss
3173accaa8 Added set_keepalive to Connection and the ability to reconnect to a
server.
2014-12-20 17:36:48 -05:00
Aaron Weiss
70031aa8d8 ServerIterator now iterates over IoResults. 2014-12-20 16:50:54 -05:00
Aaron Weiss
d76dd610de Fixed compilation, and updated README. 2014-12-19 10:48:59 -05:00
Aaron Weiss
467559b478 Changed behavior when using encoding to not fail on improperly encoded
text.
2014-12-17 01:31:24 -05:00
Aaron Weiss
0ec3f1f282 Updated to using #[deriving(Copy)]. 2014-12-14 19:21:14 -05:00
Aaron Weiss
e070639ffe Updated for explicit Copy implementations. 2014-12-13 03:24:41 -05:00
Aaron Weiss
7464dc2f0f No longer tries to identify without a password, and added a test for
nickserv identification.
2014-12-09 17:25:22 -05:00
Aaron Weiss
3146d6a87f Fixed nickserv identification. 2014-12-09 17:15:53 -05:00
Aaron Weiss
f9cb41fff3 Moved nickserv registration to just before channel joining. 2014-12-09 17:11:02 -05:00
Aaron Weiss
398cda4af6 Implemented password support for nickservs as per #9. 2014-12-09 17:01:47 -05:00
Aaron Weiss
31281d2820 Added support for connecting to a password-protected server. 2014-12-09 16:17:05 -05:00
Aaron Weiss
bdb04d693b Updated examples for if let addition, and a failure test with a message. 2014-12-08 15:00:10 -05:00
Aaron Weiss
5ec5ec29eb Updated for language changes. 2014-12-08 03:34:13 -05:00
Aaron Weiss
a222989cb4 Implemented #4 as a list of alternate nicknames. 2014-12-06 18:49:07 -05:00
Aaron Weiss
6b294036f2 Simplified config tests and added rustdoc test for README.md. 2014-12-05 10:27:58 -05:00
Aaron Weiss
3387f5d587 Updated configuration to be a lot more fluid, and easier to work with. 2014-12-04 21:04:22 -05:00
Aaron Weiss
3b5bf55d0c Updated for language changes. 2014-12-04 12:57:07 -05:00
Aaron Weiss
4cd500d892 Updated encoding library for language changes. 2014-12-04 12:54:25 -05:00
Aaron Weiss
afd14cb20a Completed #3 by taking advantage of new support for capabilities
protocol.
2014-12-02 16:35:34 -05:00
Aaron Weiss
8b72503e7d Added support for CAP and IRCv3 capabilities extension. 2014-12-02 14:41:09 -05:00
Aaron Weiss
116ac10e48 Improved access level tracking as per #3, but more improvements are
necessary still.
2014-12-02 14:10:33 -05:00
Aaron Weiss
b05994e65c Fixed typo in SSL implementation that went unnoticed. 2014-12-01 18:34:39 -05:00
Aaron Weiss
0588de82e0 Fixed encode tests. 2014-12-01 18:20:29 -05:00
Aaron Weiss
40d8f09528 Separated reading and writing once more, thanks to changes in
rust-openssl.
2014-12-01 18:17:03 -05:00
Aaron Weiss
da30e4bccd Updated handle_message(...) to use Response everywhere as needed. 2014-12-01 16:12:19 -05:00
Aaron Weiss
4a48093905 handle_command(...) implementation now uses responses, unit tests for
responses are now lincuded.
2014-12-01 14:32:45 -05:00
Aaron Weiss
7a4e1675b2 Added server response codes. 2014-12-01 14:19:14 -05:00
Aaron Weiss
faf54e1b52 Added warning for missing docs, and added missing docs. 2014-12-01 13:53:22 -05:00
Aaron Weiss
b4cda39134 Made encoding into a feature as encode. 2014-11-30 03:30:10 -05:00
Aaron Weiss
7b22fada51 Fixed SSL feature compilation. 2014-11-30 01:32:53 -05:00
Aaron Weiss
098f9dbbff Added support for non-unicode encodings. 2014-11-30 01:29:38 -05:00
Aaron Weiss
73fe293659 Added method to get options from Config options map. 2014-11-29 05:49:20 -05:00
Aaron Weiss
41c824ce47 Unused timeout variable is now unbound in connect_ssl_internal when
compiled without SSL support.
2014-11-29 04:57:38 -05:00
Aaron Weiss
575d37525a Fixed SSL timeout implementation. 2014-11-29 04:57:01 -05:00
Aaron Weiss
ebab05a6b8 Added the ability to set timeouts for live connections. 2014-11-29 04:52:50 -05:00
Aaron Weiss
74528c9d4c Added note in documentation about Wrappers not being thread-safe
currently.
2014-11-29 03:02:11 -05:00
Aaron Weiss
b199480025 Updated reference in Wrapper for RFC 248. 2014-11-29 02:58:05 -05:00
Aaron Weiss
d7517c9666 Updated license in lib.rs 2014-11-29 00:33:22 -05:00
Aaron Weiss
308a506d8f Stability annotations for user. 2014-11-29 00:32:35 -05:00
Aaron Weiss
7ee83a9b2d Added extra unit tests to User. 2014-11-28 17:12:02 -05:00
Aaron Weiss
ca3d52201d The nickname of Users is now accessible. 2014-11-28 16:47:29 -05:00
Aaron Weiss
09fa19a3d0 Collapsed feature attribute into one line. 2014-11-22 04:15:38 -05:00
Aaron Weiss
2ab1f65e1f Added send_notice(...) to Wrappers. 2014-11-19 22:02:52 -05:00
Aaron Weiss
b1a29523cd Reformatted code, and fixed compilation of tests for enum changes. 2014-11-18 19:15:29 -05:00
Aaron Weiss
18646ae291 Updated library for changes to enumerations. 2014-11-18 19:00:18 -05:00
Aaron Weiss
df0f05f4be Removed more unnecessary lifetime annotations. 2014-11-13 21:20:24 -05:00
Aaron Weiss
7c6843052f Removed unnecessary explicit lifetimes from IrcServer. 2014-11-13 21:18:23 -05:00
Aaron Weiss
dd6b6eebd3 Completed channel user list tracking. 2014-11-12 00:51:40 -05:00
Aaron Weiss
4e40fd8218 Started working on user tracking, but it's currently very broken. 2014-11-11 01:24:01 -05:00
Aaron Weiss
3f0c3ba175 Made documentation improvements. 2014-11-08 23:21:55 -05:00
Aaron Weiss
95234df31f Refactored library to be Stream-based, added a wrapper to create streams out of Buffers and Writers, and completed SSL support. 2014-11-08 23:07:57 -05:00
Aaron Weiss
a903dd9571 Added SSL support, but it's broken because of the duplicate SslStream creations. 2014-11-08 17:35:19 -05:00
Aaron Weiss
09f426cad5 Added unit tests for wrapper functionality. 2014-11-07 12:36:51 -05:00
Aaron Weiss
7d53e298ca Added license attribute to lib.rs. 2014-11-06 21:38:37 -05:00
Aaron Weiss
442115330e Refactored Command::from_message(...) to be more easily understood. 2014-11-06 20:54:51 -05:00
Aaron Weiss
2b7129c74a Rustdoc comments now end consistently in periods. 2014-11-06 15:23:02 -05:00
Aaron Weiss
8d37f71c3a Updated connect(...) with API changes for TcpStream. 2014-11-06 15:12:57 -05:00
Aaron Weiss
f229f4ebaf IrcServer::from_connection(...) no longer returns an IoResult. 2014-11-06 15:07:02 -05:00
Aaron Weiss
544ea11ab7 Added more unit tests for server. 2014-11-06 15:05:00 -05:00
Aaron Weiss
14f8f09374 Added iterator unit test and fixed a bug where parsing messages without suffixes caused them to incorrectly include a new line in their last argument. 2014-11-06 14:29:14 -05:00
Aaron Weiss
165e7969db Added some basic tests to newly redesigned library. Test coverage is still less than satisfactory. 2014-11-05 01:45:17 -05:00
Aaron Weiss
503f14ea5a Added more functionality to Wrapper. 2014-11-04 14:26:24 -05:00
Aaron Weiss
1f888281b0 Added exports to data module. 2014-11-03 16:41:30 -05:00
Aaron Weiss
6db71ded01 Provided access to internal connections where needed, and added multi-line support to send_privmsg(...). 2014-11-03 14:12:23 -05:00
Aaron Weiss
25532d145e Removed lifetime requirements from send_samode. 2014-11-03 13:51:21 -05:00
Aaron Weiss
039049ab32 Added documentation for Wrapper and utility functions. 2014-11-03 04:19:12 -05:00
Aaron Weiss
b3e0e2ea08 Refactored utilities into a Server Wrapper that provides added functionality. 2014-11-03 04:15:03 -05:00
Aaron Weiss
f0e3db4ce6 Added additional utilities. 2014-11-03 03:47:08 -05:00
Aaron Weiss
c7a0d4b83d Implemented join on connection. 2014-11-03 03:11:14 -05:00
Aaron Weiss
cd52c5b6a4 Messages now properly end with new-lines. 2014-11-03 03:02:35 -05:00
Aaron Weiss
16f29f179a Added basic message handling, and fixed a bug in message parsing. 2014-11-03 02:54:40 -05:00
Aaron Weiss
4479c59e79 Fixed bug with Message parsing causing suffixes to include colon prefix. 2014-11-03 02:42:06 -05:00
Aaron Weiss
c8dc582fd1 Fixed bug with message parsing, and updated example. 2014-11-03 02:30:58 -05:00
Aaron Weiss
c20038951e Added simple example, and changed how IrcServer creation works. 2014-11-03 02:11:51 -05:00
Aaron Weiss
42b4dcbf03 Added identify(...) utility, and clarified intent in some places using match. 2014-11-03 02:02:29 -05:00
Aaron Weiss
4d7c2065e9 Added FIXME to from_message(...) with details on how to rewrite it. 2014-11-03 01:47:36 -05:00
Aaron Weiss
25d4585fbc Commands now uses slices. 2014-11-03 01:45:00 -05:00
Aaron Weiss
fbcc3021a8 Added server utils module to hold shortcuts and the like. 2014-11-03 00:55:56 -05:00
Aaron Weiss
5bbde7e96c Added documentation everywhere. 2014-11-03 00:52:15 -05:00
Aaron Weiss
63f4ca5097 Implemented complete RFC 2812 as Commands. 2014-11-03 00:08:40 -05:00
Aaron Weiss
2e2d411907 Added Server trait and implemented basic Server functionality for IrcServer. 2014-11-02 18:39:00 -05:00
Aaron Weiss
4df7be1662 Added Config implementation. 2014-11-02 18:16:49 -05:00
Aaron Weiss
d97035cca9 Implemented ServerIterator and message parsing. 2014-11-02 18:08:56 -05:00
Aaron Weiss
6da40f2ad3 Implemented thread-safe Connection. 2014-11-02 17:25:45 -05:00
Aaron Weiss
b2006d044d Laid out basic structure of rewritten library. 2014-11-02 16:25:57 -05:00
Aaron Weiss
91aa5bcc6f Refactored for iterators. 2014-11-02 16:16:58 -05:00
Aaron Weiss
0ad276fdae Added load_utf8 to Config and load takes a Path. 2014-11-02 13:47:22 -05:00
Aaron Weiss
f8a6987fcf Config::load(...) now takes the path to the configuration file. 2014-11-02 13:32:02 -05:00
Aaron Weiss
aa6ff176f2 Added a bot constructor that takes an already-made configuration file. 2014-11-02 13:01:02 -05:00
Aaron Weiss
f174d17e4b handle_command(...) now calls the user's hook for all messages. 2014-10-29 17:02:06 -04:00
Aaron Weiss
3ee6ec76f1 Made colon before last argument optional depending on message type. 2014-10-29 03:43:15 -04:00
Aaron Weiss
445cfb1405 Added SAMODE with associated unit test. 2014-10-29 01:36:34 -04:00
Aaron Weiss
56ca5379e1 Added send_kill(...) and associated unit test. 2014-10-29 00:52:52 -04:00
Aaron Weiss
aad1d52b59 Added unit test for send_sanick(...). 2014-10-29 00:48:56 -04:00
Aaron Weiss
8924e4e578 Added send_sanick(...). 2014-10-29 00:47:39 -04:00
Aaron Weiss
803e1e8ff4 Added send_oper(...) to allow bots to oper up. 2014-10-29 00:17:49 -04:00
Aaron Weiss
7f67bd2905 Added options hashmap to config for custom bot configuration. 2014-10-29 00:13:18 -04:00
Aaron Weiss
f185106e08 Fixed a bug causing failure when user strings are empty. 2014-10-27 12:53:20 -04:00
Aaron Weiss
e48aca279d Simplified code with new syntax. 2014-10-27 00:44:17 -04:00
Aaron Weiss
35af08ef7c Removed unnecessary swearing. 2014-10-27 00:34:56 -04:00
Aaron Weiss
c669d44f15 User tracking keeps proper track of user rank now. 2014-10-27 00:33:17 -04:00
Aaron Weiss
729ff3874c Updated tests to make them more debuggable. 2014-10-26 23:47:00 -04:00
Aaron Weiss
f0bd2b99f1 Added kick command. 2014-10-26 23:29:31 -04:00
Aaron Weiss
d719cc006b send_privmsg(...) now supports multiline messages. 2014-10-20 03:47:46 -04:00
Aaron Weiss
f43634f58e Removed useless lifetime parameter from Bot trait. 2014-10-20 02:34:58 -04:00
Aaron Weiss
67a087cab3 Simplified connection tests a bit. 2014-10-10 13:20:37 -04:00
Aaron Weiss
6d5144c109 Simplified bot unit tests where possible. 2014-10-09 14:37:59 -04:00
Aaron Weiss
6261449e97 Added tests for the user tracking system. 2014-10-09 14:32:06 -04:00
Aaron Weiss
d6921eae74 Added tests of some of the handle_command(...) functionality. 2014-10-09 03:26:16 -04:00
Aaron Weiss
fb8081cf77 output(...) now returns an Err(...) if it fails to parse a line. 2014-10-08 22:29:41 -04:00
Aaron Weiss
21136c4ec2 Added unit test for identify(). 2014-10-08 22:20:50 -04:00
Aaron Weiss
6fcf3e2fc6 Implemented unit tests for the remainder of the send_* methods. 2014-10-08 22:17:39 -04:00
Aaron Weiss
a7d3a565b8 Added some unit tests for IrcBot, along with required changes to Connection. 2014-10-08 22:09:35 -04:00
Aaron Weiss
31e633763b Added unit tests for Connections and caught an inconsistency from the spec. 2014-10-08 21:33:20 -04:00
Aaron Weiss
f6915e2e53 Connections now support non-cloneable Readers (read: all of them). Thanks, @retep998. 2014-10-08 20:57:23 -04:00
Aaron Weiss
7efe3f3fdf Added some basic data tests. 2014-10-08 18:08:29 -04:00
Aaron Weiss
afa1fccff7 Modularized tests. 2014-10-08 16:11:20 -04:00
Aaron Weiss
57df922054 Moved IrcBot implementation to bot.rs. 2014-10-08 16:08:15 -04:00
Aaron Weiss
bb58dac93c Added from_connection(...) to make an IrcBot from any arbitrary connection. 2014-10-08 14:08:27 -04:00
Aaron Weiss
af1f8ecf14 config(...) returns a reference instead of a copy of the value. 2014-10-08 13:50:54 -04:00
Aaron Weiss
95a3a8d6b6 Specified the implementation of IrcBot to go with the new function. 2014-10-08 13:44:36 -04:00
Aaron Weiss
bf31646bdd Added method to get config from bots. 2014-10-08 13:40:19 -04:00
Aaron Weiss
54e781e6e7 Refactored Bot into IrcBot based on Bot trait. 2014-10-08 13:32:37 -04:00
Aaron Weiss
b0226099d7 Added newtypes for the specific kinds of Reader and Writer used in the library 2014-10-08 13:10:55 -04:00
Aaron Weiss
567074a599 Made changes to allow library to operate on any type of stream. 2014-10-08 12:57:36 -04:00
Aaron Weiss
dc8003c8e3 Converted Connection into an enumeration for extensibility. 2014-10-07 14:30:38 -04:00
Aaron Weiss
394ca6bb8f Removed usage of deprecated append(...) method. 2014-10-06 16:37:29 -04:00
Aaron Weiss
352a692c9b Added concept of bot ownership, improved failure propagation. 2014-10-06 16:33:37 -04:00
Aaron Weiss
e0c2c1174b Added method to set channel modes. 2014-09-27 15:08:38 -04:00
Aaron Weiss
0ad2411c14 Added method to set topic of a channel. 2014-09-27 14:51:16 -04:00
Aaron Weiss
b473a29dc0 Added method to invite users to a channel. 2014-09-27 14:23:03 -04:00
Aaron Weiss
c9060dc89a Added tests for process(...) and parse_args(...). 2014-09-25 15:58:50 -04:00
Aaron Weiss
6f7673e53e Bots now track users in each channel. 2014-09-24 19:20:59 -04:00
Aaron Weiss
9dea4586eb Added send_privmsg(...) to Bot implementation. 2014-09-24 17:13:42 -04:00
Aaron Weiss
8672c257cb Exposed method to add user functionality to bots at construction. 2014-09-24 16:53:42 -04:00
Aaron Weiss
642622752f Refactored for modularization, incorporated config usage. 2014-09-23 20:11:13 -04:00
Aaron Weiss
ddd06733d6 Bot now joins if MOTD is missing, not just at the end of the MOTD. 2014-09-11 01:31:33 -04:00
Aaron Weiss
1833a0199c Simplified some matches to let statements. 2014-09-11 01:14:44 -04:00
Aaron Weiss
9b6919d0bc Refactored basic library significantly, but sending isn't working properly. 2014-09-11 01:09:28 -04:00
Aaron Weiss
49055e39d3 Implemented an extremely basic core library. 2014-09-10 19:47:12 -04:00
Aaron Weiss
bc4041981e Initiated with cargo new irc. 2014-09-10 16:23:09 -04:00