coleifer / irc

tinkering with a made-from-scratch irc library in python
http://irckit.readthedocs.org/
MIT License
179 stars 55 forks source link

Support for registering connections #1

Closed runeh closed 13 years ago

runeh commented 13 years ago

Hey,

Really like the module. Got the simple bot I wanted running 35 lines, which is really cool!

Anyway, some servers (like the ones running newnet) wont accept incoming commands before the connection is completely registered. The calls to conn.join thus resulted in error messages from the server because they were sent too early.

I've added support for waiting for the connection to be registered before sending any data. The algorithm for determining if a connection is registered is done by waiting for the end of the motd (or abscence of motd). I stole that from here http://search.cpan.org/dist/AnyEvent-IRC/lib/AnyEvent/IRC/Client.pm#EVENTS

Please pull if the patches look sane to you.

Cheers

Rune

coleifer commented 13 years ago

Thanks so much for the excellent patches! I've merged them into master