---On 2013.Jan.31 5:44 AM, Benoît Bailleux wrote:
> Le 29/01/2013 18:25, alta88[nntp] a écrit :
>> [...]
>> there is an extension, not (yet) on AMO, that does this generically for
>> attachments.
>
> Very nice extension.
> Just a small annoyance (TB 17.0.2, Linux Ubuntu 12.04.1) with the
> preview feature: when I click on the icon of an eligible attachment, the
> preview is displayed, and then the same content is still displayed when
> hovering on any other message as well. Until I click again on any other
> message. This happens only on message with an "Object" string short
> enough to fit in the message pane.
>
yes, a second click is necessary to collapse it. it is unknown when the
user wants it collapsed, perhaps it should auto collapse if cursor is
moved off the row. this is just an experiment anyway.
>> [...]
>>
>> note that if you want to do this specifically for text/calendar within a
>> multipart/alternative envelope (a typical Lightning invite), you will
>> have to stream the mime message for each mail and parse the parts.
>
> That seems to be exactly what I need. Are the parts included in such a
> message type accessible with a specific method? A first and quick trial
> with "MimeMessage.allAttachments" gave me an empty list of parts.
> Isn't "stream[ing] the mime message for each mail and parse the parts"
> what AC is actually doing?
>
because the parser doesn't think the text/calendar part is an
attachment, and technically it isn't. so you have to
get back the result (the entire mimemsg) and parse it manually. a
lightning invite, for example, is sent as a true attachment, with an
application/ics content type and file extension .ics. if this were the
only attachment, then AC would show the icon for whatever your handler
is for that type.
>> if, instead, the icon for the attachment type is fine (and there is one),
>> then AttachmentCount might suffice. it only processes those messages
>> that already have an attachment flag emitted.
>
> As I don't know how messages are build and processed, I don't understand
> that. Do you mean that the messages of type "multipart/alternative"
> should already have a specific icon displayed by AC? Is there a specific
> header for messages with attachment? I suppose that messages of type
> "multipart/alternative" don't have that flag, right?
>
no, since within that envelope it's not a content-disposition of
attachment. if Tb thinks a message might have an attachment, the
headers will have a flag (it is adjusted later on message open). if you
set View->Message Body As->All body parts, a flag will always be emitted
(this option may be hidden, there's an ext to unhide it, i forget the
latest status). but then, even the content is a mime part.
>> [...]
>
> Do you think that AC can be extended to display an icon whenever a
> message is actually a calendar invite? My main concern is actually that
> 99.9% of my colleagues use Outlook, and sometimes their invite stay
> unread in my inbox because nothing has catched my eyes.
>
well, it could but. 'actually a calendar invite' has to be strictly
defined. if it isn't an attachment, it would be strictly incorrect to
show it as such. another real attachments would override the icon. and
more than one attachment always shows a count. so it would be a rather
significant semantic exception.
perhaps a specific calendar invite column is better. i suppose it could
be added to AC. it would be nice if MsgHdrToMimeMessage() were more robust.
> Regards,