ERC-History: An ERC plugin to pull chat archives

Wouldn’t it be exciting if ERC could have this feature? :grinning:


IRC (Internet Relay Chat) has been a staple in online communication since the late 1980s, but compared to newer chat platforms like Discord, it has several limitations and barriers that might deter newcomers. Here are some of the key limitations and barriers:

  • User Interface:

    Often text-based and minimalistic. Mitigated by some clients.

  • Multimedia Support:

    Limited support for images, videos, and other multimedia content. Some clients like ERC with ERC-Image help mitigate this, but features like image uploads remain cumbersome (is there any ERC plugin for this?).

  • Message History:

    Users joining a channel can only see messages sent after they joined.

  • Mobile and Cross-Platform Support:

    There are no particularly attractive clients available for mobile.

My goal is to enhance the IRC experience so users don’t feel like they’re missing out while using IRC. I’m focusing first on the message history issue, which I find the most annoying. Currently, users who join a channel can’t see past messages or context. Also, users might miss some messages if they disconnect unless they set up services like bouncers.

To address this, I created a simple ERC plugin called erc-history. This plugin allows users to pull previous messages from IRC channels, provided the logs are archived and accessible. It doesn’t matter if the chat logs are public, private, or local. As long as you can access them via HTTP, you can retrieve them.

For example, IRC channels like Ubuntu keep their logs publicly archived at Ubuntu IRC Logs. I understand that some might have privacy concerns (I personally don’t because anyone might log IRC :grin:). To address this, we can use a token system so only those with the token can access the logs. Additionally, we could add a bot command to let users opt out of logging. This way, their messages won’t be logged and would appear as:

2024-06-21 21:23:45 - ebeem: …

If you’re interested, I’d love to hear your thoughts and any concerns you might have. Together, we can improve the IRC experience by including such features.

Note: With access to chat logs, we can work on other enhancements like mobile support with chat history. Once the source of the chat logs is available, the rest of the tasks will become much easier.

GitHub repo: GitHub - ebeem/erc-history


My first thought is, of course, to use Matrix instead of IRC, which solves all of these problems inherently. :wink:

Having said that, the next problem is that this depends on public archive servers. As you said, it makes little sense to have an expectation of privacy on public channels, but e.g. Libera maintains a policy against public logging, and it seems to be the biggest network.

Anyway, I wish you success in your efforts, fellow Emacser. :slight_smile:

BTW, regarding the code: I’m curious, why are you using a mutex? (Also, you should prefix the local variable name so it’s not just mutex.)

Also, regarding your with-current-time function: 1) it should probably be a macro, and 2) you needn’t protect the cl-letf with an unwind-protect, because it already does that (expand the macro to see for yourself), and 3) you can bind the original function in the cl-letf form itself rather than in an outer let form, and 4) all the symbols you define should be prefixed with your package’s name.

1 Like

hey alphapapa!
Thanks for all of your comments, I will try to improve my code as I have no much experience writing packages yet.

Regarding the mutex, I am trying to prevent pulling multiple dates asynchronously. Currently the code doesn’t check for a stamp and places the line on the right timeline. It just pulls previous messages and append them in order. Pulling multiple dates at the same time will cause messages to not show up in the right order.

Regarding matrix, I agree that it’s a better alternative. It seems that their promise of bridges isn’t going well though. Some people also complain about privacy as they did publish some logs before.

Anyways, I am completely fine with matrix as a solution, especially when your ement.el exist :wink:.

About Libera, they are not against public logging, as I am providing an example of some irc logs in Libera (ubuntu). They are against public archiving without the knowledge of the users in the channel. So for that you need a permission from the owner of the channel and users must be notified about the archiving.

Thanks a lot for your feedback!

Ah, I see. Mutexes in Emacs are mostly only used for threads, which are hardly used at all, so that seemed unusual to me. If it works, cool.

There are many bridges operating for many users without problems. Libera had specific issues with some IRC bridges when implemented at a large scale for their servers. Element didn’t have the resources to address the issues on a timescale Libera was comfortable with, so Libera disabled the mass bridges; other users continue to operate bridges for individual channels without problems.

The Matrix public archive server served some logs of public channels. Again, public channels, which anyone can view, record the messages in, and publish. Some users who misunderstand Matrix, and who seem to have impractical ideas about online privacy, overreacted, and then people like you hear misleading rumors. The truth is that the public archive servers were very useful, as they made chat history indexable by search engines, which is very useful for, e.g. tech support channels. And the truth is that no one who talks in a public channel should have any expectation of privacy there.

Haha :slight_smile:

That’s what I mean: Anyone could be recording messages in public channels and could publish them at any time. The idea that privacy is maintained by such a policy is silly and gives users a false sense of security, which is worse than no policy at all.

Anyway, IRC is probably not going away, which is fine, I’ve nothing against it. But Matrix seems like the future to me. (I wasn’t planning on talking about Matrix this much here, but I wanted to set the record straight since it came up.)