[Commits] [SCM] claws branch, master, updated. 3.9.3-79-g8b9a932

miras at claws-mail.org miras at claws-mail.org
Tue Apr 22 00:06:28 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  8b9a9329b104f4b3581fe1f18e7c4b644134be25 (commit)
      from  e31ec07076724b7674db10da03ff959312ff7129 (commit)


- Log -----------------------------------------------------------------
commit 8b9a9329b104f4b3581fe1f18e7c4b644134be25
Author: Michael Rasmussen <mir at datanom.net>
Date:   Tue Apr 22 00:02:29 2014 +0200

    Only show error popup first time an error is found.
    An error popup is shown if an error is found under init
    or first time an error found under scanning. Error popup
    is suppressed until restarting claws or a scanning is
    performed with success.

diff --git a/src/plugins/clamd/clamav_plugin.c b/src/plugins/clamd/clamav_plugin.c
index 4f184e3..87a8fb7 100644
--- a/src/plugins/clamd/clamav_plugin.c
+++ b/src/plugins/clamd/clamav_plugin.c
@@ -103,11 +103,17 @@ static gboolean scan_func(GNode *node, gpointer data)
 				switch (result->status) {
 					case NO_SOCKET: 
 						g_warning("[scanning] No socket information");
-						alertpanel_error(_("Scanning\nNo socket information.\nAntivirus disabled."));
+						if (config.alert_ack) {
+						    alertpanel_error(_("Scanning\nNo socket information.\nAntivirus disabled."));
+						    config.alert_ack = FALSE;
+						}
 						break;
 					case NO_CONNECTION:
 						g_warning("[scanning] Clamd does not respond to ping");
-						alertpanel_warning(_("Scanning\nClamd does not respond to ping.\nIs clamd running?"));
+						if (config.alert_ack) {
+						    alertpanel_warning(_("Scanning\nClamd does not respond to ping.\nIs clamd running?"));
+						    config.alert_ack = FALSE;
+						}
 						break;
 					case VIRUS: 
 						msg = g_strconcat(_("Detected %s virus."),
@@ -121,19 +127,27 @@ static gboolean scan_func(GNode *node, gpointer data)
 						    alertpanel_warning("%s\n", msg);
 						}
 						g_free(msg);
+						config.alert_ack = TRUE;
 						break;
 					case SCAN_ERROR:
 						debug_print("Error: %s\n", buf.msg);
-						alertpanel_error(_("Scanning error:\n%s"), buf.msg);
+						if (config.alert_ack) {
+						    alertpanel_error(_("Scanning error:\n%s"), buf.msg);
+						    config.alert_ack = FALSE;
+						}
 						break;
 					case OK:
 						debug_print("No virus detected.\n");
+						config.alert_ack = TRUE;
 						break;
 				}
 			}
 			else {
-				debug_print("File: %s. Size (%d) greater than limit (%d)\n",
-							outfile, (int) info.st_size, max);
+				msg = g_strconcat(_("File: %s. Size (%d) greater than limit (%d)\n"),
+					outfile, (int) info.st_size, max);
+				statusbar_print_all("%s", msg);
+				debug_print(msg);
+				g_free(msg);
 			}
 		}
 		g_unlink(outfile);
@@ -181,7 +195,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
 	}
 	
 	procmime_mimeinfo_free_all(mimeinfo);
-	
+
 	return (result.status == OK) ? FALSE : TRUE;
 }
 
@@ -272,6 +286,7 @@ gint plugin_init(gchar **error)
 
 	if (config.clamav_enable) {
 		debug_print("Creating socket\n");
+		config.alert_ack = TRUE;
 		Clamd_Stat status = clamd_prepare();
 		switch (status) {
 			case NO_SOCKET: 
diff --git a/src/plugins/clamd/clamav_plugin.h b/src/plugins/clamd/clamav_plugin.h
index e6530af..8b1c6e4 100644
--- a/src/plugins/clamd/clamav_plugin.h
+++ b/src/plugins/clamd/clamav_plugin.h
@@ -36,14 +36,15 @@ struct _ClamAvConfig
 	gchar		*clamav_save_folder;
 	gboolean	 clamd_config_type;
 	gchar		*clamd_host;
-	int			 clamd_port;
+	int		 clamd_port;
 	gchar		*clamd_config_folder;
+	gboolean	alert_ack;
 };
 
 ClamAvConfig *clamav_get_config		  (void);
 void	      clamav_save_config	  (void);
 void 	      clamav_set_message_callback (MessageCallback callback);
-Clamd_Stat	  clamd_prepare(void);
+Clamd_Stat    clamd_prepare(void);
 gint	      clamav_gtk_init(void);
 void 	      clamav_gtk_done(void);
 

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/clamd/clamav_plugin.c |   27 +++++++++++++++++++++------
 src/plugins/clamd/clamav_plugin.h |    5 +++--
 2 files changed, 24 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list