if (!priv->error) {
SaveToDraftsAddMsgInfo *cb_info = g_slice_new(SaveToDraftsAddMsgInfo);
cb_info->transport_account = g_object_ref(info->transport_account);
- cb_info->draft_msg = g_object_ref(info->draft_msg);
+ cb_info->draft_msg = info->draft_msg ? g_object_ref(info->draft_msg) : NULL;
cb_info->callback = info->callback;
cb_info->user_data = info->user_data;
cb_info->drafts = g_object_ref(drafts);
modest_mail_operation_notify_start (self);
- if (TNY_IS_CAMEL_IMAP_FOLDER (folder))
-/* tny_folder_sync_async(folder, FALSE, NULL, NULL, NULL); /\* FALSE --> don't expunge *\/ */
- tny_folder_sync (folder, FALSE, &(priv->error)); /* FALSE --> don't expunge */
- else if (TNY_IS_CAMEL_POP_FOLDER (folder))
-/* tny_folder_sync_async(folder, FALSE, NULL, NULL, NULL); /\* TRUE --> dont expunge *\/ */
- tny_folder_sync (folder, TRUE, &(priv->error)); /* TRUE --> expunge */
+ if (TNY_IS_CAMEL_IMAP_FOLDER (folder) ||
+ TNY_IS_CAMEL_POP_FOLDER (folder))
+ tny_folder_sync_async(folder, FALSE, NULL, NULL, NULL); /* FALSE --> dont expunge */
else
- /* local folders */
-/* tny_folder_sync_async(folder, TRUE, NULL, NULL, NULL); /\* TRUE --> expunge *\/ */
- tny_folder_sync (folder, TRUE, &(priv->error)); /* TRUE --> expunge */
+ tny_folder_sync_async(folder, TRUE, NULL, NULL, NULL); /* TRUE --> expunge */
}
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
/* Ensure that all the fields are filled correctly */
- g_return_if_fail (priv->account != NULL);
g_return_if_fail (priv->op_type != MODEST_MAIL_OPERATION_TYPE_UNKNOWN);
/* Notify the observers about the mail operation. We do not
return (priv->account) ? g_object_ref (priv->account) : NULL;
}
+
+void
+modest_mail_operation_noop (ModestMailOperation *self)
+{
+ ModestMailOperationPrivate *priv = NULL;
+
+ g_return_if_fail (self);
+
+ priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+ priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_INFO;
+ priv->done = 0;
+ priv->total = 0;
+
+ /* This mail operation does nothing actually */
+ modest_mail_operation_notify_start (self);
+ modest_mail_operation_notify_end (self);
+}