aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-format-hook.c15
2 files changed, 18 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f5ac325af0..fe454129dd 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-14 Not Zed <NotZed@Ximian.com>
+
+ ** 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.
+
2005-03-10 Not Zed <NotZed@Ximian.com>
** See bug #73293
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);
}
}