Explorar o código

Pick up identities if you're not using default identity on resuming on draft.
Looks like somebody had started, but left debugging code everywhere.

Please check commits to ensure there is no debug code ;)

This is the start of the work for bug #858001

jangliss %!s(int64=21) %!d(string=hai) anos
pai
achega
be0bfb7d98
Modificáronse 1 ficheiros con 13 adicións e 4 borrados
  1. 13 4
      src/compose.php

+ 13 - 4
src/compose.php

@@ -680,15 +680,24 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             $send_to = decodeHeader($orig_header->getAddr_s('to'),false,true);
             $send_to_cc = decodeHeader($orig_header->getAddr_s('cc'),false,true);
             $send_to_bcc = decodeHeader($orig_header->getAddr_s('bcc'),false,true);
+            $send_from = $orig_header->getAddr_s('from');
+            $send_from_parts = new AddressStructure();
+            $send_from_parts = $orig_header->parseAddress($send_from);
+            $send_from_add = $send_from_parts->mailbox . '@' . $send_from_parts->host;
+            $identities = get_identities();
+            if (count($identities) > 0) {
+                foreach($identities as $iddata) {
+                    if ($send_from_add == $iddata['email_address']) {
+                        $identity = $iddata['index'];
+                        break;
+                    }
+                }
+            }
             $subject = decodeHeader($orig_header->subject,false,true);
 //            /* remember the references and in-reply-to headers in case of an reply */
             $composeMessage->rfc822_header->more_headers['References'] = $orig_header->references;
             $composeMessage->rfc822_header->more_headers['In-Reply-To'] = $orig_header->in_reply_to;
             $body_ary = explode("\n", $body);
-/*	   echo "debug: $identity"; #845290
-	   $identity='2'; */
-            echo "header".decodeHeader($orig_header->getAddr_s('from'),false,true)."<BR>";
-	    print_r($identities);
             $cnt = count($body_ary) ;
             $body = '';
             for ($i=0; $i < $cnt; $i++) {