Re: About identifying video attachment from TnyMsg



Rajesh Sai T escribiu:
> Hi All,
> 
> I had a message received from Gmail account and following are
> observations [but for audio attachment everything works perfectly],
> 
> Observations :
> 
> 1) TnyGtkHeaderModel returns that mail has no attachment. [ When the
> TnyHeaderflags value is read from Flags column of HeaderModel, and do (
> flag & TNY_HEADER_FLAG_ATTACHMENTS) it is returning FALSE  ]

That's because the header model only gets information from the header.
If the header does not have information about headers (like some clients
like Outlook insert) then it won't have the flags.

> 2) Even after retrieving mime-parts of TnyMsg and do
> *tny_mime_part_is_attachment ()* on each mime-part is still returning
> FALSE for mime-part of content-type "video/mov". If I validate the
> mime-part based on their content-types how could I differntiate between
> inline-images [mails like season greetings] and normal attachments ?

That function, only performs a very basic check. It mostly checks the
"content-disposition" field (which is not used by every mail client
BTW). If it's "attachment" then it'll return TRUE. check
tny-camel-mime-part.c

> Even couldnot parse for attachment using content-disposition. When I
> parse for "name=" on TnyPair its returning NULL.
> 
> Can someone please guide me, how to parse this TnyMsg for video
> attachment ?

You can take a look at how we do it in Modest. We have a function called
modest_tny_mime_part_is_attachment_for_modest that does some extra
checks. You can find it here:
https://git.maemo.org/projects/modest/gitweb?p=modest;a=blob;f=src/modest-tny-mime-part.c;h=ff6c1cdf90909adbca32e7e6f6a1a572463e29df;hb=HEAD

Br


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