2004-11-17 [paul] 0.9.12cvs155.1
authorPaul Mangan <paul@claws-mail.org>
Wed, 17 Nov 2004 13:48:31 +0000 (13:48 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 17 Nov 2004 13:48:31 +0000 (13:48 +0000)
* ChangeLog
* ChangeLog.claws
* ChangeLog.jp
* NEWS
* configure.ac
* src/compose.c
* src/jpilot.c
* src/privacy.c
* src/procmime.c
* src/procmime.h
* src/procmsg.c
* src/toolbar.c
* src/pixmaps/error.xpm
sync with HEAD

15 files changed:
ChangeLog
ChangeLog-gtk2.claws
ChangeLog.claws
ChangeLog.jp
NEWS
PATCHSETS
configure.ac
src/compose.c
src/jpilot.c
src/pixmaps/error.xpm
src/privacy.c
src/procmime.c
src/procmime.h
src/procmsg.c
src/toolbar.c

index 994e71c..aec4e3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2004-11-16
+
+       * version 1.0.0beta3
+
+2004-11-16
+
+       * src/pixmaps/error.xpm: made them smaller size to fit CList row.
+
+2004-11-16
+
+       * src/jpilot.c: applied the JPilot addressbook Japanese support
+         patch (thanks to IWAMOTO, Kouichi).
+
+2004-11-15
+
+       * src/compose.c
+         src/procmime.[ch]: use BASE64 encoding if the ratio of 8bit
+         characters in attaching text files is greater than 20%, otherwise
+         use quoted-printable (or 7bit if not at all).
+
+2004-11-12
+
+       * src/compose.c: compose_write_attach()
+         src/procmime.c: procmime_decode_content():
+         canonicalize text files before encoding to BASE64, and
+         uncanonicalize after decoding to conform with RFC 2045
+         (thanks to Nicolas Degory).
+
 2004-11-11
 
        * src/pixmaps/complete.xpm
index af961ba..562e7fe 100644 (file)
@@ -1,3 +1,20 @@
+2004-11-17 [paul]      0.9.12cvs155.1
+
+       * ChangeLog
+       * ChangeLog.claws
+       * ChangeLog.jp
+       * NEWS
+       * configure.ac
+       * src/compose.c
+       * src/jpilot.c
+       * src/privacy.c
+       * src/procmime.c
+       * src/procmime.h
+       * src/procmsg.c
+       * src/toolbar.c
+       * src/pixmaps/error.xpm
+               sync with HEAD
+
 2004-11-17 [colin]     0.9.12cvs151.1
 
        * src/plugins/pgpmime/pgpmime.c
index 683665a..294bc6c 100644 (file)
@@ -1,3 +1,62 @@
+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
+               Fix more pointer confusion
+
+2004-11-17 [paul]      0.9.12cvs153
+
+       * src/procmime.h
+               forgotten in sync with main 1.0.0beta3
+
+
+2004-11-17 [paul]      0.9.12cvs152
+
+       * ChangeLog
+       * ChangeLog.jp
+       * NEWS
+       * src/compose.c
+       * src/jpilot.c
+       * src/procmime.c
+               sync with main 1.0.0beta3
+               see ChangeLog 2004-11-15 and 2004-11-16
+
+2004-11-17 [colin]     0.9.12cvs151
+
+       * src/plugins/pgpmime/pgpmime.c
+               Remove debug printf
+
+2004-11-17 [colin]     0.9.12cvs150
+
+       * src/plugins/pgpmime/pgpmime.c
+               Fix off-by-one causing segs
+
+2004-11-17 [colin]     0.9.12cvs149
+
+       * src/procmsg.c
+               < Reboot_> don't compare pointers to NULL with !
+               So, use the other form to bring consistency.
+               Also fix coding style.
+
+2004-11-16 [colin]     0.9.12cvs148
+
+       * src/procmsg.c
+               Fix the fix :)
+
+2004-11-16 [colin]     0.9.12cvs147
+
+       * src/procmsg.c
+               Fix leaks in procmsg_send_message_queue
+
 2004-11-12 [paul]      0.9.12cvs146
 
        * src/prefs_account.c
index 8c9b05a..c8e1842 100644 (file)
@@ -1,3 +1,31 @@
+2004-11-16
+
+       * version 1.0.0beta3
+
+2004-11-16
+
+       * src/pixmaps/error.xpm: CList ¤Î¹Ô¤Ë¹ç¤¦¤è¤¦¤Ë¤è¤ê¾®¤µ¤Ê¥µ¥¤¥º¤Ë¤·¤¿¡£
+
+2004-11-16
+
+       * src/jpilot.c: JPilot ¥¢¥É¥ì¥¹Ä¢¤ÎÆüËܸìÂбþ¥Ñ¥Ã¥Á¤òŬÍÑ
+         (IWAMOTO, Kouichi ¤µ¤ó thanks)¡£
+
+2004-11-15
+
+       * src/compose.c
+         src/procmime.[ch]: ÅºÉÕ¤¹¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ëÃæ¤Î 8bit Ê¸»ú¤Î³ä¹ç¤¬
+         20% ¤è¤ê¹â¤±¤ì¤Ð BASE64 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò»ÈÍѤ·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð
+         quoted-printable ¤ò»ÈÍÑ(Á´¤¯¤Ê¤¤¾ì¹ç¤Ï 7bit)¡£
+
+2004-11-12
+
+       * src/compose.c: compose_write_attach()
+         src/procmime.c: procmime_decode_content():
+         ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò BASE64 ¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ëÁ°¤ËÀµµ¬²½¤·¡¢¥Ç¥³¡¼¥É
+         ¤·¤¿¸å¤ËÀµµ¬²½¤ò²ò½ü¤·¤Æ RFC 2045 ¤Ë½àµò¤¹¤ë¤è¤¦¤Ë¤·¤¿
+         (Nicolas Degory ¤µ¤ó thanks)¡£
+
 2004-11-11
 
        * src/pixmaps/complete.xpm
diff --git a/NEWS b/NEWS
index 3f0281f..f222b09 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,18 @@
 Changes of Sylpheed
 
-* 1.0beta2
+* 1.0.0beta3
+
+    * The Japanese JPilot address book has been supported.
+    * Back scrolling on Shift/Alt and Space key press has been enabled.
+    * Attached text files are now canonicalized before encoded to BASE64
+      to conform with RFC 2045.
+    * The optimal Content-Transfer-Encoding will be used when attaching
+      text files.
+    * The icons of the receive dialog have been modified.
+    * Mozilla Firefox has become a default web browser.
+    * The auto-expanding status bar has been fixed.
+
+* 1.0.0beta2
 
     * don't move or delete immediately at local filtering when immediate
       execution option is off.
@@ -10,7 +22,7 @@ Changes of Sylpheed
     * AND/OR matching option has been added to the summary search dialog.
     * APOP setting became a separate option for POP3.
 
-* 1.0beta1
+* 1.0.0beta1
 
     * Icons are added to the alert dialog and filter edit dialog.
     * Cc is added for the parameter of templates.
index e49edc0..477889d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.150.2.14 -r 1.150.2.15 src/procmsg.c; ) > 0.9.12cvs149.1.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/pgpmime/pgpmime.c; ) > 0.9.12cvs150.1.patchset
 ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/plugins/pgpmime/pgpmime.c; ) > 0.9.12cvs151.1.patchset
+( cvs diff -u -r 1.396.2.12 -r 1.396.2.13 ChangeLog; cvs diff -u -r 1.2504.2.32 -r 1.2504.2.33 ChangeLog.claws; cvs diff -u -r 1.391.2.12 -r 1.391.2.13 ChangeLog.jp; cvs diff -u -r 1.42.2.4 -r 1.42.2.5 NEWS; cvs diff -u -r 1.654.2.278 -r 1.654.2.279 configure.ac; cvs diff -u -r 1.382.2.67 -r 1.382.2.68 src/compose.c; cvs diff -u -r 1.18.2.4 -r 1.18.2.5 src/jpilot.c; cvs diff -u -r 1.10.2.2 -r 1.10.2.3 src/privacy.c; cvs diff -u -r 1.49.2.21 -r 1.49.2.22 src/procmime.c; cvs diff -u -r 1.17.2.7 -r 1.17.2.8 src/procmime.h; cvs diff -u -r 1.150.2.15 -r 1.150.2.16 src/procmsg.c; cvs diff -u -r 1.43.2.11 -r 1.43.2.12 src/toolbar.c; cvs diff -u -r 1.1 -r 1.2 src/pixmaps/error.xpm; ) > 0.9.12cvs155.1.patchset
index 90b9a40..34b8811 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=151
+EXTRA_VERSION=155
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=.1
 
index 83e9b0e..c847ea0 100644 (file)
@@ -2218,7 +2218,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                        MsgInfo *msginfo;
                        MsgFlags flags = {0, 0};
 
-                       if (procmime_get_encoding_for_file(file) == ENC_7BIT)
+                       if (procmime_get_encoding_for_text_file(file) == ENC_7BIT)
                                ainfo->encoding = ENC_7BIT;
                        else
                                ainfo->encoding = ENC_8BIT;
@@ -2234,8 +2234,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                        procmsg_msginfo_free(msginfo);
                } else {
                        if (!g_ascii_strncasecmp(content_type, "text", 4))
-                               ainfo->encoding =
-                                       procmime_get_encoding_for_file(file);
+                               ainfo->encoding = procmime_get_encoding_for_text_file(file);
                        else
                                ainfo->encoding = ENC_BASE64;
                        name = g_path_get_basename(filename ? filename : file);
@@ -2249,7 +2248,8 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                                g_strdup("application/octet-stream");
                        ainfo->encoding = ENC_BASE64;
                } else if (!g_ascii_strncasecmp(ainfo->content_type, "text", 4))
-                       ainfo->encoding = procmime_get_encoding_for_file(file);
+                       ainfo->encoding =
+                               procmime_get_encoding_for_text_file(file);
                else
                        ainfo->encoding = ENC_BASE64;
                name = g_path_get_basename(filename ? filename : file);
@@ -3320,7 +3320,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;
 
@@ -3852,7 +3861,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 4af2649..4ab882b 100644 (file)
@@ -51,6 +51,7 @@
 #include "addritem.h"
 #include "addrcache.h"
 #include "jpilot.h"
+#include "codeconv.h"
 #include "adbookbase.h"
 
 #define JPILOT_DBHOME_DIR   ".jpilot"
@@ -147,7 +148,14 @@ typedef struct {
        unsigned char attrib;
 } PC3RecordHeader;
 
-/**
+enum {
+       FAMILY_LAST = 0,
+       FAMILY_FIRST = 1
+} name_order;
+
+gboolean convert_charcode;
+
+/*
 * Create new pilot file object.
 * \return Initialized JPilot file object.
 */
@@ -1087,8 +1095,17 @@ static void jpilot_parse_label( JPilotFile *pilotFile, gchar *labelEntry, ItemPe
                strcpy( buffer, labelEntry );
                node = list = jpilot_parse_email( buffer );
                while( node ) {
+                       gchar convertBuff[JPILOT_LEN_LABEL];
                        email = addritem_create_item_email();
                        addritem_email_set_address( email, node->data );
+                       if (convert_charcode) {
+                               conv_sjistoeuc(convertBuff, JPILOT_LEN_LABEL, buffer);
+                               addritem_email_set_remarks(email, convertBuff);
+                       }
+                       else {
+                               addritem_email_set_remarks(email, buffer);
+                       }
+
                        addrcache_id_email( pilotFile->addressCache, email );
                        addrcache_person_add_email( pilotFile->addressCache, person, email );
                        node = g_list_next( node );
@@ -1120,6 +1137,8 @@ static void jpilot_load_address(
        GList *node;
        gchar* extID;
        struct AddressAppInfo *ai;
+       gchar **firstName = NULL;
+       gchar **lastName = NULL;
 
        /* Retrieve address */
        num = unpack_Address( & addr, buf->buf, buf->size );
@@ -1130,16 +1149,41 @@ static void jpilot_load_address(
                cat_id = attrib & 0x0F;
 
                *fullName = '\0';
+
                if( addrEnt[ IND_LABEL_FIRSTNAME ] ) {
-                       strcat( fullName, addrEnt[ IND_LABEL_FIRSTNAME ] );
+                       firstName = g_strsplit( addrEnt[ IND_LABEL_FIRSTNAME ], "\01", 2 );
                }
 
                if( addrEnt[ IND_LABEL_LASTNAME ] ) {
-                       strcat( fullName, " " );
-                       strcat( fullName, addrEnt[ IND_LABEL_LASTNAME ] );
+                       lastName = g_strsplit( addrEnt[ IND_LABEL_LASTNAME ], "\01", 2 );
+               }
+
+               if( name_order == FAMILY_LAST ) {
+                       g_snprintf( fullName, FULLNAME_BUFSIZE, "%s %s",
+                                   firstName ? firstName[0] : "",
+                                   lastName ? lastName[0] : "" );
+               }
+               else {
+                       g_snprintf( fullName, FULLNAME_BUFSIZE, "%s %s",
+                                   lastName ? lastName[0] : "",
+                                   firstName ? firstName[0] : "" );
+               }
+
+               if( firstName ) {
+                       g_strfreev( firstName );
+               }
+               if( lastName ) {
+                       g_strfreev( lastName );
+               }
+
+               g_strstrip( fullName );
+
+               if( convert_charcode ) {
+                       gchar *nameConv;
+                       nameConv = g_strdup( fullName );
+                       conv_sjistoeuc( fullName, FULLNAME_BUFSIZE, nameConv );
+                       g_free( nameConv );
                }
-               g_strchug( fullName );
-               g_strchomp( fullName );
 
                person = addritem_create_item_person();
                addritem_person_set_common_name( person, fullName );
@@ -1159,6 +1203,7 @@ static void jpilot_load_address(
                indPhoneLbl = addr.phoneLabel;
                for( k = 0; k < JPILOT_NUM_ADDR_PHONE; k++ ) {
                        gint ind;
+
                        ind = indPhoneLbl[k];
                        /*
                        * fprintf( stdout, "%d : %d : %20s : %s\n", k, ind,
@@ -1173,7 +1218,9 @@ static void jpilot_load_address(
                /* Add entry for each custom label */
                node = pilotFile->labelInd;
                while( node ) {
+                       gchar convertBuff[JPILOT_LEN_LABEL];
                        gint ind;
+
                        ind = GPOINTER_TO_INT( node->data );
                        if( ind > -1 ) {
                                /*
@@ -1298,6 +1345,13 @@ static gboolean jpilot_setup_labels( JPilotFile *pilotFile ) {
                        gint i;
                        for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
                                gchar *labelName = ai->labels[i];
+                               gchar convertBuff[ JPILOT_LEN_LABEL ];
+
+                               if( convert_charcode ) {
+                                       conv_sjistoeuc( convertBuff, JPILOT_LEN_LABEL, labelName );
+                                       labelName = convertBuff;
+                               }
+
                                if( g_utf8_collate( labelName, lbl ) == 0 ) {
                                        ind = i;
                                        break;
@@ -1327,9 +1381,14 @@ GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
                for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
                        gchar *labelName = ai->labels[i];
+                       gchar convertBuff[JPILOT_LEN_LABEL];
+
                        if( labelName ) {
-                               labelList = g_list_append(
-                                       labelList, g_strdup( labelName ) );
+                               if( convert_charcode ) {
+                                       conv_sjistoeuc( convertBuff, JPILOT_LEN_LABEL, labelName );
+                                       labelName = convertBuff;
+                               }
+                               labelList = g_list_append( labelList, g_strdup( labelName ) );
                        }
                        else {
                                labelList = g_list_append(
@@ -1402,6 +1461,7 @@ GList *jpilot_load_phone_label( JPilotFile *pilotFile, GList *labelList ) {
  */
 GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) {
        gint i;
+       char convertBuff[JPILOT_LEN_LABEL];
 
        g_return_val_if_fail( pilotFile != NULL, NULL );
 
@@ -1413,8 +1473,11 @@ GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) {
                                g_strchomp( labelName );
                                g_strchug( labelName );
                                if( *labelName != '\0' ) {
-                                       labelList = g_list_append( labelList,
-                                               g_strdup( labelName ) );
+                                       if( convert_charcode ) {
+                                               conv_sjistoeuc( convertBuff, JPILOT_LEN_LABEL, labelName );
+                                               labelName = convertBuff;
+                                       }
+                                       labelList = g_list_append( labelList, g_strdup( labelName ) );
                                }
                        }
                }
@@ -1462,7 +1525,16 @@ static void jpilot_build_category_list( JPilotFile *pilotFile ) {
 
        for( i = 0; i < JPILOT_NUM_CATEG; i++ ) {
                ItemFolder *folder = addritem_create_item_folder();
-               addritem_folder_set_name( folder, cat->name[i] );
+
+               if( convert_charcode ) {
+                       gchar catName[ JPILOT_LEN_CATEG ];
+                       conv_sjistoeuc( catName, JPILOT_LEN_CATEG, cat->name[i] );
+                       addritem_folder_set_name( folder, catName );
+               }
+               else {
+                       addritem_folder_set_name( folder, cat->name[i] );
+               }
+
                addrcache_id_folder( pilotFile->addressCache, folder );
                addrcache_add_folder( pilotFile->addressCache, folder );
        }
@@ -1575,6 +1647,21 @@ static gint jpilot_read_file( JPilotFile *pilotFile ) {
  *         successfully.
  */
 gint jpilot_read_data( JPilotFile *pilotFile ) {
+       const gchar *cur_locale;
+
+       name_order = FAMILY_LAST;
+       convert_charcode = FALSE;
+
+       cur_locale = conv_get_current_locale();
+
+       if( g_ascii_strncasecmp( cur_locale, "ja", 2 ) == 0 ) {
+               name_order = FAMILY_FIRST;
+       }
+
+       if( conv_get_current_charset() == C_EUC_JP ) {
+               convert_charcode = TRUE;
+       }
+
        g_return_val_if_fail( pilotFile != NULL, -1 );
 
        pilotFile->retVal = MGU_SUCCESS;
index b145e9d..e70ac53 100644 (file)
 /* XPM */
 static char * error_xpm[] = {
-"24 24 166 2",
-"      c None",
-".     c #010000",
-"+     c #080102",
-"@     c #0E0203",
-"#     c #110305",
-"$     c #140505",
-"%     c #150405",
-"&     c #130204",
-"*     c #020000",
-"=     c #030000",
-"-     c #B1A4A4",
-";     c #CEBBBC",
-">     c #DDCCCC",
-",     c #DDCCCD",
-"'     c #CBB6B7",
-")     c #B89A9B",
-"!     c #7D5E61",
-"~     c #210708",
-"{     c #270A0B",
-"]     c #A19999",
-"^     c #DED1D1",
-"/     c #F3E6E6",
-"(     c #EFE0E1",
-"_     c #EBDCDD",
-":     c #EADCDC",
-"<     c #E4D7D7",
-"[     c #E6D2D3",
-"}     c #E1C5C6",
-"|     c #AC7D7D",
-"1     c #654040",
-"2     c #2E0C0D",
-"3     c #050001",
-"4     c #DED1D2",
-"5     c #F4EBEB",
-"6     c #F1E6E6",
-"7     c #EBDFDF",
-"8     c #E4DBDA",
-"9     c #E5DBDB",
-"0     c #E2D3D3",
-"a     c #DDC3C4",
-"b     c #DBB3B6",
-"c     c #A06E6E",
-"d     c #310D0D",
-"e     c #A39596",
-"f     c #F5ECEC",
-"g     c #EEE4E4",
-"h     c #120808",
-"i     c #E4DADA",
-"j     c #E5DEDD",
-"k     c #0E0505",
-"l     c #CBB3B4",
-"m     c #D8B9BB",
-"n     c #B88B8C",
-"o     c #633E3F",
-"p     c #250A0A",
-"q     c #BFB2B3",
-"r     c #EADEDE",
-"s     c #190E0E",
-"t     c #0F0606",
-"u     c #130A0A",
-"v     c #E6DCDC",
-"w     c #0C0404",
-"x     c #0F0505",
-"y     c #130606",
-"z     c #C3A9A9",
-"A     c #CBA5A6",
-"B     c #A57577",
-"C     c #2C0B0D",
-"D     c #0D0303",
-"E     c #D1C3C4",
-"F     c #EDE1E0",
-"G     c #120909",
-"H     c #090303",
-"I     c #0B0303",
-"J     c #0D0404",
-"K     c #B9A7A7",
-"L     c #DEC6C7",
-"M     c #CCABAD",
-"N     c #B68B8F",
-"O     c #290A0C",
-"P     c #CCB9B9",
-"Q     c #ECE1E1",
-"R     c #E5DDDD",
-"S     c #DFD1D0",
-"T     c #DFCDCC",
-"U     c #CDB1B1",
-"V     c #CBA7A9",
-"W     c #B28487",
-"X     c #2B0A0C",
-"Y     c #1B0607",
-"Z     c #C9AFB0",
-"`     c #ECDFDF",
-" .    c #E6DEDF",
-"..    c #0F0405",
-"+.    c #120506",
-"@.    c #D0B4B6",
-"#.    c #CBAAAB",
-"$.    c #C09699",
-"%.    c #A17273",
-"&.    c #2A0B0C",
-"*.    c #1A0507",
-"=.    c #AD8C8D",
-"-.    c #D6C0C0",
-";.    c #E1D0D1",
-">.    c #0F0504",
-",.    c #100405",
-"'.    c #DECFCF",
-").    c #120505",
-"!.    c #180707",
-"~.    c #24090A",
-"{.    c #C69B9E",
-"].    c #B38083",
-"^.    c #905E5F",
-"/.    c #170405",
-"(.    c #957273",
-"_.    c #C6A3A5",
-":.    c #DAB9BA",
-"<.    c #DCC4C4",
-"[.    c #130505",
-"}.    c #DCC6C7",
-"|.    c #E0C9CA",
-"1.    c #CFB3B4",
-"2.    c #22080A",
-"3.    c #BA8D8F",
-"4.    c #BE8C8D",
-"5.    c #A16C6E",
-"6.    c #774748",
-"7.    c #220809",
-"8.    c #1D0607",
-"9.    c #B88D8F",
-"0.    c #C79FA0",
-"a.    c #D6B2B4",
-"b.    c #D8BEBF",
-"c.    c #CDACAF",
-"d.    c #D9BABC",
-"e.    c #CBA5A7",
-"f.    c #C6999A",
-"g.    c #BF8B8C",
-"h.    c #9F6A6B",
-"i.    c #804F50",
-"j.    c #1E0708",
-"k.    c #A17477",
-"l.    c #C29698",
-"m.    c #C69E9F",
-"n.    c #C69B9C",
-"o.    c #C59898",
-"p.    c #B27C7D",
-"q.    c #AB7475",
-"r.    c #8C5A5B",
-"s.    c #734849",
-"t.    c #210707",
-"u.    c #250909",
-"v.    c #9E7070",
-"w.    c #B98A8B",
-"x.    c #B88888",
-"y.    c #B37D7F",
-"z.    c #9F6767",
-"A.    c #824E4F",
-"B.    c #703F40",
-"C.    c #27090A",
-"D.    c #1B0507",
-"E.    c #1E0707",
-"F.    c #230909",
-"G.    c #280B0B",
-"H.    c #2C0B0C",
-"I.    c #2F0C0C",
-"                                                ",
-"                                                ",
-"                                                ",
-"                                                ",
-"                . + @ # $ % &                   ",
-"            * = - ; > , ' ) ! ~ {               ",
-"          = ] ^ / ( _ : < [ } | 1 2             ",
-"          3 4 5 6 7 8 8 9 0 a b c d             ",
-"        3 e f g 7 h 8 i j k l m n o p           ",
-"        + q 6 r s t u v w x y z A B C           ",
-"        D E F r 8 G H I J x K L M N O           ",
-"        $ P Q 8 R R I J J S T U V W X           ",
-"        Y Z `  . .J ....k +.@.#.$.%.&.          ",
-"        *.=.-.;...>.,.'.).!.~.{.].^.O           ",
-"        /.(._.:.<.[.}.|.1.2.3.4.5.6.7.          ",
-"          8.9.0.a.b.c.d.e.f.g.h.i.O             ",
-"          j.k.l.m.n.f.o.4.p.q.r.s.8.            ",
-"            t.u.v.w.x.y.z.A.B.C.D.              ",
-"                E.F.G.H.I.I.C.                  ",
-"                                                ",
-"                                                ",
-"                                                ",
-"                                                ",
-"                                                "};
+"10 10 32 1",
+"      c None",
+".     c #0B0402",
+"+     c #331516",
+"@     c #261B1C",
+"#     c #272120",
+"$     c #3C1D1D",
+"%     c #4B2727",
+"&     c #462F2F",
+"*     c #443A3B",
+"=     c #573435",
+"-     c #573E3E",
+";     c #524647",
+">     c #734647",
+",     c #805353",
+"'     c #786D6D",
+")     c #826F72",
+"!     c #A16A6D",
+"~     c #947273",
+"{     c #9B7376",
+"]     c #877D7D",
+"^     c #B07E7E",
+"/     c #A48887",
+"(     c #AF9291",
+"_     c #BB8D8F",
+":     c #AF9FA1",
+"<     c #C4A0A1",
+"[     c #C2A5A4",
+"}     c #C3B4B5",
+"|     c #D0B4B6",
+"1     c #D6B2B3",
+"2     c #E1D7D6",
+"3     c #EFE2E2",
+"  #*;;&+  ",
+" ;:222|~% ",
+"@:3}23:1,+",
+"*2}#]]@/_%",
+";23]..'|<=",
+"-22]..)1_=",
+"&[:@')+{!%",
+"+~1(|1{^>+",
+" ={__^!,% ",
+"  $===$+  "};
index 7220023..aeeb030 100644 (file)
@@ -322,11 +322,11 @@ gchar *privacy_get_encrypt_data(const gchar *id, GSList *recp_names)
 
        system = privacy_get_system(id);
        if (system == NULL)
-               return FALSE;
+               return NULL;
        if (!system->can_encrypt)
-               return FALSE;
+               return NULL;
        if (system->get_encrypt_data == NULL)
-               return FALSE;
+               return NULL;
 
        return system->get_encrypt_data(recp_names);
 }
index b9b49b8..8bdc279 100644 (file)
@@ -1000,31 +1000,52 @@ EncodingType procmime_get_encoding_for_charset(const gchar *charset)
                return ENC_8BIT;
 }
 
-EncodingType procmime_get_encoding_for_file(const gchar *file)
+EncodingType procmime_get_encoding_for_text_file(const gchar *file)
 {
        FILE *fp;
-       guchar buf[BUFSIZ];
+       guchar buf[BUFFSIZE];
        size_t len;
+       size_t octet_chars = 0;
+       size_t total_len = 0;
+       gfloat octet_percentage;
 
        if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return ENC_UNKNOWN;
        }
 
-       while ((len = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
+       while ((len = fread(buf, sizeof(guchar), sizeof(buf), fp)) > 0) {
                guchar *p;
                gint i;
 
-               for (p = buf, i = 0; i < len; p++, i++) {
-                       if (*p & 0x80) {
-                               fclose(fp);
-                               return ENC_BASE64;
-                       }
+               for (p = buf, i = 0; i < len; ++p, ++i) {
+                       if (*p & 0x80)
+                               ++octet_chars;
                }
+               total_len += len;
        }
 
        fclose(fp);
-       return ENC_7BIT;
+       
+       if (total_len > 0)
+               octet_percentage = (gfloat)octet_chars / (gfloat)total_len;
+       else
+               octet_percentage = 0.0;
+
+       debug_print("procmime_get_encoding_for_text_file(): "
+                   "8bit chars: %d / %d (%f%%)\n", octet_chars, total_len,
+                   100.0 * octet_percentage);
+
+       if (octet_percentage > 0.20) {
+               debug_print("using BASE64\n");
+               return ENC_BASE64;
+       } else if (octet_chars > 0) {
+               debug_print("using quoted-printable\n");
+               return ENC_QUOTED_PRINTABLE;
+       } else {
+               debug_print("using 7bit\n");
+               return ENC_7BIT;
+       }
 }
 
 struct EncodingTable 
index 5734d08..ec5da02 100644 (file)
@@ -204,7 +204,7 @@ gchar *procmime_get_mime_type               (const gchar    *filename);
 GList *procmime_get_mime_type_list     (void);
 
 EncodingType procmime_get_encoding_for_charset (const gchar    *charset);
-EncodingType procmime_get_encoding_for_file    (const gchar    *file);
+EncodingType procmime_get_encoding_for_text_file(const gchar   *file);
 const gchar *procmime_get_encoding_str         (EncodingType    encoding);
 MimeInfo *procmime_scan_file                   (const gchar    *filename);
 MimeInfo *procmime_scan_queue_file             (const gchar    *filename);
index e4f70dd..d437e31 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 bd811e7..045743d 100644 (file)
@@ -1873,7 +1873,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);
                }
        }