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);
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);
+}