aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-30 06:44:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-30 06:44:20 +0000
commita86fc629f6c05556bfc17c62fc3d4f9b487bb6c5 (patch)
treee09fb59e9be44ad8dea83755a0d8096e59628df1
parent7fc7273c9b1659347e4e6eb8c3c0a2aa408ed318 (diff)
fixed a bug that automatic account selection was disabled on IMAP4 folders.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@942 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.ja6
-rw-r--r--libsylph/account.c15
-rw-r--r--libsylph/account.h3
-rw-r--r--src/compose.c7
5 files changed, 32 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0209fdfd..63c06143 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-01-30
+ * libsylph/account.[ch]
+ src/compose.c: compose_reply(): fixed a bug that automatic account
+ selection was disabled on IMAP4 folders.
+
+2006-01-30
+
* libsylph/socket.[ch]: code cleanup.
2006-01-28
diff --git a/ChangeLog.ja b/ChangeLog.ja
index eb7c0915..bebf3766 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,11 @@
2006-01-30
+ * libsylph/account.[ch]
+ src/compose.c: compose_reply(): 自動アカウント選択が IMAP4 フォルダ
+ で無効になっていたバグを修正。
+
+2006-01-30
+
* libsylph/socket.[ch]: コードの整理。
2006-01-28
diff --git a/libsylph/account.c b/libsylph/account.c
index 514825dd..6b0dd17f 100644
--- a/libsylph/account.c
+++ b/libsylph/account.c
@@ -167,6 +167,19 @@ PrefsAccount *account_find_from_item(FolderItem *item)
g_return_val_if_fail(item != NULL, NULL);
+ ac = account_find_from_item_property(item);
+ if (!ac)
+ ac = item->folder->account;
+
+ return ac;
+}
+
+PrefsAccount *account_find_from_item_property(FolderItem *item)
+{
+ PrefsAccount *ac;
+
+ g_return_val_if_fail(item != NULL, NULL);
+
ac = item->account;
if (!ac) {
FolderItem *cur_item = item->parent;
@@ -178,8 +191,6 @@ PrefsAccount *account_find_from_item(FolderItem *item)
cur_item = cur_item->parent;
}
}
- if (!ac)
- ac = item->folder->account;
return ac;
}
diff --git a/libsylph/account.h b/libsylph/account.h
index 395f07a7..3a6af365 100644
--- a/libsylph/account.h
+++ b/libsylph/account.h
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,7 @@ PrefsAccount *account_find_from_smtp_server (const gchar *address,
PrefsAccount *account_find_from_address (const gchar *address);
PrefsAccount *account_find_from_id (gint id);
PrefsAccount *account_find_from_item (FolderItem *item);
+PrefsAccount *account_find_from_item_property (FolderItem *item);
PrefsAccount *account_find_from_message_file (const gchar *file);
PrefsAccount *account_find_from_msginfo (MsgInfo *msginfo);
diff --git a/src/compose.c b/src/compose.c
index d7ca382e..78926322 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -761,14 +761,17 @@ void compose_reply(MsgInfo *msginfo, FolderItem *item, ComposeMode mode,
if (COMPOSE_QUOTE_MODE(mode) == COMPOSE_WITH_QUOTE)
quote = TRUE;
- account = account_find_from_item(msginfo->folder);
+ account = account_find_from_item_property(msginfo->folder);
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);
}
- if (!account) account = cur_account;
+ if (!account && msginfo->folder->folder)
+ account = msginfo->folder->folder->account;
+ if (!account)
+ account = cur_account;
g_return_if_fail(account != NULL);
MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);