#include <tny-list.h>
#include <tny-iterator.h>
#include <tny-simple-list.h>
+#include <tny-camel-imap-store-account.h>
+#include <tny-camel-pop-store-account.h>
#include <libmodest-dbus-client/libmodest-dbus-client.h>
#include "modest-tny-account.h"
#include "modest-search.h"
#include "modest-runtime.h"
+#include "modest-platform.h"
static gchar *
g_strdup_or_null (const gchar *str)
return string;
}
-
static GList*
add_hit (GList *list, TnyHeader *header, TnyFolder *folder)
{
if (account) {
/* g_debug ("DEBUG: %s: Searching account %s",
__FUNCTION__, tny_account_get_name (account)); */
+
+ /* Give the account time to go online if necessary,
+ * for instance if this is immediately after startup,
+ * after D-Bus activation: */
+ modest_platform_check_and_wait_for_account_is_online (account);
+
+ /* Search: */
res = modest_search_account (account, search);
if (res != NULL) {