2004-09-02 [colin] 0.9.12cvs90
authorColin Leroy <colin@colino.net>
Thu, 2 Sep 2004 13:08:01 +0000 (13:08 +0000)
committerColin Leroy <colin@colino.net>
Thu, 2 Sep 2004 13:08:01 +0000 (13:08 +0000)
* src/account.c
Fix bug 582 (broken auto account selection)

ChangeLog.claws
PATCHSETS
configure.ac
src/account.c

index 522c3e6b4fdb74c60442b0169a37bdf429714f8c..089cdd1992caf71521913a101e6c787907ef1dda 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-02 [colin]     0.9.12cvs90
+
+       * src/account.c
+               Fix bug 582 (broken auto account selection)
+
 2004-09-02 [colin]     0.9.12cvs89
 
        * src/addrindex.c
index cda64f71ff7e622649ba83ff49e58b9abfb53ca5..5b98929db4f5cf039f7be5f54d7131b031828621 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -72,3 +72,4 @@
 ( cvs diff -u -r 1.6 -r 1.7 src/prefs_spelling.c; ) > 0.9.12cvs87.patchset
 ( cvs diff -u -r 1.8 -r 1.9 src/ldapquery.c; ) > 0.9.12cvs88.patchset
 ( cvs diff -u -r 1.34 -r 1.35 src/addrindex.c; ) > 0.9.12cvs89.patchset
+( cvs diff -u -r 1.70 -r 1.71 src/account.c; ) > 0.9.12cvs90.patchset
index 9b9dcd5c208ed313b4963a0d6cfdad1ceb5da15c..8cd033a7fc622b83c247d4d112acdfc68a418cb5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=89
+EXTRA_VERSION=90
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index e6fb4a03cfd9ce3e0eb681d92158d355962aa028..91ef861bc347ed17624aceaa7da20639defa1801 100644 (file)
@@ -1167,18 +1167,31 @@ PrefsAccount *account_get_reply_account(MsgInfo *msginfo, gboolean reply_autosel
        
        /* select account by to: and cc: header if enabled */
        if (reply_autosel) {
-               if (!account && msginfo->to) {
-                       gchar *to;
-                       Xstrdup_a(to, msginfo->to, return NULL);
-                       extract_address(to);
-                       account = account_find_from_address(to);
-               }
-               if (!account) {
-                       gchar cc[BUFFSIZE];
-                       if (!procheader_get_header_from_msginfo(msginfo, cc, sizeof(cc), "CC:")) { /* Found a CC header */
-                               extract_address(cc);
-                               account = account_find_from_address(cc);
-                       }        
+               gchar * field = NULL;
+               int fieldno = 0;
+               for (field = msginfo->to; fieldno++ < 2; field = msginfo->cc) {
+                       printf("search %s (%d)\n", field, fieldno);
+                       if (!account && field) {
+                               gchar *to = NULL;
+                               printf("finding from %s\n", field);
+                               if (!strchr(field, ',')) {
+                                       Xstrdup_a(to, field, return NULL);
+                                       extract_address(to);
+                                       account = account_find_from_address(to);
+                               } else {
+                                       gchar **split = g_strsplit(field, ",", -1);
+                                       int i = -1;
+                                       do {
+                                               i++;
+                                               if (!split[i])
+                                                       break;
+                                               Xstrdup_a(to, split[i], return NULL);
+                                               extract_address(to);
+                                               account = account_find_from_address(to);
+                                       } while (!account);
+                                       g_strfreev(split);
+                               }
+                       }
                }
        }