gf3 / Jerk

Stupidly simple IRC bots in Javascript.
http://gf3.github.com/Jerk
The Unlicense
106 stars 17 forks source link

Added `joinOn` option, which takes a raw IRC protocol code and triggers the on-connect stuff (much better than waiting for ping) #21

Closed peol closed 12 years ago

peol commented 13 years ago

Added an additional 'trigger on-connect' override called joinOn, which accepts a raw IRC protocol code

jsyrjala commented 13 years ago

Some servers are completely silent until the client sends some message. See https://github.com/gf3/IRC-js/commit/bfa34db

peol commented 13 years ago

So this issue is completely fixed by that commit?

peol commented 13 years ago

God damn GH, don't have "Comment & close" closest to the textbox :P

jsyrjala commented 13 years ago

Oops, no. That commit is about different level of connecting. But I think that Jerk should listen for 'connected' event at that point instead of waiting to receive some irc message.

peol commented 13 years ago

Indeed, the problem is that the connected stuff isn't available everywhere. Most servers accepts the client spamming JOIN etc. before actually being fully connected, but the fallback being PING/PONG, this is a better alternative (just look up a RAW IRC code that specific server is spitting out).

jsyrjala commented 13 years ago

Hmm, connected event is issued by irc-js when it has sent ( asynchronously ) the login commands to the server. Maybe it should issue the event after the server has accepted the login. Note that connected event is distinct from the connect even emitted by the networking lib.

peol commented 13 years ago

Yeah, you're right. I think it should fire after the login stuff has been sent, that's what connected means in my world when it comes to IRC :)