[evolution/webkit: 77/171] em_utils_message_to_html() - set all validity flags found in entire processed message



commit 9bc9a57cf210f81551171d8188a7211f760a1a3a
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed Dec 14 16:46:31 2011 +0100

    em_utils_message_to_html() - set all validity flags found in entire processed message
    
    Originally the EMFormat held field with flags of all detected validities
    (signature/encryption). In the new EMFormat each PURI has it's own validity
    flags describing validity of the particular PURI. To make the function work
    as before we need to iterate through all the PURIs and return all flags we
    run into.

 mail/em-utils.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 3afd3ce..4a06025 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1189,12 +1189,28 @@ em_utils_message_to_html (CamelMimeMessage *message,
 
 	/* FIXME Not passing a GCancellable here. */
 	em_format_parse (EM_FORMAT (emfq), message, NULL, NULL);
-	/* FIXME WEBKIT The validity is now per-part, not global :(
-	if (validity_found)
-		*validity_found = ((EMFormat *)emfq)->validity_type;
-        */
 
-        em_format_quote_write (emfq, mem, NULL);
+	if (validity_found) {
+		GList *iter;
+		EMFormat *emf = (EMFormat *) emfq;
+
+		if (validity_found)
+			*validity_found = 0;
+
+		/* Return all found validities */
+		for (iter = emf->mail_part_list; iter; iter = iter->next) {
+			
+			EMFormatPURI *puri = iter->data;
+			if (!puri)
+				continue;
+
+			if (*validity_found && puri->validity_type)
+				*validity_found |= puri->validity_type;
+		}
+
+	}
+
+	em_format_quote_write (emfq, mem, NULL);
 
 	g_object_unref (emfq);
 



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