[Commits] [SCM] claws branch, master, updated. 3.11.1-235-g7e1943d

charles at claws-mail.org charles at claws-mail.org
Fri Jul 17 17:23:00 CEST 2015


The branch, master has been updated
       via  7e1943d6b833a3de6771aa9076882b73c81356f3 (commit)
       via  cf7df0a057eb09b41a690a671920392ea7d16999 (commit)
       via  cc334ab9de45bf989e29e01921670c85b0e537ae (commit)
       via  c00d3332dd0783737b21a10702429515ac81b738 (commit)
      from  a4e905df972a306ed6aae3ecce8993ebba9b3eab (commit)

Summary of changes:
 src/plugins/managesieve/managesieve.c   |   39 ++++++++++++++++++++++++-------
 src/plugins/managesieve/managesieve.h   |    1 +
 src/plugins/managesieve/sieve_manager.c |   10 ++++----
 3 files changed, 37 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 7e1943d6b833a3de6771aa9076882b73c81356f3
Author: Charles Lehner <cel at celehner.com>
Date:   Fri Jul 17 10:49:15 2015 -0400

    managesieve: Localize Rename button. Fix bug 3469
    
    not breaking string freeze because the string is already translated and in use

diff --git a/src/plugins/managesieve/sieve_manager.c b/src/plugins/managesieve/sieve_manager.c
index 56e8e09..bae6afd 100644
--- a/src/plugins/managesieve/sieve_manager.c
+++ b/src/plugins/managesieve/sieve_manager.c
@@ -744,7 +744,7 @@ static SieveManagerPage *sieve_manager_page_new()
 			G_CALLBACK (filter_delete), page);
 
 	/* rename */
-	btn = gtk_button_new_with_label("Rename");
+	btn = gtk_button_new_with_label(_("Rename"));
 	gtk_box_pack_start (GTK_BOX (vbox_buttons), btn, FALSE, FALSE, 0);
 	g_signal_connect (G_OBJECT(btn), "clicked",
 			G_CALLBACK (filter_rename), page);

commit cf7df0a057eb09b41a690a671920392ea7d16999
Author: Charles Lehner <cel at celehner.com>
Date:   Fri Jul 17 10:21:06 2015 -0400

    managesieve: add back dialog hint
    
    This makes the manager window appear floating in tiling window managers
    
    This reverts commit e2d116a25f8aa0105c1319b7669af7e9723eff16.

diff --git a/src/plugins/managesieve/sieve_manager.c b/src/plugins/managesieve/sieve_manager.c
index ba19e41..56e8e09 100644
--- a/src/plugins/managesieve/sieve_manager.c
+++ b/src/plugins/managesieve/sieve_manager.c
@@ -657,6 +657,8 @@ static SieveManagerPage *sieve_manager_page_new()
 				      GDK_HINT_MIN_SIZE);
 	gtk_widget_set_size_request(window, sieve_config.manager_win_width,
 			sieve_config.manager_win_height);
+	gtk_window_set_type_hint(GTK_WINDOW(window),
+			GDK_WINDOW_TYPE_HINT_DIALOG);
 
 	vbox = gtk_vbox_new (FALSE, 10);
 	gtk_container_add (GTK_CONTAINER (window), vbox);

commit cc334ab9de45bf989e29e01921670c85b0e537ae
Author: Charles Lehner <cel at celehner.com>
Date:   Fri Jul 17 10:07:44 2015 -0400

    managesieve: show warnings received when setting active script

diff --git a/src/plugins/managesieve/managesieve.c b/src/plugins/managesieve/managesieve.c
index 05b4014..3fd4079 100644
--- a/src/plugins/managesieve/managesieve.c
+++ b/src/plugins/managesieve/managesieve.c
@@ -673,15 +673,35 @@ static gint sieve_session_recv_msg(Session *session, const gchar *msg)
 		sieve_session->state = SIEVE_READY;
 		break;
 	case SIEVE_SETACTIVE:
-		if (response_is_no(msg)) {
-			/* error */
+		parse_response((gchar *)msg, &result);
+		if (result.success) {
+			/* clear status possibly set when setting another
+			 * script active. TODO: give textual feedback */
+			sieve_error(sieve_session, "");
+
 			command_cb(sieve_session->current_cmd, NULL);
-		} else if (response_is_ok(msg)) {
-			command_cb(sieve_session->current_cmd, (void*)TRUE);
+		} else if (result.description) {
+			command_cb(sieve_session->current_cmd,
+					result.description);
 		} else {
 			log_warning(LOG_PROTOCOL, _("error occurred on SIEVE session\n"));
 		}
-		sieve_session->state = SIEVE_READY;
+		if (result.has_octets) {
+			sieve_session->octets_remaining = result.octets;
+			sieve_session->state = SIEVE_SETACTIVE_DATA;
+		} else {
+			sieve_session->state = SIEVE_READY;
+		}
+		break;
+	case SIEVE_SETACTIVE_DATA:
+		/* Dovecot shows a script's warnings when making it active */
+		sieve_session->octets_remaining -= strlen(msg) + 1;
+		if (sieve_session->octets_remaining > 0) {
+			/* TODO: buffer multi-line message */
+			sieve_error(sieve_session, msg);
+		} else {
+			sieve_session->state = SIEVE_READY;
+		}
 		break;
 	case SIEVE_GETSCRIPT:
 		if (response_is_no(msg)) {
diff --git a/src/plugins/managesieve/managesieve.h b/src/plugins/managesieve/managesieve.h
index 908ffa4..f5c5fbb 100644
--- a/src/plugins/managesieve/managesieve.h
+++ b/src/plugins/managesieve/managesieve.h
@@ -71,6 +71,7 @@ typedef enum
 	SIEVE_AUTH_CRAM_MD5,
 	SIEVE_RENAMESCRIPT,
 	SIEVE_SETACTIVE,
+	SIEVE_SETACTIVE_DATA,
 	SIEVE_GETSCRIPT,
 	SIEVE_GETSCRIPT_DATA,
 	SIEVE_PUTSCRIPT,
diff --git a/src/plugins/managesieve/sieve_manager.c b/src/plugins/managesieve/sieve_manager.c
index 8a786e0..ba19e41 100644
--- a/src/plugins/managesieve/sieve_manager.c
+++ b/src/plugins/managesieve/sieve_manager.c
@@ -245,14 +245,14 @@ static void filter_rename(GtkWidget *widget, SieveManagerPage *page)
 }
 
 static void filter_activated(SieveSession *session, gboolean abort,
-		gboolean success, CommandDataName *cmd_data)
+		const gchar *err, CommandDataName *cmd_data)
 {
 	SieveManagerPage *page = cmd_data->page;
 	GSList *cur;
 
 	if (abort) {
-	} else if (!success) {
-		got_session_error(session, "Unable to set active script", page);
+	} else if (err) {
+		got_session_error(session, err, page);
 	} else {
 		manager_sessions_foreach(cur, session, page) {
 			filter_set_active(page, cmd_data->filter_name);

commit c00d3332dd0783737b21a10702429515ac81b738
Author: Charles Lehner <cel at celehner.com>
Date:   Fri Jul 17 09:24:11 2015 -0400

    managesieve: handle putting/checking empty scripts

diff --git a/src/plugins/managesieve/managesieve.c b/src/plugins/managesieve/managesieve.c
index 773fa7a..05b4014 100644
--- a/src/plugins/managesieve/managesieve.c
+++ b/src/plugins/managesieve/managesieve.c
@@ -1016,8 +1016,9 @@ void sieve_session_put_script(SieveSession *session, const gchar *filter_name,
 		sieve_session_data_cb_fn cb, gpointer data)
 {
 	/* TODO: refactor so don't have to copy the whole script here */
-	gchar *msg = g_strdup_printf("PUTSCRIPT \"%s\" {%u+}\r\n%s",
-			filter_name, len, script_contents);
+	gchar *msg = g_strdup_printf("PUTSCRIPT \"%s\" {%u+}%s%s",
+			filter_name, len, len > 0 ? "\r\n" : "",
+			script_contents);
 
 	sieve_queue_send(session, SIEVE_PUTSCRIPT, msg, cb, data);
 }
@@ -1026,8 +1027,8 @@ void sieve_session_check_script(SieveSession *session,
 		gint len, const gchar *script_contents,
 		sieve_session_data_cb_fn cb, gpointer data)
 {
-	gchar *msg = g_strdup_printf("CHECKSCRIPT {%u+}\r\n%s",
-			len, script_contents);
+	gchar *msg = g_strdup_printf("CHECKSCRIPT {%u+}%s%s",
+			len, len > 0 ? "\r\n" : "", script_contents);
 
 	sieve_queue_send(session, SIEVE_PUTSCRIPT, msg, cb, data);
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list