Use From: address too when searching for matching identities, to select the
authorJan Schneider <jan@horde.org>
Wed, 28 Jul 2010 10:45:49 +0000 (12:45 +0200)
committerJan Schneider <jan@horde.org>
Wed, 28 Jul 2010 10:45:49 +0000 (12:45 +0200)
correct identity when replying to a message from yourself.

imp/message.php

index 750c831..edb6387 100644 (file)
@@ -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 .= '<span class="' . $val['classname'] . '" style="background:' . htmlspecialchars($val['bg']) . ';color:' . htmlspecialchars($val['fg']) . '">' . htmlspecialchars($val['label']) . '</span>';