Re: Problem with tny_camel_msg_header_set_flags()
- From: Alberto Garcia <agarcia igalia com>
- To: tinymail-devel-list gnome org
- Subject: Re: Problem with tny_camel_msg_header_set_flags()
- Date: Wed, 31 Oct 2007 15:26:47 +0100
O Mércores 31/10/2007 ás 15:17, Alberto Garcia dicía...
> So I would just ignore all priority flags in the unset() function
> (maybe we could print a warning in case one is found). I'm attaching
> my proposed patch.
Actually this one is better, it doesn't make much sense to remove the
X-Priority header outside the set_prio_mask() function
--
Alberto García González
http://people.igalia.com/berto/
Index: tny-camel-msg-header.c
===================================================================
--- tny-camel-msg-header.c (revision 2897)
+++ tny-camel-msg-header.c (working copy)
@@ -225,6 +225,9 @@
TnyHeaderFlags prio_mask = mask;
prio_mask &= TNY_HEADER_FLAG_PRIORITY_MASK;
+ camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-MSMail-Priority");
+ camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-Priority");
+
if (prio_mask == TNY_HEADER_FLAG_HIGH_PRIORITY) {
camel_medium_add_header (CAMEL_MEDIUM (me->msg), "X-MSMail-Priority", "High");
camel_medium_add_header (CAMEL_MEDIUM (me->msg), "X-Priority", "1");
@@ -255,10 +258,9 @@
me->partial = FALSE;
}
- if ((mask & TNY_HEADER_FLAG_PRIORITY_MASK)|| (mask == 0)) {
- camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-MSMail-Priority");
- camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-Priority");
-
+ /* Set priority only if no other flags are found.
+ Normal priority is 00 so there's no other way to detect it */
+ if (!(mask & ~TNY_HEADER_FLAG_PRIORITY_MASK)) {
set_prio_mask (me, mask);
}
@@ -279,11 +281,6 @@
tny_header_set_flag (me->decorated, mask);
}
- /* we only need to detect unsets of low and high priority, as unsetting normal
- * priority should lead to set again normal priority */
- if (mask & TNY_HEADER_FLAG_PRIORITY_MASK)
- set_prio_mask (me, TNY_HEADER_FLAG_NORMAL_PRIORITY);
-
if (mask & TNY_HEADER_FLAG_ATTACHMENTS)
camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-MS-Has-Attach");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]