zerowidth / camper_van

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

camper_van requests info of joining user after I disconnected #47

Closed janpio closed 10 years ago

janpio commented 10 years ago

Hey,

so I've been playing around with camper_van - great tool to make Campfire chats less painful. But there seem to be some inaccuracies or even problems.

After I disconnected my IRC client (Quassel) from camper_van it still requested information on a user that joined later. Here's the log output of camper_van:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\User>camper_van
2013-10-12 12:06:41  2184  INFO CamperVan : starting server on 127.0.0.1:6667
2013-10-12 13:08:12  2184  INFO CamperVan : got connection from 127.0.0.1
2013-10-12 13:08:12  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/users/me.json
2013-10-12 13:08:13  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/users/me.json
2013-10-12 13:08:13  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/rooms.json
2013-10-12 13:08:14  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:08:14  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#/join.json
2013-10-12 13:08:15  2184  INFO CamperVan : performing streaming request to https://streaming.campfirenow.com/room/#my_user_id#/live.json
2013-10-12 13:08:18  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:08:40  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/rooms.json
2013-10-12 13:08:41  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:08:43  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:08:52  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/rooms.json
2013-10-12 13:08:53  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:08:58  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:09:04  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/rooms.json
2013-10-12 13:09:05  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:09:08  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:09:11  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/rooms.json
2013-10-12 13:09:11  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:09:13  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/room/#my_user_id#.json
2013-10-12 13:09:18  2184  INFO CamperVan : closed connection from 127.0.0.1
2013-10-12 14:23:37  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/users/#different_user_id#.json
2013-10-12 14:23:37  2184  INFO CamperVan : performing request to https://#channelname#.campfirenow.com/users/#different_user_id#.json

As I was still in the channel as a guest with a second PC, I know that a user with #different_user_id# joined around that time.

Shouldn't camper_van leave the channel when my IRC client closes the connection? How did camper_van learn that this new user joined? I don't see anything in the logs.

janpio commented 10 years ago

So I looked around in the code (I'm no ruby dev, so please excusemy naivety) and only found unbind in server.rb on line 138 that outputs the INFO log "closed connection from 127.0.0.1". I couldn't find the code where unbind is actually called or triggered :/

Am I right to assume that no other cleanup like leaving channels on Campfire is done when the connection to the IRC server is closed?

zerowidth commented 10 years ago

This is a side effect of camper_van not leaving a campfire room when you PART a channel. Should be fixed now.