make the folder's default account to be used when replying. (patch by wwp <subscript...
authorChristoph Hohmann <reboot@gmx.ch>
Sat, 27 Oct 2001 13:10:52 +0000 (13:10 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sat, 27 Oct 2001 13:10:52 +0000 (13:10 +0000)
ChangeLog.claws
configure.in
src/compose.c

index 23ebda853cd0ec3537c263e35bf2253066b70875..7e8dab46369be7e92fe76534b7d33a695fe81e07 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-27 [christoph] 0.6.4claws11
+
+       * src/compose.c
+               make the folder's default account to be used when
+               replying. (patch by wwp <subscript@free.fr>)
+
 2001-10-26 [alfons]
 
        * src/utils.h
index 0785f4f4a30d966825dcae0ebf39491417bf420a..95b9ed78ad62cc9a3d31f3ef406db1bfe59c2bc2 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws10
+EXTRA_VERSION=claws11
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 79c40867c227febba413a8730c878dd02d5d70cd..3cc2043477c57096e4dbc29b59c135a0c3a2f223 100644 (file)
@@ -603,25 +603,51 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
        PrefsAccount *account;
        PrefsAccount *reply_account;
        GtkSText *text;
+       GList *cur_ac;
+       GList *account_list;
+       PrefsAccount *ac_prefs;
 
        g_return_if_fail(msginfo != NULL);
        g_return_if_fail(msginfo->folder != NULL);
 
-       account = msginfo->folder->folder->account;
-       if (!account && msginfo->to && prefs_common.reply_account_autosel) {
-               gchar *to;
-               Xstrdup_a(to, msginfo->to, return);
-               extract_address(to);
-               account = account_find_from_address(to);
+       /* select the account set in folderitem's property (if enabled) */
+       account = NULL;
+       if (msginfo->folder->prefs && msginfo->folder->prefs->enable_default_account) {
+               if (!account) {
+                       /* get a PrefsAccount *pointer on the wished account */
+                       account_list = account_get_list();
+                       for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
+                               ac_prefs = (PrefsAccount *)cur_ac->data;
+                               if (ac_prefs->account_id == msginfo->folder->prefs->default_account) {
+                                       account = ac_prefs;
+                                       break;
+                               }
+                       }
+               }
        }
-        if(!account&& prefs_common.reply_account_autosel) {
-                       gchar cc[BUFFSIZE];
-               if(!get_header_from_msginfo(msginfo,cc,sizeof(cc),"CC:")){ /* Found a CC header */
-                       extract_address(cc);
-                       account = account_find_from_address(cc);
-                }        
+       
+       /* select the account for the whole folder (IMAP / NNTP) */
+       if (!account)
+               account = msginfo->folder->folder->account;
+
+       /* select account by to: and cc: header if enabled */
+       if (prefs_common.reply_account_autosel) {
+               if (!account && msginfo->to) {
+                       gchar *to;
+                       Xstrdup_a(to, msginfo->to, return);
+                       extract_address(to);
+                       account = account_find_from_address(to);
+               }
+               if (!account) {
+                       gchar cc[BUFFSIZE];
+                       if(!get_header_from_msginfo(msginfo, cc, sizeof(cc), "CC:")) { /* Found a CC header */
+                               extract_address(cc);
+                               account = account_find_from_address(cc);
+                       }        
+               }
        }
 
+       /* select current account */
        if (!account) account = cur_account;
        g_return_if_fail(account != NULL);
 
@@ -635,6 +661,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                        return;
        } else
                reply_account = account;
+
        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);