From 64ecd5a99171516dd90308508507d872abcfd6fc Mon Sep 17 00:00:00 2001 From: Shiz Date: Thu, 20 Oct 2016 05:27:11 +0200 Subject: [PATCH] Add IRCv3.3 message-tags support. --- README.md | 5 +++-- pydle/features/ircv3/__init__.py | 8 +++++++- pydle/features/ircv3/ircv3_2.py | 2 +- pydle/features/ircv3/ircv3_3.py | 17 +++++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 pydle/features/ircv3/ircv3_3.py diff --git a/README.md b/README.md index f587c47..dd5dd96 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ Features - [CTCP](http://www.irchelp.org/irchelp/rfc/ctcpspec.html) - (coming soon) [DCC](http://www.irchelp.org/irchelp/rfc/dccspec.html) and extensions - [ISUPPORT/PROTOCTL](http://tools.ietf.org/html/draft-hardy-irc-isupport-00) - - [IRCv3.1](http://ircv3.org/) (full) - - [IRCv3.2](http://ircv3.org) (base only, in progress) + - [IRCv3.1](http://ircv3.net) (full) + - [IRCv3.2](http://ircv3.net) (base complete, most optional extensions) + - [IRCv3.3](http://ircv3.net) (base in progress) * Asynchronous: IRC is an asynchronous protocol and so should be a library that implements it. Coroutines are used to process events from the server asynchronously. * Modularised and extensible: Features on top of RFC1459 are implemented as separate modules for a user to pick and choose, and write their own. Broad features are written to be as extensible as possible. * Liberally licensed: The 3-clause BSD license ensures you can use it everywhere. diff --git a/pydle/features/ircv3/__init__.py b/pydle/features/ircv3/__init__.py index a71e283..5fd03cd 100644 --- a/pydle/features/ircv3/__init__.py +++ b/pydle/features/ircv3/__init__.py @@ -15,5 +15,11 @@ from .metadata import MetadataSupport from .ircv3_2 import IRCv3_2Support -class IRCv3Support(IRCv3_2Support, IRCv3_1Support): +## IRCv3.3 support. +from . import ircv3_3 + +from .ircv3_3 import IRCv3_3Support + + +class IRCv3Support(IRCv3_3Support, IRCv3_2Support, IRCv3_1Support): pass diff --git a/pydle/features/ircv3/ircv3_2.py b/pydle/features/ircv3/ircv3_2.py index e4a80b0..996d479 100644 --- a/pydle/features/ircv3/ircv3_2.py +++ b/pydle/features/ircv3/ircv3_2.py @@ -10,7 +10,7 @@ __all__ = [ 'IRCv3_2Support' ] class IRCv3_2Support(metadata.MetadataSupport, monitor.MonitoringSupport, tags.TaggedMessageSupport, ircv3_1.IRCv3_1Support): - """ Support for some of IRCv3.2's extensions. Currently supported: chghost, userhost-in-names. """ + """ Support for some of IRCv3.2's extensions. """ ## IRC callbacks. diff --git a/pydle/features/ircv3/ircv3_3.py b/pydle/features/ircv3/ircv3_3.py new file mode 100644 index 0000000..8efcdbd --- /dev/null +++ b/pydle/features/ircv3/ircv3_3.py @@ -0,0 +1,17 @@ +## ircv3_3.py +# IRCv3.3 support (in progress). +from pydle import async +from . import ircv3_2 + +__all__ = [ 'IRCv3_3Support' ] + + +class IRCv3_3Support(ircv3_2.IRCv3_2Support): + """ Support for some of IRCv3.3's extensions. """ + + ## IRC callbacks. + + @async.coroutine + def on_capability_message_tags_available(self, value): + """ Indicate that we can in fact parse arbitrary tags. """ + return True