qq99 / echoplexus

Socket.io powered chat, JavaScript REPL, whiteboard, and WebRTC calls
Other
393 stars 54 forks source link

Add persistence on irc-proxy #231

Open alx opened 10 years ago

alx commented 10 years ago

Hi,

The irc-proxy is working really well, and it helps a lot for people not willing to install their own irc client.

Would it be possible to have a persistence as in 'normal' echoplexus channels ?

What would it require ? a bot connected to the channel to fetch the log ? is the same storage logic in use to display the chat lines between echoplexus/irc channels ?

thanks !

Alex

qq99 commented 10 years ago

Interesting idea! Internally, each IRC channel you join irc:chat.whatever.net#room is a new bot that gets started up (the connection is not multiplexed, you may have noticed, which makes it impossible to use 1 nick across many rooms)

There's no reason that we couldn't start to record data as it came in. Right now, messages are stored into redis by an ID that the echoplexus creates, so it'd be interesting to figure out how to store things without storing them redundantly (as there's no ID in the IRC message). Perhaps check that it wasn't already persisted by hashing the message and keeping a set of hashes to check for uniqueness, and just use the timestamp for ordering.

Alternatively, there may be a mode of operation where we can expose a single bot that sits in the channel regardless of a user currently being connected to that channel. Great suggestion :+1: