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



commit 187a0326f88ee152dd2845fe224ca674d1c3be39
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 7b8404d..3d5026b 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1271,12 +1271,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]