zerowidth / camper_van

A Campfire to IRC bridge
MIT License
129 stars 25 forks source link

Disconnect from channels when going away, reconnect when back. #37

Closed eatnumber1 closed 11 years ago

eatnumber1 commented 11 years ago

This is a rough patch which will part from channels when going away, and rejoin when you return. This is useful for me because I like to hook up CamperVan to my IRC bouncer and be able to simply /away once for all of the servers my bouncer connects to.

zerowidth commented 11 years ago

I'm not sure this would be expected behavior for most users, especially since you'd lose any history by leaving a room. Campfire does have a vague sense of "idle", as I recall, but nothing you can set programmatically. Maybe a command-line option, e.g. --part-on-away defaulting to false would be better here.

eatnumber1 commented 11 years ago

Sounds reasonable. I've added an option.

zerowidth commented 11 years ago

Lookin' good so far. Mind adding a couple tests just to make sure the happy path is working?

eatnumber1 commented 11 years ago

Done. I also made /away appear to work to the client even without --part-on-away which should prevent the state my client is in currently whereby it thinks it's away and can't get out of it.

The only test I wasn't exactly sure how to write was the "return from away when --part-on-away is set"

zerowidth commented 11 years ago

Merged, thanks! It'll be part of the next release, which is Coming Soon™

eatnumber1 commented 11 years ago

Awesome, thanks!