From 68b391b5c17420988118f2152d90832472bbfc0b Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 8 Jun 2011 02:20:00 +0000 Subject: added a new plug-in API: 'compose-send'. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2886 ee746299-78ed-0310-b773-934348b2243d --- src/compose.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/compose.c') diff --git a/src/compose.c b/src/compose.c index 79e2fd91..32858e15 100644 --- a/src/compose.c +++ b/src/compose.c @@ -3444,6 +3444,7 @@ static gint compose_send(Compose *compose) { gchar tmp[MAXPATHLEN + 1]; gint ok = 0; + gboolean ack = TRUE; if (compose->lock_count > 0) return 1; @@ -3488,6 +3489,14 @@ static gint compose_send(Compose *compose) if (!compose->to_list && !compose->newsgroup_list) { g_warning(_("can't get recipient list.")); + g_unlink(tmp); + compose_unlock(compose); + return 1; + } + + syl_plugin_signal_emit("compose-send", compose, compose->mode, 0, + tmp, compose->to_list, &ack); + if (ack == FALSE) { g_unlink(tmp); compose_unlock(compose); return -1; @@ -7204,6 +7213,7 @@ static void compose_send_later_cb(gpointer data, guint action, Compose *compose = (Compose *)data; FolderItem *queue; gchar tmp[MAXPATHLEN + 1]; + gboolean ack = TRUE; if (compose_check_entries(compose) == FALSE) return; @@ -7236,8 +7246,22 @@ static void compose_send_later_cb(gpointer data, guint action, } } + if (!compose->to_list && !compose->newsgroup_list) { + g_warning("can't get recipient list."); + g_unlink(tmp); + return; + } + + syl_plugin_signal_emit("compose-send", compose, compose->mode, 1, + tmp, compose->to_list, &ack); + if (ack == FALSE) { + g_unlink(tmp); + return; + } + if (compose_queue(compose, tmp) < 0) { alertpanel_error(_("Can't queue the message.")); + g_unlink(tmp); return; } -- cgit v1.2.3