2004-11-17 [colin] 0.9.12cvs155
authorColin Leroy <colin@colino.net>
Wed, 17 Nov 2004 13:26:22 +0000 (13:26 +0000)
committerColin Leroy <colin@colino.net>
Wed, 17 Nov 2004 13:26:22 +0000 (13:26 +0000)
* src/compose.c
* src/toolbar.c
Be verbose when sending fails
* src/procmsg.c
Fix procmsg_send_queue returning 0 when there's an error
Don't send messages to be encrypted to nobody

ChangeLog.claws
PATCHSETS
configure.ac
src/compose.c
src/procmsg.c
src/toolbar.c

index f850859..294bc6c 100644 (file)
@@ -1,3 +1,13 @@
+2004-11-17 [colin]     0.9.12cvs155
+
+       * src/compose.c
+       * src/toolbar.c
+               Be verbose when sending fails
+       * src/procmsg.c
+               Fix procmsg_send_queue returning 0 when there's an error
+               Don't send messages to be encrypted to nobody 
+
+
 2004-11-17 [colin]     0.9.12cvs154
 
        * src/privacy.c
index 133daf0..fddfa81 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.446 -r 1.447 ChangeLog; cvs diff -u -r 1.441 -r 1.442 ChangeLog.jp; cvs diff -u -r 1.51 -r 1.52 NEWS; cvs diff -u -r 1.454 -r 1.455 src/compose.c; cvs diff -u -r 1.20 -r 1.21 src/jpilot.c; cvs diff -u -r 1.92 -r 1.93 src/procmime.c; ) > 0.9.12cvs152.patchset
 ( cvs diff -u -r 1.33 -r 1.34 src/procmime.h; ) > 0.9.12cvs153.patchset
 ( cvs diff -u -r 1.11 -r 1.12 src/privacy.c; ) > 0.9.12cvs154.patchset
+( cvs diff -u -r 1.455 -r 1.456 src/compose.c; cvs diff -u -r 1.173 -r 1.174 src/procmsg.c; cvs diff -u -r 1.55 -r 1.56 src/toolbar.c; ) > 0.9.12cvs155.patchset
index 29a5fea..d9d3c18 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=154
+EXTRA_VERSION=155
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 1cd6e60..8e1a489 100644 (file)
@@ -3138,7 +3138,16 @@ gint compose_send(Compose *compose)
                folder_item_scan(folder);
                if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS)
                        gtk_widget_destroy(compose->window);
-       }
+       } else {
+               alertpanel_error(_("The message was queued but could not be "
+                                  "sent.\nUse \"Send queued messages\" from "
+                                  "the main window to retry."));
+               if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
+                       compose_allow_user_actions (compose, TRUE);
+                       compose->sending = FALSE;               
+               }
+               return -1;
+       }
 
        return 0;
 
@@ -3652,7 +3661,9 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                        gchar *encdata;
 
                        encdata = privacy_get_encrypt_data(compose->privacy_system, compose->to_list);
-                       fprintf(fp, "X-Sylpheed-Encrypt-Data:%s\n", encdata);
+                       if (encdata != NULL)
+                               fprintf(fp, "X-Sylpheed-Encrypt-Data:%s\n", 
+                                       encdata);
                        g_free(encdata);
                }
        }
index 8b00c36..f5c0e4f 100644 (file)
@@ -639,7 +639,7 @@ void procmsg_empty_all_trash(void)
  */
 gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
 {
-       gint ret = 1, count = 0;
+       gint sent = 0, err = 0;
        GSList *list, *elem;
 
        if (!queue)
@@ -660,7 +660,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                                if (procmsg_send_message_queue(file) < 0) {
                                        g_warning("Sending queued message %d failed.\n", 
                                                  msginfo->msgnum);
-                                       ret = -1;
+                                       err++;
                                } else {
                                        /* CLAWS: 
                                         * We save in procmsg_send_message_queue because
@@ -672,7 +672,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                                                        (queue->folder->outbox,
                                                         file, TRUE);
                                         */
-                                       count++; 
+                                       sent++; 
                                        folder_item_remove_msg(queue, msginfo->msgnum);
                                }
                                g_free(file);
@@ -684,7 +684,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                procmsg_msginfo_free(msginfo);
        }
 
-       return ret * count;
+       return (err != 0 ? -err : sent);
 }
 
 gint procmsg_remove_special_headers(const gchar *in, const gchar *out)
index 0365e05..576d636 100644 (file)
@@ -1872,7 +1872,10 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                Folder *folder = list->data;
 
                if (folder->queue) {
-                       procmsg_send_queue(folder->queue, prefs_common.savemsg);
+                       if (procmsg_send_queue(folder->queue, 
+                                              prefs_common.savemsg) < 0)
+                               alertpanel_error(_("Some errors occurred while "
+                                                  "sending queued messages."));
                        folder_item_scan(folder->queue);
                }
        }