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



commit 381b1630e9d7cd3fc89e140f6cd073b3d6fe003e
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 b60ea77..8c4ee12 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1383,12 +1383,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]