Commit graph

549 commits

Author SHA1 Message Date
Chris West (Faux)
99fe1256e1 parse traditional USER form
Fixes: #160
2018-10-21 12:25:08 +01:00
Aaron Weiss
47d9c4c78b
Merge pull request #149 from brigand/feat/develop/message-prefix
Introduces Prefix enum
2018-10-15 11:16:30 -04:00
Jason Liquorish
cdf874c23e Re-format ci bot message 2018-10-12 23:11:02 +01:00
Jason Liquorish
f1d7d71471 Add test bot for CI 2018-10-09 19:06:16 +01:00
Christoph Herzog
e112efe7dd Add 'Send' bound for PackedClient client future.
The Future is Send anyway, but this bound on the Box is neccessary
to use the future across threads because the compiler can't figure
out the Send bound otherwise.
2018-10-04 18:20:41 +02:00
Christoph Herzog
e5089fa317 Use tokio::net::tcp::ConnectFuture instead of deprecated re-export. 2018-10-04 02:53:56 +02:00
Christoph Herzog
2aff64b645 Refactor IrcClientFuture and ConnectionFuture to own the config
This commit refactors IrcClientFuture and ConnectionFuture to own
the config instead of holding a reference.

This is required for reconnecting in dynamic contexts.
This is not possible with the old API, because Config is a reference,
requiring the value to live for the whole execution of the reactor.
2018-10-04 02:52:53 +02:00
Douman
23112f7582 Clean up tokio-core 2018-09-22 23:43:47 +03:00
Frankie Bagnardi
f66dcd6b0a rebased 2018-09-17 22:03:22 -07:00
Frankie Bagnardi
140c981e63 prefix cleanup and docs 2018-09-17 22:00:52 -07:00
Frankie Bagnardi
c44ec0984e Prefix with FromStr and Display 2018-09-17 21:59:02 -07:00
Aaron Weiss
f109c10475
Fixed a warning in config.rs (for some tests) and the README example. 2018-09-17 18:08:21 -04:00
Aaron Weiss
befe0ada84
Removed the old colors module (now in irc_proto). 2018-09-17 17:56:14 -04:00
Aaron Weiss
acbdb1de2f
Merge branch 'develop' into 0.14 2018-09-17 17:54:09 -04:00
Aaron Weiss
53fb890a7e
Merged develop onto 0.14 (which was tricky, and this might have introduced bugs?). 2018-09-17 17:50:53 -04:00
Jokler
0be5cb26c8 Upgrade native-tls and tokio-tls to 0.2 2018-09-17 02:11:25 +02:00
Eunchong Yu
8d07c117bb Polish the parser 2018-09-01 06:51:25 +09:00
Eunchong Yu
c311d37902 Use macro 2018-09-01 06:51:25 +09:00
Eunchong Yu
e7fe08f29d Make is_formatted simple 2018-09-01 06:51:24 +09:00
Eunchong Yu
b108c833bb Reduce allocation more
String::strip_formatting will do most of operations in place.
2018-09-01 06:51:24 +09:00
Eunchong Yu
4feafc681a Reduce memcpy case in strip_formatting
This makes the return type of FormattedStringExt::strip_formatting
more meaningful.

Drawbacks:

  In theory, it breaks backward compatbility due to the shape of
FormattedStringExt trait was changed. But I expected it's not the
problem for the most case because it's rare to implement that trait
while using this library.
2018-09-01 06:51:24 +09:00
Eunchong Yu
c7c65ef671 Fix infinite recursive calls
It reverts #137.
2018-09-01 06:51:24 +09:00
Eunchong Yu
8ffac6bef0 Replace deprecated tokio_io::codec to tokio_codec 2018-08-19 09:18:50 +09:00
Eunchong Yu
1cf7744156 Clarify to prevent unintended recursions 2018-08-19 08:54:22 +09:00
Eunchong Yu
12003c880c Remove deprecated AsciiExt 2018-08-19 08:50:38 +09:00
Aaron Weiss
abbf1eafcb
Added notes for PRIVMSG and NOTICE about responses (re: #144). 2018-08-16 12:18:05 -04:00
Aaron Weiss
c69e944033
Reverted some of the TLS changes from #141 because they broke TLS completely. 2018-06-18 21:29:45 +02:00
Ratys
bdeb7054b3 Removed PackedIrcClient, IrcClientFuture:
They are redundant now, and are dead code;

Cleaned up unused imports.
2018-06-08 22:18:40 +03:00
Ratys
5275e79971 Rewrote conn module to utilize impl Future in return position:
Changed all involved structs to take `Config`s, rather than borrow them - this is due to `'static` requirement that is bound to crop up somewhere, when spawning a future into a reactor/runtime.

Updated examples and docs to reflect the change.
2018-06-08 22:00:49 +03:00
Ratys
bfb8bf5a1b Partial rewrite to utilize impl Future in return position:
Changed return types relevant methods of `conn` module; no implementation changes;

Rewrote relevant methods of `reactor` and `client`.
2018-06-08 17:25:57 +03:00
Ratys
b5a575966f Partially moved from tokio_core to tokio, removed handle args:
Migrated `conn` and `client` modules to `tokio` types;

Removed `handle` arguments and fields in `reactor`, `conn` and `client` modules;

Removed unused imports of `Handle`, updated doctest.
2018-06-08 17:24:26 +03:00
Ratys
efd13d5a13 Added dependency on tokio 0.1. 2018-06-08 16:41:13 +03:00
Aaron Weiss
791edb2bd7
Added a small optimization (suggested in tokio guide) to LineCodec. 2018-06-05 20:04:06 +02:00
Frederik B
acc6d7f0f0
Remove unnecessary [..]
Replaces  (&self[..]).strip_formatting() with (&self).strip_formatting() in `impl FormattedStringExt for String`
2018-05-16 11:15:43 +02:00
Aaron Weiss
7d8feafb52
Documented panic condition for client registration with a reactor. 2018-05-14 20:53:06 +02:00
Aaron Weiss
5bd349f8ff
Added more documentation to send_privmsg about line splitting. 2018-05-11 22:28:18 +02:00
Aaron Weiss
4e9b1ece19
Improved documentation of the IrcTransport. 2018-05-05 16:22:33 +02:00
Aaron Weiss
0e53b979bc
Added a bunch of additional comments and documentation to irc::client. 2018-05-05 16:01:59 +02:00
Aaron Weiss
0235c71268
Added current nickname tracking (fixes #125). [BREAKING] 2018-05-05 15:12:29 +02:00
Aaron Weiss
c97469d630
Moved irc::proto::colors into irc-proto crate. 2018-05-05 13:48:35 +02:00
Aaron Weiss
11f86aedc3
Fixed irc crate to use irc-proto crate now. 2018-05-05 13:37:36 +02:00
Aaron Weiss
991e030a4f
Started splitting out proto into its own crate. 2018-05-05 13:37:32 +02:00
Aaron Weiss
af16961037
Merge pull request #134 from freddyb/color-problems
parse 2nd color digit only if within (0..16)
2018-04-22 01:14:30 +02:00
Frederik B
5833403ffd parse 2nd color digit only if within (0..16) 2018-04-21 20:12:21 +02:00
Aaron Weiss
4fe5862632
Merge pull request #133 from freddyb/add-formattedstring
add support for formatted strings (fixes #130)
2018-04-15 22:41:59 +02:00
Frederik B
30dd756588 add tests for formatted strings (#130) 2018-04-15 22:33:56 +02:00
Frederik B
654b759c02 add support for formatted strings (fixes #130) 2018-04-14 23:15:00 +02:00
Alex S. Glomsaas
e80a0f3a89 Implement CertFP
resolves #131
2018-03-31 21:09:42 +02:00
Aaron Weiss
f2e10001c0
Improved the documentation for Config. 2018-03-31 16:22:07 +02:00
Aaron Weiss
845ca63416
Track users who are kicked out of channels (fixes #127). 2018-03-31 15:39:02 +02:00
Aaron Weiss
cef0462859
Added a regression test for sending raw messages (see #128). 2018-03-31 15:39:02 +02:00
Aaron Weiss
7680227222
Sanitize messages later to stop the problematic round-trip parsing. 2018-03-31 15:39:01 +02:00
panicbit
e514c97688 Use FnMut for registering client handlers 2018-03-26 08:53:38 +02:00
isra17
121e2cc844
Fix wrong RPL numeric formatting 2018-03-13 13:18:58 -04:00
Aaron Weiss
4921127372
Changed ping logic to eliminate a rare panic under heavy load (fixes #120). 2018-02-23 21:08:38 +01:00
Aaron Weiss
c78770f763
Added a custom error that wraps failure::Error to add error possibilities for API consumers. 2018-02-21 14:30:27 +01:00
Aaron Weiss
4509336d74
Fixed config tests after Config::get_option API change. 2018-02-21 12:23:54 +01:00
Aaron Weiss
7d744529e6
Eliminated possible panics in Config::get_option. 2018-02-21 12:17:41 +01:00
Aaron Weiss
363629f400
Changed ClientExt to be more generic. 2018-02-18 22:54:24 +01:00
Aaron Weiss
3847bcb5a6
Always skip serializing config's path. 2018-02-18 21:39:06 +01:00
Aaron Weiss
c91d14a949
Fixed a small bug when using nochanlists. 2018-02-18 21:13:01 +01:00
Aaron Weiss
cabe0919c8
Cleaned up a bit of testing code. 2018-02-12 20:58:50 +01:00
Aaron Weiss
9b99677391
Changed error message for NoUsableNick. 2018-02-12 20:30:02 +01:00
Emīls Piņķis
a8cdf1ecfc Add error type for when there are no valid nicks 2018-02-12 19:16:00 +00:00
Aaron Weiss
e847cda40a
IrcTransport::poll_complete now polls the ping timer (fixes #115). 2018-02-08 02:21:08 +01:00
Aaron Weiss
decfd0b9bc
Noted inaccuracies of the is_error function for Response. 2018-02-07 12:13:43 +01:00
Aaron Weiss
31f8c692b6
Added some more information to the response docs, and some extra common response codes. 2018-02-07 12:08:59 +01:00
Aaron Weiss
4c26dfc3cd
Reverted a7ae091 because it caused a regression (resolves #112). 2018-01-29 14:04:41 +01:00
Aaron Weiss
ea2c05f9fc
Removed irc::client::server (which should've been done before, woops). 2018-01-29 14:01:44 +01:00
Aaron Weiss
bc8f7342dd
Added missing call to IrcReactor::run in the reactor docs. 2018-01-28 14:04:21 +01:00
Aaron Weiss
59f426ac8d
Cleaned up tests and documentation after the big renaming. 2018-01-28 03:19:05 +01:00
Aaron Weiss
87b84fdeb9
Changed naming scheme from server to client (resolves #46). 2018-01-28 02:16:50 +01:00
Aaron Weiss
9c574b00c0
Moved prelude module into its own file. 2018-01-28 02:02:45 +01:00
Aaron Weiss
d6786936fa
Fixed the code that shouldn't have worked without AsciiExt. 2018-01-28 01:59:47 +01:00
Aaron Weiss
e4d441695e
Merge branch 'use-failure' into develop 2018-01-28 01:16:38 +01:00
Aaron Weiss
afe3558880
Cleaned up a bunch of code with clippy. 2018-01-28 01:14:55 +01:00
Aaron Weiss
5266e4098d
Refactored the whole crate to use failure. 2018-01-28 00:52:11 +01:00
Aaron Weiss
8782f66de4
Merge branch 'irc-reactor' into develop 2018-01-27 21:19:38 +01:00
Aaron Weiss
2d28a71c6c
Removed some trailing whitespace in reactor docs. 2018-01-27 20:59:41 +01:00
Aaron Weiss
de6e5f331d
Added debug derivations for irc::client types (fixes #104). 2018-01-27 20:39:35 +01:00
Aaron Weiss
ce158fc612
Made unspecified server or nickname into errors instead of simply panics. 2018-01-27 20:26:56 +01:00
Aaron Weiss
67cca339a7
Eliminated a panic that can occur when using IrcServerFuture, and recommend using IrcReactor instead. 2018-01-27 19:50:48 +01:00
Aaron Weiss
fd4e5706eb
Added more documentation for IrcReactor, and made new_future internal-only. 2018-01-27 19:26:48 +01:00
Aaron Weiss
ff9eba2722
Made some of the reactor API more generic. 2018-01-27 15:35:44 +01:00
Aaron Weiss
982d1b5a0d
Added a function to access the tokio reactor handle in IrcReactor. 2018-01-27 15:18:15 +01:00
Aaron Weiss
e62d4a97aa
Added a first cut (without examples) of documentation for IrcReactor. 2018-01-24 14:51:41 +01:00
Aaron Weiss
fbe17978fc
Removed trailing whitespace in documentation. 2018-01-24 12:21:03 +01:00
Aaron Weiss
ab16c865bb
Added a function to spawn arbitrary futures on a reactor (i.e. opt-in "full" tokio support). 2018-01-24 12:13:33 +01:00
Aaron Weiss
fc4b4cad7f
Reorganized imports in reactor.rs. 2018-01-08 23:54:06 -05:00
Aaron Weiss
a7ae091ff5
Moved connection creation sooner for better error handling in IrcServer::from_config. 2018-01-08 23:19:29 -05:00
Aaron Weiss
bbc6b0244d
Added an experimental reactor API to hide tokio. 2018-01-08 21:52:56 -05:00
Aaron Weiss
40ff295821
Fixed parsing bug allowing messages without arguments to parse correctly. 2018-01-06 13:31:08 -05:00
Aaron Weiss
452645a56f
Fixed compilation error with no-default-features. 2018-01-01 23:07:10 -05:00
Aaron Weiss
a0d0d3e249
Cleaned up a bunch of code with clippy. 2018-01-01 22:25:25 -05:00
Aaron Weiss
68666aef09
Made a stylistic change to the new message throttling code. 2018-01-01 21:52:23 -05:00
Aaron Weiss
70ff2ec992
Changed throttling window to be properly rolling. 2018-01-01 21:47:59 -05:00
Aaron Weiss
16292fcc2c
Improved documentation for message throttling configuration. 2018-01-01 21:47:28 -05:00
Aaron Weiss
c7772c0479
Changed message throttling to use a rolling window. 2018-01-01 21:18:33 -05:00
Aaron Weiss
321bbec7ad
Changed message parsing to accept more line ending options. 2017-12-30 12:21:20 -05:00
Aaron Weiss
2564e6b060
Added a bunch of detail about the high-level client API to the prelude. 2017-12-24 21:50:43 -05:00