#define PLUGIN_NAME (_("Bsfilter"))
-static guint hook_id = -1;
+static gulong hook_id = HOOK_NONE;
static MessageCallback message_callback;
static BsfilterConfig config;
gint plugin_init(gchar **error)
{
gchar *rcpath;
- hook_id = -1;
+ hook_id = HOOK_NONE;
if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
VERSION_NUMERIC, PLUGIN_NAME, error))
gboolean plugin_done(void)
{
- if (hook_id != (guint) -1) {
+ if (hook_id != HOOK_NONE) {
bsfilter_unregister_hook();
}
#ifdef USE_PTHREAD
void bsfilter_register_hook(void)
{
- if (hook_id == (guint) -1)
+ if (hook_id == HOOK_NONE)
hook_id = hooks_register_hook(MAIL_FILTERING_HOOKLIST, mail_filtering_hook, NULL);
- if (hook_id == (guint) -1) {
+ if (hook_id == HOOK_NONE) {
g_warning("Failed to register mail filtering hook");
config.process_emails = FALSE;
}
void bsfilter_unregister_hook(void)
{
- if (hook_id != (guint) -1) {
+ if (hook_id != HOOK_NONE) {
hooks_unregister_hook(MAIL_FILTERING_HOOKLIST, hook_id);
}
- hook_id = -1;
+ hook_id = HOOK_NONE;
}