Commit Graph

503 Commits

Author SHA1 Message Date
Shiz 85039068de Add utility function to convert arbitrary names to Python identifiers. 2014-02-10 02:47:50 +01:00
Shiz 2cea7599da Parse CTCP query contents properly. 2014-02-10 02:47:50 +01:00
Shiz fcc9895103 Undo "smart" optimization change that breaks mode parsing. 2014-02-10 02:47:50 +01:00
Tony Young f92b6b194e Always perform _sync_user if metadata is available.
This is slightly less bad than only syncing user metadata if the user is
in a channel. When we received a PM, there was no way to retrieve
username/hostname information. This remedies it by making the
information available in the users dictionary and will be updated anyway
if a user sends a new message.
2014-02-10 02:47:50 +01:00
Tony Young 920a7357d6 Switch to Python's built-in logging module.
This allows client code to configure logging without having to mess
around with pydle's logging system (and pydle shouldn't hijack logging,
anyway).
2014-02-10 02:47:50 +01:00
Tony Young 04d0bf2cdf Add support for setting source_address. 2014-02-10 02:47:50 +01:00
Shiz d1794d1a97 Remove last trace of message types. 2014-02-10 02:47:49 +01:00
Shiz 6969767cc7 Copy input modes in the mode parsing function to prevent side-effects.
This fixes issue #9.
2014-02-10 02:47:49 +01:00
Shiz 0da57710b7 Remove the ability to wait for certain message types to arrive.
It is unused and can lead to ping timeouts easily, and will be useless
in the upcoming connection rewrite anyway.
2014-02-10 02:47:49 +01:00
Shiz d60d76b0c5 Add force parameter to message construction. 2014-02-10 02:47:49 +01:00
Shiz 24228b68fb Move password connection parameter to features.rfc1459. 2014-02-10 02:47:49 +01:00
Shiz 0b3278723b Update README to reflect codebase changes. 2014-02-10 02:47:49 +01:00
Shiz 8c6cb164ff Seperate base RFC1459 functionality into feature.
This moves pretty much all RFC1459-dependent code into
`pydle.features.rfc1459`. `pydle.features.ircv3_1` and
`pydle.features.ircv3_2` have also been reorganized.
2014-02-10 02:47:28 +01:00
Shiz 9ab4c454bf Merge branch 'master' of github:Shizmob/pydle 2014-02-05 17:22:11 +01:00
Shiz 8521332af8 Add experimental support for MONITOR. 2014-02-05 17:21:06 +01:00
Shiz f151c1ba30 Move handling of a single message to Client.handle_single(). 2014-02-05 17:20:22 +01:00
Shiz a6a2da28b6 Fix broken source parsing. 2014-02-05 12:15:43 +01:00
Shiz 1a17db9794 Add tls_client_cert_password option for TLS keyfile password. 2014-02-05 12:07:12 +01:00
Shiz 62298e7a44 Remove channel information after being kicked or parting.
Also fixed _destroy_channel() to remove any users not in common anymore as a result of leaving the channel.
2014-02-05 11:15:24 +01:00
Shiz 2d337a935c Merge pull request #7 from rfw/master
TLS fixes.
2014-02-05 10:26:59 +01:00
Tony Young 66f0f0c9f7 Rename pem_password to tls_certificate_password 2014-02-05 04:25:08 -05:00
Tony Young f8cff52b52 Sets flags to 0 for recv() if the socket is an SSL socket.
SSLSocket doesn't support flags on recv().
2014-02-05 02:57:47 -05:00
Tony Young e3b13b6c75 Alow passing a PEM password to the connection. 2014-02-05 02:32:08 -05:00
Tony Young a33eca803f Fix typo in SSLContext.load_verify_locations.
ca_path= should be capath=
2014-02-05 02:26:37 -05:00
Shiz c8b083b663 Merge pull request #6 from rfw/master
Don't throw an exception if we attempt to message a channel we're not in.
2014-02-04 15:44:18 -08:00
Tony Young db39414c9c Don't throw an exception if we attempt to message a channel we're not in.
If the channel isn't +n, outside messages are allowed.
2014-02-04 18:32:00 -05:00
Shiz b7dc08ae25 Neatify parts handling in message parsing. 2014-02-04 21:37:23 +01:00
Shiz 146d4d9b65 Refactor parts handling in message parsing. 2014-02-04 21:35:54 +01:00
Shiz f3603c9bf6 Merge pull request #5 from rfw/master
Parse parameters as parameter* and not parameter+.
2014-02-04 12:32:18 -08:00
Tony Young f452dd20f7 Parse parameters as parameter* and not parameter+.
Some IRC commands have no parameters and this accomodates for them.
2014-02-04 14:35:26 -05:00
Shiz 8926db46b7 Make exception handling on sockets more robust. 2014-02-04 12:25:59 +01:00
Shiz 92f558fbba Merge pull request #4 from rfw/master
Also catch socket.error on TLS teardown.
2014-02-04 03:17:41 -08:00
Tony Young ea83e56f4b Also catch socket.error on TLS teardown. 2014-02-04 06:03:10 -05:00
Shiz 00587532f1 Merge pull request #3 from rfw/master
Fix error behaviour and edge cases.
2014-02-04 02:11:33 -08:00
Tony Young e92a981f1a Fix typo (_construct_message -> _create_message). 2014-02-04 02:53:03 -05:00
Tony Young 38ca472ff1 Run on_connect tasks when code 422 is received.
Code 422 is sent if there is no MOTD set on the server but the connection
completes.
2014-02-04 02:52:14 -05:00
Tony Young a20491d084 Don't throw KeyError if we can't format a hostmask for a nickname.
Some IRCds send weird commands at odd times (e.g. PING before NICK),
and sometimes user information isn't always available (e.g. out of channel
messages).
2014-02-04 02:50:24 -05:00
Shiz 302b446920 Loosen message parsing requirements and log invalid messages. 2014-02-02 18:27:32 +01:00
Shiz 87719e4cf0 Add message tag feature. 2014-02-02 17:33:21 +01:00
Shiz ae9d2bad8a Refactor IRC message parsing into extensible architecture.
Instead of having a single monolithic function in the pydle.protocol
module parse messages, there will now be a protocol.Message class
features can extend from to add functionality to the parser.
Consequently, all internal callbacks have been changed to take messages
as arguments instead of a collection of metadata about the messages.

A message object should provide the following API:
- __init__(command, parameters, **kwargs): create a message.
- (static) parse(line, encoding='utf-8'): parse a line into a message.
  Should return a message instance or raise protocol.ProtocolViolation
  on error.
- construct(): turn message into a raw IRC line ready to send to the
  server.

pydle.Connection has new APIs to deal with differing message classes.
2014-02-02 16:26:03 +01:00
Shiz db2a2ddd6f pydle v0.7.1 2014-01-30 14:05:52 +01:00
Shiz c941d2b5e1 Add multiline support to client.message()/client.notice(). 2014-01-30 10:11:20 +01:00
Shiz c2e27a4a0f Add message sending throttling. 2014-01-30 09:15:26 +01:00
Shiz 89bcc077d5 Add more robust connectivity checking. 2014-01-30 09:00:57 +01:00
Shiz c22cc437df Made client.message() and client.notice() chunk input if it will not fit into a single message. 2014-01-30 08:54:33 +01:00
Shiz 14fef8bb99 pydle v0.7.0 2014-01-30 03:53:44 +01:00
Shiz db2b883a6d Don't bother waiting for messages if we already have one in queue. 2014-01-30 02:55:09 +01:00
Shiz 6a3b63a825 Add default value for ConnectionPool constructor. 2014-01-30 02:29:16 +01:00
Shiz 05030707b6 Fix bug where ClientPool would fail to handle any messages. 2014-01-30 02:24:57 +01:00
Shiz f859455d55 Add documentation for pydle.featurize. 2014-01-23 03:00:16 +01:00