Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.82k stars 196 forks source link

Local text message log #750

Open j1warren opened 2 years ago

j1warren commented 2 years ago

The Problem

It is probably against matrix design, but would be very nice to have a text message log saved locally, like it was before whatsapp-like IM design took over (e.g. pidgin).

It's not important to follow edits to the messages, etc. Just storing text as it was sent on the first message appearance would be enough.

Does nheko architecture allow to implement this?

The Solution

n/a

Alternatives

No response

Additional context

No response

Happens in the latest version

deepbluev7 commented 2 years ago

Nheko already stores up to the last 30000 messages in a room locally, unless it was offline for a while and the gap was too large. What exactly is your goal?

j1warren commented 2 years ago

To have complete text log stored locally forever. Just like in pidgin I have logs dating back to 2000s.

deepbluev7 commented 2 years ago

All messages on my system would take up around 50GB of storage. I guess this would need to be configurable somehow...

Thulinma commented 2 years ago

It is common for such logs to be stored in a directory structure by year and/or month. That allows easy manual deletion and/or archival.

I've been pondering doing something like this, mostly to enable client-side searching (because when you're searching for a specific message, you usually want something from quite a while ago...).

It would also make sense to allow turning logging on/off on a per-room basis. 🤔

If nobody else picks this up in the next few months, I'll probably take a shot at it.

deepbluev7 commented 2 years ago

I have a plan for search already, that doesn't require you storing messages in plain text. Storing messages unencrypted is not really something I want to do. That should a conscious action to export the messages.

Thulinma commented 2 years ago

Who said "unencrypted"? 😏

My plan is to store the original JSON as-received in these logs, so as to also preserve relationships between messages and be able to use them as an "offline" view of sorts. What is yours?

deepbluev7 commented 2 years ago

Store an encrypted bloom filter in account data, so that you don't need to index all your messages on every device. We already store most of the messages in our database anyway, we just drop the cache, when the server tells us too or you leave a room. Decrypting every message and searching them 1 by 1 would probably be slow.

j1warren commented 2 years ago

Ideally I'd like to be able to disable encryption (if something malicious runs code on your computer, offline message encryption won't save you) and be able to grep through logs without Nheko running. grep -rni "exotic falconry" logs/@username

deepbluev7 commented 2 years ago

Ideally I'd like to be able to disable encryption (if something malicious runs code on your computer, offline message encryption won't save you) and be able to grep through logs without Nheko running. grep -rni "exotic falconry" logs/@username

I don't think that is something we will support. That sounds like a completely different client.

BrenBarn commented 6 months ago

A simple modification to reduce the size of logs would be to allow enabling longs on a per-room basis. I don't necessarily want logs of huge rooms I'm in where there's a lot of random chatter, but I would like logs of DMs or some small rooms.