[beagle] Build fixes. * Build with gmime-2.4 - patch from Jeffrey Stedfast * Build with newer Mono.Data.Sqlit



commit 6710bab0c8e35ed2f6ebf7064c066e16da1602d8
Author: D Bera <dbera web gmail com>
Date:   Tue May 4 17:32:00 2010 +0530

    Build fixes.
    * Build with gmime-2.4 - patch from Jeffrey Stedfast
    * Build with newer Mono.Data.Sqlite 2.x - patch from Gabriel Burt

 beagle/Filters/FilterMail.cs                       |   50 ++++++----
 beagle/Util/FSpotTools.cs                          |    2 +-
 .../EvolutionMailIndexableGenerator.cs             |  102 ++++++++++++--------
 beagle/beagled/GoogleBackends/GMailSearchDriver.cs |   35 ++++---
 beagle/beagled/KMailQueryable/KMailIndexer.cs      |   56 +++++++----
 beagle/beagled/SqliteUtils.cs                      |    8 +-
 .../ThunderbirdQueryable/ThunderbirdQueryable.cs   |   17 ++-
 beagle/configure.in                                |   10 +-
 8 files changed, 172 insertions(+), 108 deletions(-)
---
diff --git a/beagle/Filters/FilterMail.cs b/beagle/Filters/FilterMail.cs
index 7c807e7..7cced44 100644
--- a/beagle/Filters/FilterMail.cs
+++ b/beagle/Filters/FilterMail.cs
@@ -131,7 +131,7 @@ namespace Beagle.Filters {
 
 			// Messages that are multipart/alternative shouldn't be considered as having
 			// attachments.  Unless of course they do.
-			if (mime_part is GMime.Multipart && mime_part.ContentType.Subtype.ToLower () != "alternative")
+			if (mime_part is GMime.Multipart && mime_part.ContentType.MediaSubtype.ToLower () != "alternative")
 				return true;
 
 			return false;
@@ -145,34 +145,43 @@ namespace Beagle.Filters {
 			AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
 
 			GMime.InternetAddressList addrs;
-			addrs = this.message.GetRecipients (GMime.Message.RecipientType.To);
+			addrs = this.message.GetRecipients (GMime.RecipientType.To);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:to_name", ia.Name));
 				AddEmailLink (ia);
 			}
 			addrs.Dispose ();
 
-			addrs = this.message.GetRecipients (GMime.Message.RecipientType.Cc);
+			addrs = this.message.GetRecipients (GMime.RecipientType.Cc);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:cc_name", ia.Name));
 				AddEmailLink (ia);
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (this.message.Sender));
+			addrs = GMime.InternetAddressList.Parse (this.message.Sender);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:from_name", ia.Name));
 				AddEmailLink (ia);
 			}
@@ -189,7 +198,7 @@ namespace Beagle.Filters {
 				AddProperty (Property.NewUnsearched ("fixme:msgid", GMime.Utils.DecodeMessageId (msgid)));
 
 			foreach (GMime.References refs in this.message.References)
-				AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
+				AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
 
 			string list_id = this.message.GetHeader ("List-Id");
 			if (list_id != null)
@@ -350,16 +359,15 @@ namespace Beagle.Filters {
 					}
 				} else if (mime_part is GMime.Multipart) {
 					GMime.Multipart multipart = (GMime.Multipart) mime_part;
-
-					int num_parts = multipart.Number;
+					int num_parts = multipart.Count;
 
 					// If the mimetype is multipart/alternative, we only want to index
 					// one part -- the richest one we can filter.
-					if (mime_part.ContentType.Subtype.ToLower () == "alternative") {
+					if (mime_part.ContentType.MediaSubtype.ToLower () == "alternative") {
 						// The richest formats are at the end, so work from there
 						// backward.
 						for (int i = num_parts - 1; i >= 0; i--) {
-							GMime.Object subpart = multipart.GetPart (i);
+							GMime.Object subpart = multipart[i];
 
 							if (IsMimeTypeHandled (subpart.ContentType.ToString ())) {
 								part = subpart;
@@ -375,7 +383,7 @@ namespace Beagle.Filters {
 					// the parts, treat them like a bunch of attachments.
 					if (part == null) {
 						for (int i = 0; i < num_parts; i++) {
-							using (GMime.Object subpart = multipart.GetPart (i))
+							using (GMime.Object subpart = multipart[i])
 								this.OnEachPart (subpart);
 						}
 					}
@@ -405,7 +413,7 @@ namespace Beagle.Filters {
 						} else if (mime_type == "text/html") {
 							no_child_needed = true;
 							html_part = true;
-							string enc = part.GetContentTypeParameter ("charset"); 
+							string enc = part.ContentType.GetParameter ("charset"); 
 							// DataWrapper.Stream is a very limited stream
 							// and does not allow Seek or Tell
 							// HtmlFilter requires Stream.Position=0.
@@ -479,7 +487,7 @@ namespace Beagle.Filters {
 							if (length != -1)
 								child.AddProperty (Property.NewUnsearched ("fixme:filesize", length));
 
-							if (part.ContentType.Type.ToLower () == "text")
+							if (part.ContentType.MediaType.ToLower () == "text")
 								child.SetTextReader (new StreamReader (stream));
 							else
 								child.SetBinaryStream (stream);
diff --git a/beagle/Util/FSpotTools.cs b/beagle/Util/FSpotTools.cs
index 82f7752..bc95865 100644
--- a/beagle/Util/FSpotTools.cs
+++ b/beagle/Util/FSpotTools.cs
@@ -86,7 +86,7 @@ namespace Beagle.Util {
 								try {
 									reader = command.ExecuteReader ();
 								} catch (SqliteException e) {
-									if (e.ErrorCode == SQLiteErrorCode.Busy) {
+									if (e.ErrorCode == SqliteErrorCode.Busy) {
 										Thread.Sleep (50);
 									} else {
 										throw;
diff --git a/beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs b/beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
index 4b098fe..9150480 100644
--- a/beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
+++ b/beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
@@ -333,28 +333,46 @@ namespace Beagle.Daemon.EvolutionMailQueryable {
                         indexable.AddProperty (Property.NewUnsearched ("fixme:folder", this.folder_name));
 
 			GMime.InternetAddressList addrs;
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+			
+			if (this.folder_name == "Sent") {
+				addrs = message.GetRecipients (GMime.RecipientType.To);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name == "Sent"  && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+			
+			if (this.folder_name == "Sent") {
+				addrs = message.GetRecipients (GMime.RecipientType.Cc);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name != "Sent"  && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
+			
+			if (this.folder_name != "Sent") {
+				addrs = GMime.InternetAddressList.Parse (message.Sender);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+						indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
+			
 			if (this.folder_name == "Sent")
 				indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
 
@@ -750,48 +768,54 @@ namespace Beagle.Daemon.EvolutionMailQueryable {
 			}
 
 			GMime.InternetAddressList addrs;
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.to);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.to);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:to_name", ia.Name));
 				}
-
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+				
+				if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.cc);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.cc);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:cc_name", ia.Name));
 				}
-
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+				
+				if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.from);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.from);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:from_name", ia.Name));
 				}
 
-				if (this.folder_name != "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
+				if (this.folder_name != "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
 			}
 			addrs.Dispose ();
 
diff --git a/beagle/beagled/GoogleBackends/GMailSearchDriver.cs b/beagle/beagled/GoogleBackends/GMailSearchDriver.cs
index 9efd153..bc37842 100644
--- a/beagle/beagled/GoogleBackends/GMailSearchDriver.cs
+++ b/beagle/beagled/GoogleBackends/GMailSearchDriver.cs
@@ -322,38 +322,47 @@ namespace Beagle.Daemon.GoogleBackend {
 			hit.AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
 
 			GMime.InternetAddressList addrs;
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
+			addrs = message.GetRecipients (GMime.RecipientType.To);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:to_name", ia.Name));
 			}
 			addrs.Dispose ();
 
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
+			addrs = message.GetRecipients (GMime.RecipientType.Cc);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:cc_name", ia.Name));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
+			addrs = GMime.InternetAddressList.Parse (message.Sender);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:from_name", ia.Name));
 			}
 			addrs.Dispose ();
 
 			foreach (GMime.References refs in message.References)
-				hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
+				hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
 
 			string list_id = message.GetHeader ("List-Id");
 			if (list_id != null)
diff --git a/beagle/beagled/KMailQueryable/KMailIndexer.cs b/beagle/beagled/KMailQueryable/KMailIndexer.cs
index f8c7f89..f32a3c5 100644
--- a/beagle/beagled/KMailQueryable/KMailIndexer.cs
+++ b/beagle/beagled/KMailQueryable/KMailIndexer.cs
@@ -407,28 +407,46 @@ namespace Beagle.Daemon.KMailQueryable {
                         indexable.AddProperty (Property.NewUnsearched ("fixme:folder", folder_name));
 
 			GMime.InternetAddressList addrs;
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
+			
+			if (folder_name == Queryable.SentMailFolderName) {
+				addrs = message.GetRecipients (GMime.RecipientType.To);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
+			
+			if (folder_name == Queryable.SentMailFolderName) {
+				addrs = message.GetRecipients (GMime.RecipientType.Cc);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name != Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", ia.Addr));
+			
+			if (folder_name != Queryable.SentMailFolderName) {
+				addrs = GMime.InternetAddressList.Parse (message.Sender);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
+			
 			if (folder_name == Queryable.SentMailFolderName)
 				indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
 			else {
diff --git a/beagle/beagled/SqliteUtils.cs b/beagle/beagled/SqliteUtils.cs
index f747db5..eca1d52 100644
--- a/beagle/beagled/SqliteUtils.cs
+++ b/beagle/beagled/SqliteUtils.cs
@@ -56,7 +56,7 @@ namespace Beagle.Util {
 						ret = command.ExecuteNonQuery ();
 						break;
 					} catch (SqliteException ex) {
-						if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+						if (ex.ErrorCode == SqliteErrorCode.Busy) {
 							Thread.Sleep (50);
 						} else {
 							Log.Error (ex, "SQL that caused the exception: {0}", command_text);
@@ -85,7 +85,7 @@ namespace Beagle.Util {
 					ret = command.ExecuteNonQuery ();
 					break;
 				} catch (SqliteException ex) {
-					if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+					if (ex.ErrorCode == SqliteErrorCode.Busy) {
 						Thread.Sleep (50);
 					} else {
 						Log.Error (ex, "SQL that caused the exception: {0}", command.CommandText);
@@ -107,7 +107,7 @@ namespace Beagle.Util {
 				try {
 					reader = command.ExecuteReader ();
 				} catch (SqliteException ex) {
-					if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+					if (ex.ErrorCode == SqliteErrorCode.Busy) {
 						Thread.Sleep (50);
 					} else {
 						throw;
@@ -123,7 +123,7 @@ namespace Beagle.Util {
 				try {
 					return reader.Read ();
 				} catch (SqliteException ex) {
-					if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+					if (ex.ErrorCode == SqliteErrorCode.Busy) {
 						Thread.Sleep (50);
 					} else {
 						throw;
diff --git a/beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs b/beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
index dfdb023..1ad9d70 100644
--- a/beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
+++ b/beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
@@ -367,9 +367,14 @@ namespace Beagle.Daemon.ThunderbirdQueryable {
 			message.Subject = Mime.HeaderDecodeText (GetText (document, "Subject"));
 			message.Sender = Mime.HeaderDecodePhrase (GetText (document, "Author"));
 			message.MessageId = GetText (document, "MessageId");
-			message.SetDate (DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date"))), 0);
-			message.AddRecipientsFromString ("To", Mime.HeaderDecodePhrase (GetText (document, "Recipients")));
-
+			message.Date = DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date")));
+			
+			string str = GetText (document, "Recipients");
+			GMime.InternetAddressList recipients = GMime.InternetAddressList.Parse (str);
+			foreach (GMime.InternetAddress ia in recipients)
+				message.To.Add (ia);
+			recipients.Dispose ();
+			
 			return message;
 		}
 		
@@ -434,7 +439,7 @@ namespace Beagle.Daemon.ThunderbirdQueryable {
 			
 			// We _know_ that the stream comes from a StreamReader, which uses UTF8 by
 			// default. So we use that here when parsing our string.
-			return (str != null ? Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
+			return (str != null ? System.Text.Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
 		}
 		
 		// This spell "charset="
@@ -462,7 +467,7 @@ namespace Beagle.Daemon.ThunderbirdQueryable {
 			// instead of UTF-8 in some cases and that will really mess things up.
 			byte[] buffer = null;
 			int c, header_length = 0, newlines = 0, charset_pos = 0;
-			Encoding enc = Encoding.UTF8;
+			System.Text.Encoding enc = System.Text.Encoding.UTF8;
 			try {
 				do {
 					c = stream.BaseStream.ReadByte ();
@@ -491,7 +496,7 @@ namespace Beagle.Daemon.ThunderbirdQueryable {
 				stream.BaseStream.Read (buffer, 0, buffer.Length);
 				
 				// We need to use correct encoding
-				enc = Encoding.GetEncoding (encoding_str);
+				enc = System.Text.Encoding.GetEncoding (encoding_str);
 			} catch {
 			} finally {
 				stream.Close ();
diff --git a/beagle/configure.in b/beagle/configure.in
index 43f8407..e0122a0 100644
--- a/beagle/configure.in
+++ b/beagle/configure.in
@@ -17,7 +17,7 @@ MONODOC_REQUIRED=1.2.4
 NDESK_DBUS_REQUIRED=0.5.2
 NDESK_DBUS_GLIB_REQUIRED=0.3.0
 GTK_SHARP_REQUIRED=2.10.0
-GMIME_SHARP_REQUIRED=2.2.0
+GMIME_SHARP_REQUIRED=2.3.5
 EVOLUTION_SHARP_REQUIRED=0.13.3
 GSF_SHARP_REQUIRED=0.6
 GTK_REQUIRED=2.10.0
@@ -223,7 +223,7 @@ if test "x$enable_gui" = "xyes"; then
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 ])
 	AC_SUBST(BEAGLE_UI_LIBS)
 
@@ -270,7 +270,7 @@ PKG_CHECK_MODULES(EVO,
                   evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED,
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED,
                   have_evo_dependencies=yes, have_evo_dependencies=no)
 AC_SUBST(EVO_LIBS)
 
@@ -377,14 +377,14 @@ dnl ----------------------------------------------
 PKG_CHECK_MODULES(BEAGLED,
 [
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 ])
 BEAGLED_LIBS="$BEAGLED_LIBS $GSF_SHARP_LIBS"
 AC_SUBST(BEAGLED_LIBS)
 
 GSF_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gsf-sharp`
-GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp`
+GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp-2.4`
 
 dnl ----------------------------------------------
 dnl Epiphany Extension



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