Index: sandbox/2.4.2-expresso3/prototype/services/iCal.php
===================================================================
--- sandbox/2.4.2-expresso3/prototype/services/iCal.php	(revision 6528)
+++ sandbox/2.4.2-expresso3/prototype/services/iCal.php	(revision 6755)
@@ -475,5 +475,5 @@
 				$interation['schedulable://' . $schedulable['id']] = false;
 			    break;
-
+				
 			case 'ADD':
 			    break;
@@ -623,5 +623,10 @@
 
 			case 'REPLY':
-			    $interation = ICAL_ACTION_REPLY;
+				if ($schedulable = self::_getSchedulable($uid)) {
+					while ($property = $component->getProperty('attendee', FALSE, TRUE))
+					    if ($attendee = self::_getParticipantByMail(str_replace('MAILTO:', '', $property['value']), $schedulable['participants'], true))
+							$interation = (constant('STATUS_' . strtoupper($property['params']['PARTSTAT'])) == $attendee['status']) ?  ICAL_ACTION_NONE : ICAL_ACTION_REPLY;
+			    }else
+			    	$interation = ICAL_NOT_FOUND;
 			    break;
 
@@ -713,9 +718,9 @@
     
     
-    private static function _getParticipantByMail($mail, &$participants) {
+    private static function _getParticipantByMail($mail, &$participants, $isFull) {
 	if ($participants && $participants != '')
 	    foreach ($participants as $i => $v)
 		if ((is_array($v) && isset($v['user'])) && ($v['user']['mail'] == $mail || (isset($v['user']['mailAlternateAddress']) && in_array($mail, $v['user']['mailAlternateAddress']))))
-		    return $v['id'];
+		      return !!$isFull ? $v : $v['id'];
 	return false;
     }
Index: sandbox/2.4.2-expresso3/prototype/modules/calendar/constants.php
===================================================================
--- sandbox/2.4.2-expresso3/prototype/modules/calendar/constants.php	(revision 6295)
+++ sandbox/2.4.2-expresso3/prototype/modules/calendar/constants.php	(revision 6755)
@@ -33,4 +33,5 @@
 define('ICAL_ACTION_IMPORT_FROM_PERMISSION', 10);
 define('ICAL_ACTION_NONE_FROM_PERMISSION', 11);
+define('ICAL_NOT_FOUND', 12);
 
 define('ATTENDEE_ACL_ORGANIZATION', 'o');
Index: sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js
===================================================================
--- sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js	(revision 6747)
+++ sandbox/2.4.2-expresso3/expressoMail1_2/js/main.js	(revision 6755)
@@ -3881,13 +3881,6 @@
 		wfolders.makeWindow('null','import');
 }
-function import_calendar(data){
-    var import_url = '$this.db_functions.import_vcard&msg_folder='+data;
-    var logUser;
-    var up;
-    var owner;
-    
-    //Verifica o contexto de importação
-    var decodeOwner = function(){
-	
+
+function decodeOwner(){
 	owner = User.me.id;
 	var imapBox = openTab.imapBox[currentTab].split(cyrus_delimiter);
@@ -3895,9 +3888,12 @@
 	    var user = DataLayer.get('user', {filter: ['=','uid',imapBox[1]]});		    
 	    owner = $.isArray(user) ? user[0].id : user.id;
-	}
-	
+	}	
 	return owner;
-    }
-    
+}
+function import_calendar(data){
+    var import_url = '$this.db_functions.import_vcard&msg_folder='+data;
+    var logUser;
+    var up;
+    var owner;   
     function handler_import_calendar(data){
             if(data === true){
Index: sandbox/2.4.2-expresso3/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.4.2-expresso3/expressoMail1_2/js/draw_api.js	(revision 6717)
+++ sandbox/2.4.2-expresso3/expressoMail1_2/js/draw_api.js	(revision 6755)
@@ -3191,7 +3191,11 @@
         }
 		attachments.id = "attachments_" + ID;
+		var parserImport = false;
 		for (var i=0; i<info_msg.attachments.length; i++)
 		{
+			var import_url = '$this.db_functions.import_vcard&msg_folder='+info_msg.msg_folder+"&msg_number="+info_msg.msg_number+"&msg_part="+info_msg.attachments[i].pid+"&idx_file="+i+"&encoding="+info_msg.attachments[i].encoding;
 			var link_attachment = document.createElement("a");
+			link_attachment.setAttribute("class", "type_images");
+			link_attachment.style.display = "block";
 			link_attachment.setAttribute("href", proxy_mensagens.link_anexo(info_msg,i));
 			link_attachment.innerHTML = url_decode(info_msg.attachments[i].name) + " ("+borkb(info_msg.attachments[i].fsize)+")";
@@ -3206,11 +3210,13 @@
 				link_import_attachment.setAttribute("onclick","javascript:import_calendar('"+info_msg.msg_folder+"&msg_number="+info_msg.msg_number+"&msg_part="+info_msg.attachments[i].pid+"&idx_file="+i+"&encoding="+info_msg.attachments[i].encoding+"'); return false;");
 				link_import_attachment.title = get_lang("Import to calendar");
+				link_import_attachment.style.display = "inline";
 				link_import_attachment.align = "top";
 				link_import_attachment.style.marginLeft = "5px";
 				link_import_attachment.style.cursor = "pointer";
 				link_attachment.appendChild(link_import_attachment);
-			}
-
-                        if((url_decode(info_msg.attachments[i].name).indexOf(".eml") != -1))
+				parserImport = true;
+			}
+
+            if((url_decode(info_msg.attachments[i].name).indexOf(".eml") != -1))
 			{
 				//Link para importar calendário
@@ -3224,14 +3230,51 @@
 				link_open_msg.style.cursor = "pointer";
 				link_attachment.appendChild(link_open_msg);
-		}
-		
-            link_attachment.innerHTML += '<br/>';
+			}
+		
+            //link_attachment.innerHTML += '<br/>';
             attachments.appendChild(link_attachment);
             }
 		tr6.appendChild(td6);
-            tr6.appendChild(attachments);
+        tr6.appendChild(attachments);
 		tbody_message_others_options.appendChild(tr6);
 	}
 
+	if (parserImport){
+		$.ajax({
+			url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&readable=true&cirus_delimiter='+cyrus_delimiter+'&analize=true&uidAccount='+decodeOwner(),
+			async: true,
+			success: function(data){
+				data = connector.unserialize(data);
+
+				if(typeof(data) == "object"){
+				    var calendarPermission = data.calendar;
+				    data = data.action;
+				}
+					
+				switch(parseInt(data)){
+				case 5:
+					$('.type_images').append('<img class="loader" src="templates/default/images/ajax-loader.gif" align="top" style="margin-left: 5px; cursor: pointer; display: inline">');
+					$.ajax({
+						url: "controller.php?action="+import_url+'&from_ajax=true&selected=true',
+						success: function(msg){		
+							$('.type_images').append('<img src="../prototype/modules/mail/img/flagDone.png" align="top" style="margin: 3px 0 0 5px; cursor: pointer; display: inline">').parent().find('.loader').remove();
+							write_msg( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento foi Atualizado com sucesso" : "Ocorreu um erro ao atualizar evento" );
+						}
+					});
+					return;
+					break;		
+				case 4:
+					$('.type_images').append('<img src="../prototype/modules/mail/img/flagDone.png" align="top" style="margin: 3px 0 0 5px; cursor: pointer; ">');
+					write_msg("Seu evento encontra-se atualizado.");
+					return;
+					break;
+				case 12:
+					write_msg('Este evento não existe mais.');
+					return;
+					break;			
+				}
+			}
+		});
+	}
 	//k!!
 	
