Patch: fix priority flags management in TnyCamelMsgHeader
- From: Jose Dapena Paz <jdapena igalia com>
- To: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Patch: fix priority flags management in TnyCamelMsgHeader
- Date: Mon, 29 Oct 2007 10:54:36 +0100
Hi,
This patch fixes some pending issues with priority handling in
tinymail, after last changes.
With the previous code:
* If you set a non priority flag, priority flag was always set to
NORMAL.
* If you unset a non priority flag, priority flag was alwasa set to
NORMAL
With the new code these issues should be fixed:
* We only change the priority flag if we set low or high priorities,
or if we set 0 flags (normal priority).
* We set the priority to normal if we unset any priority flag.
--
Jose Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-camel/tny-camel-msg-header.c
===================================================================
--- libtinymail-camel/tny-camel-msg-header.c (revision 2887)
+++ libtinymail-camel/tny-camel-msg-header.c (working copy)
@@ -255,10 +255,12 @@
me->partial = FALSE;
}
- camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-MSMail-Priority");
- camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-Priority");
+ 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_prio_mask (me, mask);
+ set_prio_mask (me, mask);
+ }
if (mask & TNY_HEADER_FLAG_ATTACHMENTS) {
camel_medium_remove_header (CAMEL_MEDIUM (me->msg), "X-MS-Has-Attach");
@@ -277,7 +279,10 @@
tny_header_set_flags (me->decorated, mask);
}
- set_prio_mask (me, 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]