CVS: sylpheedclaws/sylpheed-claws/src/plugins/spamassassin spamassassin.c,1.18.2.44,1.18.2.45

[email protected] Fri, 15 Dec 2006 16:41:16 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/plugins/spamassassin
In directory sunsite.dk:/tmp/cvs-serv8976/src/plugins/spamassassin

Modified Files:
      Tag: gtk2
	spamassassin.c 
Log Message:
2006-12-15 [wwp]	2.6.1cvs40

	* src/wizard.c
	* src/common/plugin.c
	* src/common/plugin.h
	* src/gtk/about.c
	* src/plugins/bogofilter/bogofilter.c
	* src/plugins/clamav/clamav_plugin.c
	* src/plugins/demo/demo.c
	* src/plugins/dillo_viewer/dillo_viewer.c
	* src/plugins/pgpcore/plugin.c
	* src/plugins/pgpinline/plugin.c
	* src/plugins/pgpmime/plugin.c
	* src/plugins/spamassassin/spamassassin.c
	* src/plugins/trayicon/trayicon.c
		factorize some translatable strings (plugins-related),
		fix missing punctuation in several places,
		remove useless translatable \n in about.c,
		and factorize plugin init code w/ a new function
		check_plugin_version() in common/plugin.c.
		Patch by Fabien Vantard <[email protected]>. 

Index: spamassassin.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/plugins/spamassassin/spamassassin.c,v
retrieving revision 1.18.2.44
retrieving revision 1.18.2.45
diff -u -d -r1.18.2.44 -r1.18.2.45
--- spamassassin.c	2006/11/27 08:07:21	1.18.2.44
+++ spamassassin.c	2006/12/15 16:41:11	1.18.2.45
@@ -72,6 +72,8 @@
 #include <pwd.h>
 #endif
 
+#define PLUGIN_NAME (_("SpamAssassin"))
+
 enum {
     CHILD_RUNNING = 1 << 0,
     TIMEOUT_RUNNING = 1 << 1,
@@ -464,16 +466,10 @@
 	gchar *rcpath;
 
 	hook_id = -1;
-
-	if ((claws_get_version() > VERSION_NUMERIC)) {
-		*error = g_strdup(_("Your version of Claws Mail is newer than the version the SpamAssassin plugin was built with"));
-		return -1;
-	}
 
-	if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-		*error = g_strdup(_("Your version of Claws Mail is too old for the SpamAssassin plugin"));
+	if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+				VERSION_NUMERIC, PLUGIN_NAME, error))
 		return -1;
-	}
 
 	prefs_set_default(param);
 	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
@@ -520,7 +516,7 @@
 
 const gchar *plugin_name(void)
 {
-	return _("SpamAssassin");
+	return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)