After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 403797 - RFE: allow save path to be based on subject line
RFE: allow save path to be based on subject line
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other Linux
: Normal enhancement
: ---
Assigned To: Charles Kerr
Pan QA Team
Depends on:
Blocks:
 
 
Reported: 2007-02-03 01:51 UTC by djh
Modified: 2011-02-19 18:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proof of concept patch against 0.122 (4.33 KB, patch)
2007-02-04 13:39 UTC, djh
needs-work Details | Review

Description djh 2007-02-03 01:51:30 UTC
I would like to see the ability to save attachments to a pathname based on the subject line, eg. a %s option similar to %g and %G substitutions in the save dialog.

This is a bit trickier than it sounds, given the variety of software and subject-line conventions used by posters.

This could be a reasonable approach for cutting down the subject line into something that's useful as a pathname component:

- Strip out the attachment filename (i suspect this could be the hardest part, 
  as we don't yet have the yEnc header when path expansion is done)
- Strip out anything resembling multi-part info (File X of Y, [X/Y], [XofY], etc.)
- Replace any illegal characters
Comment 1 djh 2007-02-04 13:39:30 UTC
Created attachment 81872 [details] [review]
proof of concept patch against 0.122

Here is an extremely rough patch against 0.122.

I don't think anyone could get this approach to work 100% reliably.  Would a reasonable approximation be considered good enough?  It works well for me, but i guess it depends which groups you frequent.

You'll need to add -lpcrecpp to pan_LDADD in pan/gui/Makefile.  I'm not messing with autotools for a lousy PoC.  :-)
Comment 2 Charles Kerr 2007-02-04 18:04:00 UTC
Not a bad start.

I guess maybe the thing to do would be to move this up into
a higher library like usenet-utils so that we could make
unit tests that throw a lot of Subject headers at it to see
where it breaks.
Comment 3 Charles Kerr 2007-02-04 18:05:04 UTC
As an aside, I'm trying to keep Pan's prerequisite list as short
as possible.  It would be nicer to do this in pcre without
requiring the c++ bindings...
Comment 4 SciFi 2007-03-28 05:06:20 UTC
Hi,

I'm using this patch, too, presently with Pan svn r207 running on Darwin/OSX (will get it up to r211 asap).  I specify <blah>/%s/%g in the download dir string, and it does a decent job at separating & grouping the attachments.

I found that this patch didn't handle the filenames coming from NZBs.  Such files were literally downloaded to the <blah>/%s/%g subdirs, creating them verbatimly.  ;)

The main reason to support the % substitutions in this regard comes from several NZB-generating services such as http://binsearch.info/ , which can insert many collections of Usenet postings, even unrelated ones, into a single (large) .nzb file.  It'd be nice if Pan could separate & group these, too, in the same manner.

Thank you for spending time on these kinds of enhancements, they will give several Mac newsreaders some serious competition.  :)

Comment 5 Kenneth Haley 2010-03-25 06:33:30 UTC
I've put a modified version of this into my repo at github.  I've moved the main function into text-massager.cc and I added a few test subject lines to text-massager-test.cc.  Currently the 'tests' are just outputting the input & output of the function.
Comment 6 Petr Kovar 2011-02-19 18:23:38 UTC
Merged into GNOME master.

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.