/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "tags.h"
#include "timing.h"
#include "inc.h"
+#include "privacy.h"
+
+extern SessionStats session_stats;
static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr,
FolderItem *queue, gint msgnum, gboolean *queued_removed);
{
gchar *file = folder_item_fetch_msg(queue, msginfo->msgnum);
PrefsAccount *ac = procmsg_get_account_from_file(file);
- GSList *cur = elem;
+ GSList *cur;
g_free(file);
for (cur = elem; cur; cur = cur->next) {
MsgInfo *cur_msginfo = (MsgInfo *)cur->data;
gboolean save_clear_text = TRUE;
gchar *tmp_enc_file = NULL;
- int local = 0;
-
cm_return_val_if_fail(file != NULL, -1);
if ((fp = g_fopen(file, "rb")) == NULL) {
} else if (mailac && mailac->use_mail_command &&
mailac->mail_command && (* mailac->mail_command)) {
mailval = send_message_local(mailac->mail_command, fp);
- local = 1;
} else {
if (!mailac) {
mailac = account_find_from_smtp_server(from, smtpserver);
fclose(fp);
+ /* update session statistics */
+ if (mailval == 0 && newsval == 0) {
+ /* update session stats */
+ if (replymessageid)
+ session_stats.replied++;
+ else if (fwdmessageid)
+ session_stats.forwarded++;
+ else
+ session_stats.sent++;
+ }
+
/* save message to outbox */
if (mailval == 0 && newsval == 0 && savecopyfolder) {
FolderItem *outbox;