Beispiel #1
0
gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
{
	gint new_msgs;

	if (inc_lock_count) return 0;

	if (account->receive_in_progress) return 0;

	if (prefs_common.work_offline && 
	    !inc_offline_should_override(TRUE,
		_("Claws Mail needs network access in order "
		  "to get mails.")))
		return 0;

	inc_autocheck_timer_remove();
	main_window_lock(mainwin);

	new_msgs = inc_account_mail_real(mainwin, account);

	inc_update_stats(new_msgs);
	inc_finished(mainwin, new_msgs > 0, FALSE);
	main_window_unlock(mainwin);
	inc_autocheck_timer_set();

	return new_msgs;
}
Beispiel #2
0
void inc_mail(MainWindow *mainwin, gboolean notify)
{
	gint new_msgs = 0;
	gint account_new_msgs = 0;

	if (inc_lock_count) return;

	if (prefs_common.work_offline && 
	    !inc_offline_should_override(TRUE,
		_("Claws Mail needs network access in order "
		  "to get mails.")))
		return;

	inc_lock();
	inc_autocheck_timer_remove();
	main_window_lock(mainwin);

	if (prefs_common.use_extinc && prefs_common.extinc_cmd) {
		/* external incorporating program */
		if (execute_command_line(prefs_common.extinc_cmd, FALSE) < 0) {
			main_window_unlock(mainwin);
			inc_autocheck_timer_set();
			inc_unlock();
			return;
		}
	} else {
		account_new_msgs = inc_account_mail_real(mainwin, cur_account);
		if (account_new_msgs > 0)
			new_msgs += account_new_msgs;
	}

	inc_update_stats(new_msgs);
	inc_finished(mainwin, new_msgs > 0, FALSE);
	main_window_unlock(mainwin);
 	inc_notify_cmd(new_msgs, notify);
	inc_autocheck_timer_set();
	inc_unlock();
}