modmail-dev / logviewer

An external website that allows moderators and administrators to view past Modmail threads. It provides a convenient way for moderators to track previous conversations and helps them to maintain a record of user interactions.
GNU General Public License v3.0
86 stars 1.28k forks source link

Images in messages affected by Discord's new Signed Attachment CDN URLs #80

Open inklesspen opened 6 months ago

inklesspen commented 6 months ago

https://discord.com/developers/docs/reference#signed-attachment-cdn-urls

Discord automatically updates the URLs in the client with new signatures so the images keep working, but of course the URLs in the mongo database do not get updated. When the expiration time on the URL is reached, the image will no longer work.

sebkuip commented 6 months ago

We already forsaw this coming. It's unfortunate but nothing really we can do as the logviewer is standalone and doesn't connect to discord to refresh the URLs.

A user removing the images from their DMs would also remove them from logviewer as well so it's nothing new anymore.

inklesspen commented 6 months ago

It would be nice if there were some way to store them in mongo. Perhaps opt-in, with a ?saveimages command.

lorenzo132 commented 6 months ago

I personally think turning media files into base64 to save those in the mongodb would be the perfect solution for this.

However, i do believe that there should be a config to save the media or not into the mongo as it can take up alot of storage.

lorenzo132 commented 6 months ago

I personally think turning media files into base64 to save those in the mongodb would be the perfect solution for this.

However, i do believe that there should be a config to save the media or not into the mongo as it can take up alot of storage.

Note, this would be a breaking change.