Do ignore empty recipients when checking names
[modest] / src / modest-search.c
index 6146a8b..d206df7 100644 (file)
@@ -109,7 +109,7 @@ add_hit (GList *list, TnyHeader *header, TnyFolder *folder)
         * so we can find what we get. Philip is working on this.
         */
        uid = tny_header_dup_uid (header);
-       if (!furl) {
+       if (!uid) {
                gchar *subject = tny_header_dup_subject (header);
                g_warning ("%s: tny_header_get_uid(): returned NULL for message with subject=%s\n", __FUNCTION__, subject);
                g_free (subject);
@@ -243,8 +243,8 @@ search_mime_part_strcmp (TnyMimePart *part, ModestSearch *search)
        len = (sizeof (buffer) - 1) / 2;
 
        if (strlen (search->body) > len) {
-               g_warning ("Search term bigger then chunk."
-                          "We might not find everything");     
+               g_debug ("Search term bigger then chunk."
+                        "We might not find everything");       
        }
 
        stream = tny_mime_part_get_stream (part);
@@ -413,14 +413,18 @@ modest_search_folder_get_headers_cb (TnyFolder *folder,
 
        while (!tny_iterator_is_done (iter)) {
 
-               TnyHeader *cur = (TnyHeader *) tny_iterator_get_current (iter);
-               const time_t t = tny_header_get_date_sent (cur);
-               gboolean found = FALSE;
-               
+               TnyHeader *cur;
+               time_t t;
+               gboolean found;
+
+               cur = (TnyHeader *) tny_iterator_get_current (iter);
+               t = tny_header_get_date_sent (cur);
+               found = FALSE;
+
                /* Ignore deleted (not yet expunged) emails: */
                if (tny_header_get_flags(cur) & TNY_HEADER_FLAG_DELETED)
                        goto go_next;
-                       
+
                if (helper->search->flags & MODEST_SEARCH_BEFORE)
                        if (!(t <= helper->search->end_date))
                                goto go_next;
@@ -612,7 +616,7 @@ modest_search_account_get_folders_cb (TnyFolderStore *self,
                        TnyList *children = tny_simple_list_new ();
                        helper->pending_calls++;
                        tny_folder_store_get_folders_async (TNY_FOLDER_STORE (folder), children, NULL, 
-                                                           modest_search_account_get_folders_cb, 
+                                                           FALSE, modest_search_account_get_folders_cb, 
                                                            NULL, helper);
                }
 
@@ -654,7 +658,7 @@ _search_account (TnyAccount *account,
 
        /* Get folders */
        tny_folder_store_get_folders_async (TNY_FOLDER_STORE (account), folders, NULL, 
-                                           modest_search_account_get_folders_cb, 
+                                           FALSE, modest_search_account_get_folders_cb, 
                                            NULL, helper);
 }