profanity icon indicating copy to clipboard operation
profanity copied to clipboard

Auto save recieved files

Open shpoongle opened this issue 1 year ago • 7 comments

When a file is received the link is usually so long that you need to reduce the font size of the terminal to select the link. It would be great if there was an option that received files could just autosave to a predetermined folder. :)

Expected Behavior

A simple option to select autosave received files yes/no and which directory to save #them.

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

This is literally the only issue (from my personal perspective) that keeps me from using profanity.

Environment

  • Give us the version and build information output generated by profanity -v
  • If you could not yet build profanity, mention the revision you try to build from
  • Operating System/Distribution
  • glib version
  • libstrophe version
  • Some bugs might be due to specific implementation in the server. /serversoftware example.domain can be helpful

shpoongle avatar May 12 '24 11:05 shpoongle

When a file is received the link is usually so long that you need to reduce the font size of the terminal to select the link.

How about using: /url save <tab>? :)

Autosaving files that someone sends you sounds like a bad idea.

jubalh avatar May 12 '24 18:05 jubalh

I can understand the desire for that feature, it's basically how all other clients work ...

Autosaving files that someone sends you sounds like a bad idea.

We could make it configurable to auto save only for e.g. contacts in your roster and "private MUCs".

Three settings, autosave.{1on1,muc,pm} with different TBD levels!? Or sth. in that direction. We'll have to think about the exact details.

sjaeckel avatar May 12 '24 19:05 sjaeckel

How about using: /url save <tab>? :)

Was unaware of this and yes it certainly is extremely helpful

I can understand the desire for that feature, it's basically how all other clients work ...

It really does make life massively easier, it's the little things like this that just make the software itself more polished and also massively improve productivity for the end user. (imo)

shpoongle avatar May 14 '24 19:05 shpoongle

it's basically how all other clients work

mcabber for sure isn't. Neither is poezio and aparte. Conversations has a setting to auto download depending on size but AFAIK the default is not to auto download. I'm not sure about Gajim. Dino seems to autodownload though.

For GUI clients it might make sense, since they embed (for example) images in their widget.

I'm not against a setting for it though. If someone wants to implement such a feature.

jubalh avatar May 15 '24 06:05 jubalh

I guess there should be a file extension white list. We can't predict the real filetype but probably adding this will help anyways a bit. So that only files that are uploaded via http_upload and end in *.jpg, *.png are downloaded automatically and not links to websites.

This probably needs to be done in wins_add_urls_ac() or that function needs to be renamed to better reflect what it's doing then.

Inside we need to check the setting if the user wants to autodownload files (PREF_xxx) and if yes, check whether the link matches the whitelisted format.

Then it should download files like in cmd_url_save(). Probably some parts of that function need to be put inside a helper function and called by both.

jubalh avatar Jun 20 '24 14:06 jubalh

I agree that not adding links to websites to auto download makes sense. I would tentatively suggest that the filetypes that should be auto downloaded should be *.jpg *.png *.mp4 and *.mp3 this covers the three things that are sent most commonly, pictures videos and voice messages. - Sorry for the huge delay on response.

shpoongle avatar Jul 28 '24 10:07 shpoongle