/* Get account and set it into mail_operation */
priv->account = g_object_ref (transport_account);
+ priv->done = 1;
+ priv->total = 1;
send_queue = TNY_SEND_QUEUE (modest_runtime_get_send_queue (transport_account));
if (!TNY_IS_SEND_QUEUE(send_queue)) {
MODEST_MAIL_OPERATION_ERROR_ITEM_NOT_FOUND,
"modest: could not find send queue for account\n");
} else {
+ /* TODO: connect to the msg-sent in order to know when
+ the mail operation is finished */
tny_send_queue_add (send_queue, msg, &(priv->error));
+ /* TODO: we're setting always success, do the check in
+ the handler */
+ priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
}
- /* Notify about operation end */
+ /* TODO: do this in the handler of the "msg-sent"
+ signal.Notify about operation end */
modest_mail_operation_notify_end (self);
}
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
- /* Get account and set it into mail_operation */
- priv->account = g_object_ref (transport_account);
-
/* Check parametters */
if (to == NULL) {
/* Set status failed and set an error */
ModestTnySendQueuePrivate *priv;
SendInfo *info;
GList *item;
+ TnyHeader *msg_header;
priv = MODEST_TNY_SEND_QUEUE_GET_PRIVATE (self);
/* TODO: Use this version as soon as the msg-sending
* notification works */
-#if 0
- item = priv->current;
- g_assert(item != NULL);
- info = priv->current->data;
-#else
- /* TODO: Why do we get the msg and its header separately? The docs
- * don't really tell. */
- g_assert(header == tny_msg_get_header (msg)); // ????
- item = modest_tny_send_queue_lookup_info (MODEST_TNY_SEND_QUEUE (self), tny_header_get_message_id (header));
+/* #if 0 */
+/* item = priv->current; */
+/* g_assert(item != NULL); */
+/* info = priv->current->data; */
+/* #else */
+/* /\* TODO: Why do we get the msg and its header separately? The docs */
+/* * don't really tell. *\/ */
+/* g_assert(header == tny_msg_get_header (msg)); // ???? */
+ msg_header = tny_msg_get_header (msg);
+ item = modest_tny_send_queue_lookup_info (MODEST_TNY_SEND_QUEUE (self),
+ tny_header_get_message_id (msg_header));
+ g_object_unref (msg_header);
g_assert(item != NULL);
info = item->data;
-#endif
+/* #endif */
/* Keep in queue so that we remember that the opertion has failed
* and was not just cancelled */