Fixes NB#122195, modest becames inaccessible with specially malformed email with...
[modest] / src / modest-utils.c
index 019504c..376d797 100644 (file)
@@ -71,7 +71,7 @@ modest_utils_folder_writable (const gchar *filename)
        if (!filename)
                return FALSE;
 
-       if (g_strncasecmp (filename, "obex", 4) != 0) {
+       if (g_ascii_strncasecmp (filename, "obex", 4) != 0) {
                GnomeVFSFileInfo *folder_info = NULL;
                GnomeVFSResult result = GNOME_VFS_OK;
                GnomeVFSURI *uri = NULL;
@@ -1131,6 +1131,8 @@ free_notification_data (gpointer data,
        g_free (notification_data->from);
        g_free (notification_data->subject);
        g_free (notification_data->uri);
+
+       g_slice_free (ModestMsgNotificationData, notification_data);
 }
 
 void
@@ -1149,15 +1151,18 @@ modest_utils_flush_send_queue (const gchar *account_id)
 
        /* Get the transport account */
        account = (TnyTransportAccount *)
-               modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store (),
-                                                            MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
-                                                            account_id);
-
+               modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
+                                                            account_id,
+                                                            TNY_ACCOUNT_TYPE_TRANSPORT);
        if (account) {
+               ModestMailOperation *wakeup_op;
                ModestTnySendQueue *send_queue = modest_runtime_get_send_queue (account, TRUE);
 
                /* Flush it! */
-               tny_camel_send_queue_flush ((TnyCamelSendQueue *) send_queue);
+               wakeup_op = modest_mail_operation_new (NULL);
+               modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
+                                                wakeup_op);
+               modest_mail_operation_queue_wakeup (wakeup_op, send_queue);
 
                g_object_unref (account);
        }