* src/modest-search.c:
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 2 Oct 2007 09:15:49 +0000 (09:15 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 2 Oct 2007 09:15:49 +0000 (09:15 +0000)
* (add_hit): now we get the minimum of the dates in a header,
  instead of the date received. This way the date is better
  obtained (fixes NB#61007).
* (search_mime_part_strcmp): minor improvemnt in the broken
 no-ogs backend for search.

pmo-trunk-r3449

src/dbus_api/modest-dbus-callbacks.c
src/modest-search.c

index 962a675..6778438 100644 (file)
@@ -1152,7 +1152,7 @@ on_dbus_method_search (DBusConnection *con, DBusMessage *message)
                                     DBUS_TYPE_INT32, &flags_v,
                                     DBUS_TYPE_UINT32, &size_v,
                                     DBUS_TYPE_INVALID);
-       
+
        dbus_flags = (ModestDBusSearchFlags) flags_v;
        start_date = (time_t) sd_v;
        end_date = (time_t) ed_v;
index 477638f..f1500a7 100644 (file)
@@ -111,7 +111,7 @@ add_hit (GList *list, TnyHeader *header, TnyFolder *folder)
        hit->msize = tny_header_get_message_size (header);
        hit->has_attachment = flags & TNY_HEADER_FLAG_ATTACHMENTS;
        hit->is_unread = ! (flags & TNY_HEADER_FLAG_SEEN);
-       hit->timestamp = tny_header_get_date_received (header);
+       hit->timestamp = MIN (tny_header_get_date_received (header), tny_header_get_date_sent (header));
        
        return g_list_prepend (list, hit);
 }
@@ -297,7 +297,7 @@ search_mime_part_strcmp (TnyMimePart *part, ModestSearch *search)
                                                        buffer,
                                                        TRUE);
 
-               if (found) {
+               if ((found)||(nread == 0)) {
                        break;
                }