From 3257a00ff5d907b989c9ad8e41fd0b2492edd299 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 28 Jul 2010 12:45:49 +0200 Subject: [PATCH] Use From: address too when searching for matching identities, to select the correct identity when replying to a message from yourself. --- imp/message.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/imp/message.php b/imp/message.php index 750c83141..edb6387dc 100644 --- a/imp/message.php +++ b/imp/message.php @@ -376,13 +376,10 @@ $mailbox_url = IMP::generateIMPUrl('mailbox.php', IMP::$mailbox)->add('start', $ /* Everything below here is related to preparing the output. */ /* Set the status information of the message. */ -$identity = $match_identity = $status = null; - -if (!empty($msgAddresses)) { - $identity = $match_identity = $user_identity->getMatchingIdentity($msgAddresses); - if (is_null($identity)) { - $identity = $user_identity->getDefault(); - } +$msgAddresses[] = $mime_headers->getValue('from'); +$identity = $match_identity = $user_identity->getMatchingIdentity($msgAddresses); +if (is_null($identity)) { + $identity = $user_identity->getDefault(); } $flag_parse = $imp_flags->parse(array( @@ -391,6 +388,7 @@ $flag_parse = $imp_flags->parse(array( 'personal' => $match_identity )); +$status = ''; foreach ($flag_parse as $val) { if ($val['type'] == 'imapp') { $status .= '' . htmlspecialchars($val['label']) . ''; -- 2.11.0