cube-drone / pierc

A python bot that logs IRC channels, and a PHP/JS interface for browsing said logs.
http://classam.github.com/pierc/
Other
52 stars 24 forks source link

When a user quit the channel, it does not store the channel #37

Open AntoineTurmel opened 9 years ago

AntoineTurmel commented 9 years ago

When a user quit the channel, it does not store the channel in the main table. "undefined" is put instead of the right channel name:

bug_pierc

frdmn commented 9 years ago

I assume this is intended because the bot actually doesn't listen for "leaving a channel" (PART) event, instead it listens for the QUIT event, which doesn't reference a specific channel because the user disconnects from the IRC server completely.

AntoineTurmel commented 9 years ago

It's not possible to write a quit line for each channel where the user was ?

frdmn commented 9 years ago

No, not really, as you can see here, the bot tries to parse the channel if the event contains one. However if the user quits instead of parts the channel, the bot won't be able to tell which channels the person was participating.

Perhaps someone else has an idea how to solve this. I'm not a Python pro at all.

AntoineTurmel commented 9 years ago

Well the bot can determine the quit is from X channel because the quit message is displayed on the channel no ?

frdmn commented 9 years ago

I don't think that's how the IRC library works. In general it receives events, those can be messages, join events, quit events, topic change events, etc. At the moment, pierc just receives those and writes it's information into the database. However, the quit event doesn't contain a channel or target which we can parse. At this point we don't know "where" the quit came from.

AntoineTurmel commented 9 years ago

Ok, so I suppose we need first to detect if an user is in the channel... and then deduce by the quit that he is no more in the channel.