pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Re: pan on Win 7 "attachment not shown" bug


From: walt
Subject: Re: [Pan-users] Re: pan on Win 7 "attachment not shown" bug
Date: Tue, 30 Mar 2010 08:57:34 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a4pre) Gecko/20100330 Thunderbird/3.2a1pre

On 03/30/2010 06:06 AM, Steve Davies wrote:

What does "attachment not shown" mean when it happens elsewhere?
When/where does the message appear?

I'm not sure what you mean by 'elsewhere', but the code that 'decides'
whether or not to show an attachment lies in pan/gui/header-pane.cc,
where 'a' stands for the article you clicked on:

    if (a) {
      const size_t lines = a->get_line_count();
      const bool is_smallish = lines  <= 5000;
      const bool is_mediumish = lines <= 20000;
      const bool image_subject = has_image_type_in_subject (*a);
      const bool is_pictures_newsgroup = 
pane->get_group().to_view().strstr("pictures")!=0;
      if (is_smallish || image_subject)
        pane->_action_manager.activate_action ("read-selected-article");
      else if (is_mediumish && is_pictures_newsgroup)
        pane->_action_manager.activate_action ("read-selected-article");
      else
        pane->_action_manager.activate_action ("save-articles");
    }

The decision tree is not the most elegant code in pan because there are
many possible reasons to assume the attachment is a picture and therefore
should be displayed.

You can see that pan first checks the article's line count. That number
has certainly increased over the years along with bandwidth and server
retention, so I've edited the code myself to increase those hard-coded
numbers.

Pan then checks the subject line to look for strings like 'jpg', 'jpeg',
'png', 'gif', etc.

Then it checks the group name for the string 'pictures', and combines all
of these checks to make a decision about showing the attachment.

A bunch of pretty arbitrary criteria, methinks.  I wasn't around when Charles
wrote that code, but I'm guessing he was trying to make the decision before
actually decoding the attachment.  The reason for doing that isn't obvious to
me at the moment, probably because it involves using pan in a mode that I
don't use, like 'offline' or some such.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]