Index: /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 5023)
+++ /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 5029)
@@ -710,5 +710,6 @@
 			$this->template->set_var("show_check_add_history","none");
 			
-			if(isset($params["error_message"])) {
+			if(isset($params["error_message"]))
+			{
 				$this->template->set_var('input_to', $_POST['input_to']);
 				$this->template->set_var('input_cc', $_POST['input_cc']);
@@ -725,7 +726,11 @@
 				
 				$GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]);
-			} else {
-				if (isset($params['msg_number'])) $msg = $this->imap_functions->get_info_msg(array('msg_number' => $params['msg_number'], 'msg_folder' => $params['msg_folder'] ) );
-				
+			}
+			else
+			{
+				if (isset($params['msg_number']) )
+				{
+					$msg = $this->imap_functions->get_info_msg(array('msg_number' => $params['msg_number'], 'msg_folder' => $params['msg_folder'] ) );
+				}
 				
 				if($params['type']=="clk")
@@ -779,10 +784,16 @@
 					$params["type"] = $params['mobile_add_contact']['type'];
 				}
-				else if($params['type']=="forward"){
+				else if($params['type']=="forward")
+				{
 					$this->template->set_var('from', $msg['toaddress2']);
-	
 					$this->template->set_var('subject', "Enc:" . $msg['subject']);
-					$this->template->set_var('body_value', strip_tags($msg['body'])); // Usa a função strip_tags() para filtrar
+					
+					$_name	= ( isset($msg['from']['name']) ) ? $msg['from']['name'] : "";
+					$_email	= ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : "";
+					$forward_msg = "\n" . lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email );
+						
+					// Usa a função strip_tags() para filtrar
 					// as tags que estão presentes no corpo do e-mail.
+					$this->template->set_var('body_value', "\n\n\n" . $forward_msg . "\n" . strip_tags($msg['body']) ); 
 					
 					$this->template->set_var('msg_number', $_GET['msg_number']);
@@ -792,5 +803,6 @@
 						$this->template->set_var("show_forward_attachment","block");
 						$this->template->set_block("new_msg_t","forward_attach_block");
-						foreach($msg['attachments'] as $forward_attach) {
+						foreach($msg['attachments'] as $forward_attach)
+						{
 							$value = rawurlencode(serialize(array(0=>$msg['msg_folder'],
 										   1=>$msg['msg_number'],
@@ -804,5 +816,6 @@
 					}
 				}
-				else if($params['type']=="use_draft"){
+				else if($params['type']=="use_draft")
+				{
 					$this->template->set_var('input_to', $msg['toaddress2']);
 					$this->template->set_var('input_cc', $msg['cc']);
@@ -812,13 +825,14 @@
 					$this->template->set_var('msg_folder', $_GET['msg_folder']);
 				}
-				else if($params['type']=="reply"){
+				else if($params['type']=="reply")
+				{
 					$this->template->set_var('from', $msg['toaddress2']);
 					$this->template->set_var('input_to', $msg['from']['email']);
-	
 					$this->template->set_var('subject', "Re:" . $msg['subject']);
-	
 					$this->template->set_var('msg_number', $_GET['msg_number']);
 					$this->template->set_var('msg_folder', $_GET['msg_folder']);
-				} else {
+				}
+				else 
+				{
 					$this->template->set_var('input_to', "");
 					$this->template->set_var('input_cc', "");
@@ -827,6 +841,6 @@
 			}
 			
-				if($params['type']=="reply" || $params['type']=="forward"  || $params['type']=="reply_all" )
-					$this->template->set_var("show_check_add_history","block");
+			if($params['type']=="reply" || $params['type']=="forward"  || $params['type']=="reply_all" )
+				$this->template->set_var("show_check_add_history","block");
 			
 			//tem que ser realizado no final, pois o tipo user_add é modificado para o tipo que o originou
@@ -920,7 +934,16 @@
 			if($isImportant) $mail->isImportant();
 			//add history
-			if($addHistory && $msgNumber) {
+			if($addHistory && $msgNumber)
+			{
 				$msg = $this->imap_functions->get_info_msg(array('msg_number' => $msgNumber ) );
-				$mail->Body .= "<br />".$msg['body']."<br />";
+				
+				$_name	= ( isset($msg['from']['name']) ) ? $msg['from']['name'] : "";
+				$_email	= ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : "";
+				
+				$history_msg  = "<br/><br/><br/>";
+				$history_msg .= lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email );
+				$history_msg .= "<br/>";
+				
+				$mail->Body .= "<br/>". $history_msg . $msg['body']."<br/>";
 			}
 			//read confirmation
@@ -983,7 +1006,7 @@
 						'folder' => 'INBOX/Trash'
 					);
-
+				
 					$this->imap_functions->delete_msgs($params_messages);
-
+				
 					$msg = lang("The messages were deleted");
 				} else {
@@ -996,5 +1019,5 @@
 
 					$this->imap_functions->move_messages($params_messages);
-
+				
 					$msg = lang("The messages were moved to trash");
 				}
