[geary/wip/713846-plain-inline] Final tweaks



commit f678c5e78ef64ed307114df673c83183446d3c48
Author: Jim Nelson <jim yorba org>
Date:   Fri Jan 10 12:17:10 2014 -0800

    Final tweaks
    
    Robert pointed out I'd introduced a bug.  Also marking get_html_body
    and get_text_body as private, as they're unused outside of Message.

 src/engine/rfc822/rfc822-message.vala |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index 0160d17..47b816b 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -500,10 +500,7 @@ public class Geary.RFC822.Message : BaseObject {
         if (disposition == null || disposition.disposition_type == Mime.DispositionType.UNSPECIFIED)
             return false;
         
-        // if replacer's unavailable, done; if it is available but its output is not desirable
-        // (i.e. the caller doesn't want replaced text, it wants inline text of a format), done
-        // as well
-        if (replacer == null || !allow_only_replaced)
+        if (replacer == null)
             return false;
         
         // Hand off to the replacer for processing
@@ -512,7 +509,7 @@ public class Geary.RFC822.Message : BaseObject {
         if (replaced_part != null)
             body = replaced_part;
         
-        return replaced_part != null;
+        return allow_only_replaced && (replaced_part != null);
     }
     
     /**
@@ -540,7 +537,7 @@ public class Geary.RFC822.Message : BaseObject {
      *
      * Throws { link RFC822Error.NOT_FOUND} if an HTML body is not present.
      */
-    public string? get_html_body(InlinePartReplacer? replacer) throws RFC822Error {
+    private string? get_html_body(InlinePartReplacer? replacer) throws RFC822Error {
         return internal_get_body(true, "html", false, replacer);
     }
     
@@ -553,7 +550,7 @@ public class Geary.RFC822.Message : BaseObject {
      *
      * Throws { link RFC822Error.NOT_FOUND} if a plaintext body is not present.
      */
-    public string? get_text_body(bool convert_to_html, InlinePartReplacer? replacer) throws RFC822Error {
+    private string? get_text_body(bool convert_to_html, InlinePartReplacer? replacer) throws RFC822Error {
         return internal_get_body(true, "plain", convert_to_html, replacer);
     }
     


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