Priority flags are parsed incorrectly



Apart from other problems that we have seen in this whole priority
flags issue, there's another one in tny_camel_msg_header_get_flags()
which takes "X-Priority: 3" as if it was LOW priority.

Here's a patch to fix that. I'm also checking for values 2 (high) and
4 (low).

--
Alberto García González
http://people.igalia.com/berto/
--- tny-camel-msg-header.c.orig	2007-10-26 11:23:42.000000000 +0200
+++ tny-camel-msg-header.c	2007-10-26 11:25:20.000000000 +0200
@@ -195,9 +195,11 @@
 	priority_string = camel_medium_get_header (CAMEL_MEDIUM (me->msg), "X-Priority");
 	attachments_string = camel_medium_get_header (CAMEL_MEDIUM (me->msg), "X-MS-Has-Attach");
 	if (priority_string != NULL) {
-		if (g_strrstr (priority_string, "1") != NULL)
+		if (g_strrstr (priority_string, "1") != NULL ||
+		    g_strrstr (priority_string, "2") != NULL)
 			result |= TNY_HEADER_FLAG_HIGH_PRIORITY;
-		else if (g_strrstr (priority_string, "3") != NULL)
+		else if (g_strrstr (priority_string, "4") != NULL ||
+			 g_strrstr (priority_string, "5") != NULL)
 			result |= TNY_HEADER_FLAG_LOW_PRIORITY;
 		else 
 			result |= TNY_HEADER_FLAG_NORMAL_PRIORITY;


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