[Mono-list] patch for camel.cs

tapia tapia@eitig.com
13 Aug 2003 15:26:06 +0200


--=-eI+lA/xC9Nr9x064Qy2h
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi.

I didn't know where should I send this patch, sorry if it's the wrong
place.

I've added a few lines for the miguel's parser for Evolution mbox
summary files used in dashboard. Now you can get the messages flags, and
see if the message is seen, deleted, etc.

You can do something like this:

foreach (MBoxMessageInfo mi in summary.messages)
{
	if (((mi.flags & CamelMessageFlags.CAMEL_MESSAGE_DELETED) == 1)
	{
		Console.WriteLine ("The message has been deleted");
	}
}

Let me know if it is interesting, it's my first patch ever :-)

-- 
tapia@eitig.com
http://tapia.eitig.com
--------------------------------
http://www.hispalinux.es
http://www.monohispano.org
http://www.es.gnome.org
Debian GNU/Linux Sid
--------------------------------
"Llevamos cadenas aunque no las veamos,
y somos esclavos aunque nos llamemos hombres libres".
-- Oscar Wilde. 

--=-eI+lA/xC9Nr9x064Qy2h
Content-Disposition: attachment; filename=camel.diff
Content-Type: text/plain; name=camel.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

--- /home/tapia/src/dashboard/util/evolution/camel.cs	2003-07-25 12:02:38.000000000 +0200
+++ camel.cs	2003-08-06 17:49:00.000000000 +0200
@@ -10,6 +10,17 @@
 using System.Text;
 
 namespace Camel {
+
+	public enum CamelMessageFlags {
+		CAMEL_MESSAGE_ANSWERED = 1<<0,
+		CAMEL_MESSAGE_DELETED = 1<<1,
+		CAMEL_MESSAGE_DRAFT = 1<<2,
+		CAMEL_MESSAGE_FLAGGED = 1<<3,
+		CAMEL_MESSAGE_SEEN = 1<<4,
+		CAMEL_MESSAGE_ATTACHMENTS = 1<<5,
+		CAMEL_MESSAGE_ANSWERED_ALL = 1<<6
+	}
+	
 	public class Summary {
 		public MBoxSummaryHeader header;
 		public MessageInfo [] messages;
@@ -113,8 +124,6 @@
 			nextuid = Decode.FixedInt (f);
 			time    = Decode.Time (f);
 			count   = Decode.FixedInt (f);
-
-			Console.WriteLine ("V={0} time={1}, count={2}", version, time, count);
 		}
 	}
 
@@ -124,7 +133,6 @@
 		public MBoxSummaryHeader (FileStream f) : base (f)
 		{
 			folder_size = Decode.UInt (f);
-			Console.WriteLine ("Folder size:" + folder_size);
 		}
 	}
 	

--=-eI+lA/xC9Nr9x064Qy2h--