sync with 0.9.0cvs3
authorPaul Mangan <paul@claws-mail.org>
Tue, 20 May 2003 10:02:32 +0000 (10:02 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 20 May 2003 10:02:32 +0000 (10:02 +0000)
configure.ac
src/codeconv.c
src/common/smtp.c
src/common/stringtable.c
src/compose.c
src/procmsg.c

index d106573600b3c4471ee46f52b5b6110df464c96c..625126e4b6fd5f0b6ceb174064a175576f7f4548 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws167
+EXTRA_VERSION=claws168
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 01bcf6fe52706d59ebc0a3e39d132b8d7d649d37..0357f2a1e935006c17016c2c952244f933bc4ebd 100644 (file)
@@ -382,10 +382,10 @@ static gboolean isprintableeuckanji(guchar c1, guchar c2)
                return (gboolean)valid_eucjp_tbl[c1 - 0xa2][c2 - 0xa0];
 
        if (c1 == 0xcf) {
-               if (c2 >= 0xd4 && c2 <= 0xff)
+               if (c2 >= 0xd4 && c2 <= 0xfe)
                        return FALSE;
        } else if (c1 == 0xf4) {
-               if (c2 >= 0xa7 && c2 <= 0xff)
+               if (c2 >= 0xa7 && c2 <= 0xfe)
                        return FALSE;
        }
 
index f1d627d4835c3a2581eafdabb87ac333ae608602..d87486c56d72f207fc7ad06a40d80d3c47dc89fd 100644 (file)
@@ -48,7 +48,7 @@ static gint smtp_helo(SMTPSession *session);
 static gint smtp_rcpt(SMTPSession *session);
 static gint smtp_data(SMTPSession *session);
 static gint smtp_send_data(SMTPSession *session);
-static gint smtp_rset(SMTPSession *session);
+/* static gint smtp_rset(SMTPSession *session); */
 static gint smtp_quit(SMTPSession *session);
 static gint smtp_eom(SMTPSession *session);
 
@@ -378,6 +378,7 @@ static gint smtp_send_data(SMTPSession *session)
        return SM_OK;
 }
 
+#if 0
 static gint smtp_rset(SMTPSession *session)
 {
        session->state = SMTP_RSET;
@@ -387,6 +388,7 @@ static gint smtp_rset(SMTPSession *session)
 
        return SM_OK;
 }
+#endif
 
 static gint smtp_quit(SMTPSession *session)
 {
index b584ff676c8250f34bd7c5f83e249c869a6c6664..6f2f743c9851aa4e0c8a60745de4578fb5b4c838 100644 (file)
@@ -49,6 +49,14 @@ static StringEntry *string_entry_new(const gchar *str)
        return entry;
 }
 
+static void string_entry_free(StringEntry *entry)
+{
+       g_return_if_fail(entry != NULL);
+
+       g_free(entry->string);
+       g_free(entry);
+}
+
 StringTable *string_table_new(void)
 {
        StringTable *strtable;
@@ -102,8 +110,7 @@ void string_table_free_string(StringTable *table, gchar *str)
                if (entry->ref_count <= 0) {
                        XXX_DEBUG ("refcount of string %s dropped to zero\n", entry->string);
                        g_hash_table_remove(table->hash_table, str);
-                       g_free(entry->string);
-                       g_free(entry);
+                       string_entry_free(entry);
                } else {
                        XXX_DEBUG ("ref-- for %s (%d)\n", entry->string, entry->ref_count); 
                }
@@ -116,8 +123,7 @@ static gboolean string_table_remove_for_each_fn(gchar *key, StringEntry *entry,
        g_return_val_if_fail(key != NULL, TRUE);
        g_return_val_if_fail(entry != NULL, TRUE);
 
-       g_free(entry->string);
-       g_free(entry);
+       string_entry_free(entry);
 
        return TRUE;
 }
index da9b4dabcaeb3a8dac50b8fe3515a3232dd97116..f4cf38606fffcffc7fb9c42cb8a4ccf5f6dfbf87 100644 (file)
@@ -1901,23 +1901,16 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
        gtk_stext_freeze(text);
 
        if (replace && compose->sig_str) {
-               gchar *tmp;
                gint pos;
                gint len;
 
-               if (compose->account->sig_sep)
-                       tmp = g_strconcat(compose->account->sig_sep, "\n",
-                                         compose->sig_str, NULL);
-               else
-                       tmp = g_strdup(compose->sig_str);
-
-               if (tmp[0] == '\0')
+               if (compose->sig_str[0] == '\0')
                        pos = -1;
                else
-                       pos = gtkut_stext_find(text, 0, tmp, TRUE);
+                       pos = gtkut_stext_find(text, 0, compose->sig_str, TRUE);
 
                if (pos != -1) {
-                       len = get_mbs_len(tmp);
+                       len = get_mbs_len(compose->sig_str);
                        if (len >= 0) {
                                gtk_stext_set_point(text, pos);
                                gtk_stext_forward_delete(text, len);
@@ -1929,17 +1922,9 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
                        len = gtk_stext_get_length(text);
                        gtk_stext_set_point(text, len);
                }
-
-               g_free(tmp);
        } else
                gtk_stext_insert(text, NULL, NULL, NULL, "\n\n", 2);
 
-       if (compose->account->sig_sep) {
-               gtk_stext_insert(text, NULL, NULL, NULL, 
-                                compose->account->sig_sep, -1);
-               gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
-       }
-
        g_free(compose->sig_str);
        compose->sig_str = compose_get_signature_str(compose);
        if (!compose->sig_str)
@@ -1958,43 +1943,41 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
 
 static gchar *compose_get_signature_str(Compose *compose)
 {
-       static gchar *default_sigfile;
-       gchar *sig_file = NULL;
+       gchar *sig_body = NULL;
        gchar *sig_str = NULL;
 
        g_return_val_if_fail(compose->account != NULL, NULL);
 
-       if (compose->account->sig_type == SIG_FILE) {
-               if (compose->account->sig_path)
-                       sig_file = compose->account->sig_path;
-               else {
-                       if (!default_sigfile)
-                               default_sigfile = g_strconcat
-                                       (get_home_dir(), G_DIR_SEPARATOR_S,
-                                        DEFAULT_SIGNATURE, NULL);
-                       sig_file = default_sigfile;
-               }
+       if (!compose->account->sig_path)
+               return NULL;
 
-               if (!is_file_or_fifo_exist(sig_file)) {
-                       g_warning("can't open signature file: %s\n", sig_file);
+       if (compose->account->sig_type == SIG_FILE) {
+               if (!is_file_or_fifo_exist(compose->account->sig_path)) {
+                       g_warning("can't open signature file: %s\n",
+                                 compose->account->sig_path);
                        return NULL;
                }
        }
 
-       if (compose->account->sig_type == SIG_COMMAND) {
-               if (compose->account->sig_path)
-                       sig_str = get_command_output
-                               (compose->account->sig_path);
-       } else {
+       if (compose->account->sig_type == SIG_COMMAND)
+               sig_body = get_command_output(compose->account->sig_path);
+       else {
                gchar *tmp;
 
-               tmp = file_read_to_str(sig_file);
+               tmp = file_read_to_str(compose->account->sig_path);
                if (!tmp)
                        return NULL;
-               sig_str = normalize_newlines(tmp);
+               sig_body = normalize_newlines(tmp);
                g_free(tmp);
        }
 
+       if (compose->account->sig_sep) {
+               sig_str = g_strconcat(compose->account->sig_sep, "\n", sig_body,
+                                     NULL);
+               g_free(sig_body);
+       } else
+               sig_str = sig_body;
+
        return sig_str;
 }
 
@@ -2896,7 +2879,7 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
        activate_gnupg_mode(compose, account);          
 #endif /* USE_GPGME */
 
-       if (!init && account->auto_sig)
+       if (!init)
                compose_insert_sig(compose, TRUE);
 }
 
index 4515dfa681570d72b75190058b3291c64b9801cc..56c3c4df9b9fd458522677bfaf9e1d8d03cd820e 100644 (file)
 #include "hooks.h"
 #include "msgcache.h"
 
-typedef struct _FlagInfo       FlagInfo;
-
-struct _FlagInfo
-{
-       guint    msgnum;
-       MsgFlags flags;
-};
-
 GHashTable *procmsg_msg_hash_table_create(GSList *mlist)
 {
        GHashTable *msg_table;