From 2f16f0202e677bd85e8362f450552b21966b317c Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 16 Mar 2005 06:53:58 +0000 Subject: ** See bug #73550 2005-03-14 Not Zed ** See bug #73550 * em-format-hook.c (emfh_format_format): if we are disabled, don't invoke handler, try to invoke old handler if there was one. svn path=/trunk/; revision=29032 --- mail/em-format-hook.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'mail/em-format-hook.c') diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c index 627def3aa2..62bab84957 100644 --- a/mail/em-format-hook.c +++ b/mail/em-format-hook.c @@ -69,11 +69,16 @@ static void emfh_format_format(EMFormat *md, struct _CamelStream *stream, struct _CamelMimePart *part, const EMFormatHandler *info) { struct _EMFormatHookItem *item = (EMFormatHookItem *)info; - EMFormatHookTarget target = { - md, stream, part, item - }; - e_plugin_invoke(item->hook->hook.plugin, item->format, &target); + if (item->hook->hook.plugin->enabled) { + EMFormatHookTarget target = { + md, stream, part, item + }; + + e_plugin_invoke(item->hook->hook.plugin, item->format, &target); + } else if (info->old) { + info->old->handler(md, stream, part, info->old); + } } static void @@ -180,6 +185,8 @@ emfh_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) for (;l;l=g_slist_next(l)) { EMFormatHookItem *item = l->data; /* TODO: only add handlers if enabled? */ + /* Well, disabling is handled by the callback, if we leave as is, + then we can enable the plugin after startup and it will start working automagically */ em_format_class_add_handler(klass, &item->handler); } } -- cgit v1.2.3