Skip to content
  • Michael Gratton's avatar
    Ensure we always use the one, same codepath when decoding text content. · f1c79765
    Michael Gratton authored
    This introduces the Geary.RFC822.Part class, which provides a place to
    MIME entity body decoding code so it can be reused when needed. It also
    provides a place to put common GMime to Geary object conversion, and
    apply some common policy decisions, such as what is the default content
    type if none is specified.
    
    * src/engine/rfc822/rfc822-part.vala: New Part class that represents a
      MIME entity. Move code for both decoding entity body from
      RFC822.Message and code for cleaning content filename from RFC822.Util
      to here. Convert GMime entity header objects into their Geary
      equivalents and make available as properties. Provide a common means of
      determining the content type of the part if not explicitly set.
    
    * src/engine/rfc822/rfc822-message-data.vala (PreviewText.with_header):
      Construct a RFC822.Part and use that for decoding preview text. Swap
      args to make some more sense and update call sites.
    
    * src/engine/rfc822/rfc822-message.vala (InlinePartReplacer): Simply pass
      through an instance of a RFC822.Part rather than the multi-arg list,
      since that has all the data needed by replacers.
    
    * src/engine/imap-db/imap-db-attachment.vala (Attachment): Require and
      use RFC822.Part instances for obtaining attachment bodies rather than
      GMime.Part instances. Update call sites.
    f1c79765