[evolution/gnome-3-28] Try also with the From address when looking up correct From account for composer
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-28] Try also with the From address when looking up correct From account for composer
- Date: Wed, 27 Jun 2018 07:40:20 +0000 (UTC)
commit 44f16f079235edec3da8d2bf97def6637457d505
Author: Milan Crha <mcrha redhat com>
Date: Wed Jun 27 09:38:49 2018 +0200
Try also with the From address when looking up correct From account for composer
This can be useful for Sent and Outbox folders, when the account
cannot be guessed from the To/CC recipients.
src/libemail-engine/e-mail-utils.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/src/libemail-engine/e-mail-utils.c b/src/libemail-engine/e-mail-utils.c
index 84de797c89..9b43130475 100644
--- a/src/libemail-engine/e-mail-utils.c
+++ b/src/libemail-engine/e-mail-utils.c
@@ -651,6 +651,27 @@ second_preference:
}
}
+ /* Third Preference: Try with the From address (like in Outbox/Sent folders) */
+ if (!source && message) {
+ CamelInternetAddress *from;
+ const gchar *email = NULL;
+
+ from = camel_mime_message_get_from (message);
+ if (from && camel_internet_address_get (from, 0, NULL, &email) && email) {
+ g_hash_table_remove_all (recipients);
+ g_hash_table_add (recipients, (gpointer) email);
+
+ for (iter = list; iter != NULL; iter = g_list_next (iter)) {
+ ESource *temp = E_SOURCE (iter->data);
+
+ if (mail_account_in_recipients (registry, temp, recipients, identity_name,
identity_address)) {
+ source = g_object_ref (temp);
+ break;
+ }
+ }
+ }
+ }
+
g_list_free_full (list, (GDestroyNotify) g_object_unref);
if (source != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]