d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
524 stars 40 forks source link

`downloads_dir` cannot create a directory, and files are downloaded before user confirmation #158

Closed Kabouik closed 7 months ago

Kabouik commented 7 months ago

Description: The downloads_dir option cannot create a directory, and will default to ~/Downloads if the set path does not exist. This can be an issue if the user wants to download to a /tmp subfolder for instance. It gracefully falls back to ~/Downloads, but does not show a warning or create the missing directory, which I think would be best.

Also, when pressing ^R to download a file, there is a prompt indicating the path and asking to cancel or confirm, but files are downloaded even when cancelling. This is the case at least for attachments sent with attachment_send_type=0, but perhaps other attachments too.

Environment:

d99kris commented 7 months ago

Hi @Kabouik - I've added support for creating downloads_dir if specified directory does not exist.

As for the the downloading of files, the dialog is intended to just be a notification message (so the user knows where the file ended up, and with what name). Thus, I've removed showing the "cancel" key binding in the help bar when showing this notification.

Kabouik commented 7 months ago

Great, thanks!

On 2023-12-09 04:03 Kristofer Berggren @.***> wrote:

Hi @Kabouik - I've added support for creating downloads_dir if specified directory does not exist.

As for the the downloading of files, the dialog is intended to just be a notification message (so the user knows where the file ended up, and with what name). Thus, I've removed showing the "cancel" key binding in the help bar when showing this notification.

--
Reply to this email directly or view it on GitHub: https://github.com/d99kris/nchat/issues/158#issuecomment-1848143605 You are receiving this because you were mentioned.

Message ID: @.***>