1 Index: beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
2 ===================================================================
3 --- beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs (revision 4874)
4 +++ beagle/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs (working copy)
6 indexable.AddProperty (Property.NewUnsearched ("fixme:folder", this.folder_name));
8 GMime.InternetAddressList addrs;
10 - addrs = message.GetRecipients (GMime.Message.RecipientType.To);
11 - foreach (GMime.InternetAddress ia in addrs) {
12 - if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
13 - indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
15 + if (this.folder_name == "Sent") {
16 + addrs = message.GetRecipients (GMime.RecipientType.To);
17 + foreach (GMime.InternetAddress ia in addrs) {
18 + if (ia is GMime.InternetAddressMailbox) {
19 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
21 + indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
29 - addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
30 - foreach (GMime.InternetAddress ia in addrs) {
31 - if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
32 - indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
34 + if (this.folder_name == "Sent") {
35 + addrs = message.GetRecipients (GMime.RecipientType.Cc);
36 + foreach (GMime.InternetAddress ia in addrs) {
37 + if (ia is GMime.InternetAddressMailbox) {
38 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
40 + indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
48 - addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
49 - foreach (GMime.InternetAddress ia in addrs) {
50 - if (this.folder_name != "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
51 - indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
53 + if (this.folder_name != "Sent") {
54 + addrs = GMime.InternetAddressList.Parse (message.Sender);
55 + foreach (GMime.InternetAddress ia in addrs) {
56 + if (ia is GMime.InternetAddressMailbox) {
57 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
59 + indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
68 if (this.folder_name == "Sent")
69 indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
74 GMime.InternetAddressList addrs;
75 - addrs = GMime.InternetAddressList.ParseString (messageInfo.to);
76 + addrs = GMime.InternetAddressList.Parse (messageInfo.to);
77 foreach (GMime.InternetAddress ia in addrs) {
78 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
81 indexable.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
82 - if (ia.AddressType != GMime.InternetAddressType.Group)
83 - indexable.AddProperty (Property.New ("fixme:to_address", ia.Addr));
85 + if (ia is GMime.InternetAddressMailbox)
86 + indexable.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
88 indexable.AddProperty (Property.New ("fixme:to_name", ia.Name));
91 - if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
92 - indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
94 + if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
95 + indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
99 - addrs = GMime.InternetAddressList.ParseString (messageInfo.cc);
100 + addrs = GMime.InternetAddressList.Parse (messageInfo.cc);
101 foreach (GMime.InternetAddress ia in addrs) {
102 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
105 indexable.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
106 - if (ia.AddressType != GMime.InternetAddressType.Group)
107 - indexable.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
109 + if (ia is GMime.InternetAddressMailbox)
110 + indexable.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
112 indexable.AddProperty (Property.New ("fixme:cc_name", ia.Name));
115 - if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
116 - indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
118 + if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
119 + indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
123 - addrs = GMime.InternetAddressList.ParseString (messageInfo.from);
124 + addrs = GMime.InternetAddressList.Parse (messageInfo.from);
125 foreach (GMime.InternetAddress ia in addrs) {
126 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
129 indexable.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
130 - if (ia.AddressType != GMime.InternetAddressType.Group)
131 - indexable.AddProperty (Property.New ("fixme:from_address", ia.Addr));
133 + if (ia is GMime.InternetAddressMailbox)
134 + indexable.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
136 indexable.AddProperty (Property.New ("fixme:from_name", ia.Name));
139 - if (this.folder_name != "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
140 - indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
141 + if (this.folder_name != "Sent" && ia is GMime.InternetAddressMailbox)
142 + indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
146 Index: beagle/beagled/KMailQueryable/KMailIndexer.cs
147 ===================================================================
148 --- beagle/beagled/KMailQueryable/KMailIndexer.cs (revision 4874)
149 +++ beagle/beagled/KMailQueryable/KMailIndexer.cs (working copy)
150 @@ -407,28 +407,46 @@
151 indexable.AddProperty (Property.NewUnsearched ("fixme:folder", folder_name));
153 GMime.InternetAddressList addrs;
155 - addrs = message.GetRecipients (GMime.Message.RecipientType.To);
156 - foreach (GMime.InternetAddress ia in addrs) {
157 - if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
158 - indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
160 + if (folder_name == Queryable.SentMailFolderName) {
161 + addrs = message.GetRecipients (GMime.RecipientType.To);
162 + foreach (GMime.InternetAddress ia in addrs) {
163 + if (ia is GMime.InternetAddressMailbox) {
164 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
166 + indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
174 - addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
175 - foreach (GMime.InternetAddress ia in addrs) {
176 - if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
177 - indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
179 + if (folder_name == Queryable.SentMailFolderName) {
180 + addrs = message.GetRecipients (GMime.RecipientType.Cc);
181 + foreach (GMime.InternetAddress ia in addrs) {
182 + if (ia is GMime.InternetAddressMailbox) {
183 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
185 + indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
193 - addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
194 - foreach (GMime.InternetAddress ia in addrs) {
195 - if (folder_name != Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
196 - indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", ia.Addr));
198 + if (folder_name != Queryable.SentMailFolderName) {
199 + addrs = GMime.InternetAddressList.Parse (message.Sender);
200 + foreach (GMime.InternetAddress ia in addrs) {
201 + if (ia is GMime.InternetAddressMailbox) {
202 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
204 + indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", mailbox.Address));
213 if (folder_name == Queryable.SentMailFolderName)
214 indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
216 Index: beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
217 ===================================================================
218 --- beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs (revision 4874)
219 +++ beagle/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs (working copy)
221 message.Subject = Mime.HeaderDecodeText (GetText (document, "Subject"));
222 message.Sender = Mime.HeaderDecodePhrase (GetText (document, "Author"));
223 message.MessageId = GetText (document, "MessageId");
224 - message.SetDate (DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date"))), 0);
225 - message.AddRecipientsFromString ("To", Mime.HeaderDecodePhrase (GetText (document, "Recipients")));
227 + message.Date = DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date")));
229 + string str = GetText (document, "Recipients");
230 + GMime.InternetAddressList recipients = GMime.InternetAddressList.Parse (str);
231 + foreach (GMime.InternetAddress ia in recipients)
232 + message.To.Add (ia);
233 + recipients.Dispose ();
240 // We _know_ that the stream comes from a StreamReader, which uses UTF8 by
241 // default. So we use that here when parsing our string.
242 - return (str != null ? Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
243 + return (str != null ? System.Text.Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
246 // This spell "charset="
248 // instead of UTF-8 in some cases and that will really mess things up.
249 byte[] buffer = null;
250 int c, header_length = 0, newlines = 0, charset_pos = 0;
251 - Encoding enc = Encoding.UTF8;
252 + System.Text.Encoding enc = System.Text.Encoding.UTF8;
255 c = stream.BaseStream.ReadByte ();
257 stream.BaseStream.Read (buffer, 0, buffer.Length);
259 // We need to use correct encoding
260 - enc = Encoding.GetEncoding (encoding_str);
261 + enc = System.Text.Encoding.GetEncoding (encoding_str);
265 Index: beagle/beagled/GoogleBackends/GMailSearchDriver.cs
266 ===================================================================
267 --- beagle/beagled/GoogleBackends/GMailSearchDriver.cs (revision 4874)
268 +++ beagle/beagled/GoogleBackends/GMailSearchDriver.cs (working copy)
269 @@ -322,38 +322,47 @@
270 hit.AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
272 GMime.InternetAddressList addrs;
273 - addrs = message.GetRecipients (GMime.Message.RecipientType.To);
274 + addrs = message.GetRecipients (GMime.RecipientType.To);
275 foreach (GMime.InternetAddress ia in addrs) {
276 hit.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
277 - if (ia.AddressType != GMime.InternetAddressType.Group)
278 - hit.AddProperty (Property.New ("fixme:to_address", ia.Addr));
280 + if (ia is GMime.InternetAddressMailbox) {
281 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
283 + hit.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
286 hit.AddProperty (Property.New ("fixme:to_name", ia.Name));
290 - addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
291 + addrs = message.GetRecipients (GMime.RecipientType.Cc);
292 foreach (GMime.InternetAddress ia in addrs) {
293 hit.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
294 - if (ia.AddressType != GMime.InternetAddressType.Group)
295 - hit.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
297 + if (ia is GMime.InternetAddressMailbox) {
298 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
300 + hit.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
303 hit.AddProperty (Property.New ("fixme:cc_name", ia.Name));
307 - addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
308 + addrs = GMime.InternetAddressList.Parse (message.Sender);
309 foreach (GMime.InternetAddress ia in addrs) {
310 hit.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
311 - if (ia.AddressType != GMime.InternetAddressType.Group)
312 - hit.AddProperty (Property.New ("fixme:from_address", ia.Addr));
314 + if (ia is GMime.InternetAddressMailbox) {
315 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
317 + hit.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
320 hit.AddProperty (Property.New ("fixme:from_name", ia.Name));
324 foreach (GMime.References refs in message.References)
325 - hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
326 + hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
328 string list_id = message.GetHeader ("List-Id");
330 Index: beagle/configure.in
331 ===================================================================
332 --- beagle/configure.in (revision 4874)
333 +++ beagle/configure.in (working copy)
335 NDESK_DBUS_REQUIRED=0.5.2
336 NDESK_DBUS_GLIB_REQUIRED=0.3.0
337 GTK_SHARP_REQUIRED=2.10.0
338 -GMIME_SHARP_REQUIRED=2.2.0
339 +GMIME_SHARP_REQUIRED=2.3.5
340 EVOLUTION_SHARP_REQUIRED=0.13.3
341 GSF_SHARP_REQUIRED=0.6
344 glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
345 gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
346 gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
347 - gmime-sharp >= $GMIME_SHARP_REQUIRED
348 + gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
350 AC_SUBST(BEAGLE_UI_LIBS)
353 evolution-sharp >= $EVOLUTION_SHARP_REQUIRED \
354 gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED \
355 glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
356 - gmime-sharp >= $GMIME_SHARP_REQUIRED,
357 + gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED,
358 have_evo_dependencies=yes, have_evo_dependencies=no)
361 @@ -374,14 +374,14 @@
363 PKG_CHECK_MODULES(BEAGLED,
365 - gmime-sharp >= $GMIME_SHARP_REQUIRED
366 + gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
367 glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
369 BEAGLED_LIBS="$BEAGLED_LIBS $GSF_SHARP_LIBS"
370 AC_SUBST(BEAGLED_LIBS)
372 GSF_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gsf-sharp`
373 -GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp`
374 +GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp-2.4`
376 dnl ----------------------------------------------
377 dnl Epiphany Extension
378 Index: beagle/Filters/FilterMail.cs
379 ===================================================================
380 --- beagle/Filters/FilterMail.cs (revision 4874)
381 +++ beagle/Filters/FilterMail.cs (working copy)
384 // Messages that are multipart/alternative shouldn't be considered as having
385 // attachments. Unless of course they do.
386 - if (mime_part is GMime.Multipart && mime_part.ContentType.Subtype.ToLower () != "alternative")
387 + if (mime_part is GMime.Multipart && mime_part.ContentType.MediaSubtype.ToLower () != "alternative")
391 @@ -140,34 +140,43 @@
392 AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
394 GMime.InternetAddressList addrs;
395 - addrs = this.message.GetRecipients (GMime.Message.RecipientType.To);
396 + addrs = this.message.GetRecipients (GMime.RecipientType.To);
397 foreach (GMime.InternetAddress ia in addrs) {
398 AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
399 - if (ia.AddressType != GMime.InternetAddressType.Group)
400 - AddProperty (Property.New ("fixme:to_address", ia.Addr));
402 + if (ia is GMime.InternetAddressMailbox) {
403 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
405 + AddProperty (Property.New ("fixme:to_address", mailbox.Address));
408 AddProperty (Property.New ("fixme:to_name", ia.Name));
413 - addrs = this.message.GetRecipients (GMime.Message.RecipientType.Cc);
414 + addrs = this.message.GetRecipients (GMime.RecipientType.Cc);
415 foreach (GMime.InternetAddress ia in addrs) {
416 AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
417 - if (ia.AddressType != GMime.InternetAddressType.Group)
418 - AddProperty (Property.New ("fixme:cc_address", ia.Addr));
420 + if (ia is GMime.InternetAddressMailbox) {
421 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
423 + AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
426 AddProperty (Property.New ("fixme:cc_name", ia.Name));
431 - addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (this.message.Sender));
432 + addrs = GMime.InternetAddressList.Parse (this.message.Sender);
433 foreach (GMime.InternetAddress ia in addrs) {
434 AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
435 - if (ia.AddressType != GMime.InternetAddressType.Group)
436 - AddProperty (Property.New ("fixme:from_address", ia.Addr));
438 + if (ia is GMime.InternetAddressMailbox) {
439 + GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
441 + AddProperty (Property.New ("fixme:from_address", mailbox.Address));
444 AddProperty (Property.New ("fixme:from_name", ia.Name));
448 AddProperty (Property.NewUnsearched ("fixme:msgid", GMime.Utils.DecodeMessageId (msgid)));
450 foreach (GMime.References refs in this.message.References)
451 - AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
452 + AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
454 string list_id = this.message.GetHeader ("List-Id");
456 @@ -345,16 +354,15 @@
458 } else if (mime_part is GMime.Multipart) {
459 GMime.Multipart multipart = (GMime.Multipart) mime_part;
460 + int num_parts = multipart.Count;
462 - int num_parts = multipart.Number;
464 // If the mimetype is multipart/alternative, we only want to index
465 // one part -- the richest one we can filter.
466 - if (mime_part.ContentType.Subtype.ToLower () == "alternative") {
467 + if (mime_part.ContentType.MediaSubtype.ToLower () == "alternative") {
468 // The richest formats are at the end, so work from there
470 for (int i = num_parts - 1; i >= 0; i--) {
471 - GMime.Object subpart = multipart.GetPart (i);
472 + GMime.Object subpart = multipart[i];
474 if (IsMimeTypeHandled (subpart.ContentType.ToString ())) {
477 // the parts, treat them like a bunch of attachments.
479 for (int i = 0; i < num_parts; i++) {
480 - using (GMime.Object subpart = multipart.GetPart (i))
481 + using (GMime.Object subpart = multipart[i])
482 this.OnEachPart (subpart);
486 } else if (mime_type == "text/html") {
487 no_child_needed = true;
489 - string enc = part.GetContentTypeParameter ("charset");
490 + string enc = part.ContentType.GetParameter ("charset");
491 // DataWrapper.Stream is a very limited stream
492 // and does not allow Seek or Tell
493 // HtmlFilter requires Stream.Position=0.
496 child.AddProperty (Property.NewUnsearched ("fixme:filesize", length));
498 - if (part.ContentType.Type.ToLower () == "text")
499 + if (part.ContentType.MediaType.ToLower () == "text")
500 child.SetTextReader (new StreamReader (stream));
502 child.SetBinaryStream (stream);