rem: saveCalendarObject(CalendarDataFilePath, CalendarText); 
add: saveCalendarObject(CalendarDataFilePath, CalendarText); 
context: function sendEvent(){	var Event;	var CalendarDataFilePath;	var nsIMsgCompFieldsComponent;	var nsIMsgCompFields;	var nsIMsgComposeParamsComponent;	var nsIMsgComposeParams;	var nsIMsgComposeServiceComponent;	var nsIMsgComposeService;	var nsIMsgCompFormat;	var nsIMsgCompType;	var nsIMsgAttachmentComponent;	var nsIMsgAttachment;	CalendarDataFilePath = getCalendarDataFilePath();	if (! CalendarDataFilePath)	{		alert( "No calendarDataFilePath in calendarMail.js" );      return;	}	/* Want output like	 * When: Thursday, November 09, 2000 11:00 PM-11:30 PM (GMT-08:00) Pacific Time     * (US & Canada); Tijuana.     * Where: San Francisco	 * see bug 59630	 */   var CalendarText = "";   var EmailBody = "";   var Separator = "";	for( var i = 0; i < gCalendarWindow.EventSelection.selectedEvents.length; i++ )   {      Event = gCalendarWindow.EventSelection.selectedEvents[0].clone();      if( Event )      {         Event.alarm = false;         if( Event.method == 0 )            Event.method = Event.ICAL_METHOD_PUBLISH;         CalendarText += Event.getIcalString();         var dateFormat = new DateFormater();         var eventStartDate = new Date(Event.start.getTime());         var eventEndDate   = new Date(Event.end.getTime());         var eventStartFormatted = (dateFormat.getShortFormatedDate(eventStartDate)+" "+                                   dateFormat.getFormatedTime(eventStartDate));         var eventEndFormatted   = (dateFormat.getShortFormatedDate(eventEndDate)+" "+                                   dateFormat.getFormatedTime(eventEndDate));         EmailBody += (emailStringBundle.GetStringFromName( "When" )+" " + eventStartFormatted + " - " + eventEndFormatted + "\n"+                      emailStringBundle.GetStringFromName( "Where" )+" " + Event.location + "\n"+                      emailStringBundle.GetStringFromName( "Organizer" )+" " + gMailIdentity.fullName + " <" + gMailIdentity.email + ">" + "\n" +                      emailStringBundle.GetStringFromName( "Summary" )+":" + Event.description);         EmailBody += Separator;         Separator = "\n";      }   }      var EmailSubject;   if( gCalendarWindow.EventSelection.selectedEvents.length == 1 )      EmailSubject = Event.title;   else      EmailSubject = emailStringBundle.GetStringFromName( "EmailSubject" );   saveCalendarObject(CalendarDataFilePath, CalendarText);   // lets open a composer with fields and body prefilled   try   {      nsIMsgAttachmentComponent = Components.classes["@mozilla.org/messengercompose/attachment;1"];      nsIMsgAttachment = nsIMsgAttachmentComponent.createInstance(Components.interfaces.nsIMsgAttachment);      nsIMsgAttachment.name = emailStringBundle.GetStringFromName( "AttachmentName" );      nsIMsgAttachment.contentType = "text/calendar;"      nsIMsgAttachment.temporary = true;      nsIMsgAttachment.url = "file://" + CalendarDataFilePath;      // lets setup the fields for the message      nsIMsgCompFieldsComponent = Components.classes["@mozilla.org/messengercompose/composefields;1"];      nsIMsgCompFields = nsIMsgCompFieldsComponent.createInstance(Components.interfaces.nsIMsgCompFields);      nsIMsgCompFields.useMultipartAlternative = true;      nsIMsgCompFields.attachVCard = true;      nsIMsgCompFields.from = gMailIdentity.email;      nsIMsgCompFields.replyTo = gMailIdentity.replyTo;      nsIMsgCompFields.subject = EmailSubject;      nsIMsgCompFields.organization = gMailIdentity.organization;      nsIMsgCompFields.body = EmailBody;      nsIMsgCompFields.addAttachment(nsIMsgAttachment);      /* later on we may be able to add:       * returnReceipt, attachVCard       */      // time to handle the message paramaters      nsIMsgComposeParamsComponent = Components.classes["@mozilla.org/messengercompose/composeparams;1"];      nsIMsgComposeParams = nsIMsgComposeParamsComponent.createInstance(Components.interfaces.nsIMsgComposeParams);      nsIMsgComposeParams.composeFields = nsIMsgCompFields;      nsIMsgCompFormat = Components.interfaces.nsIMsgCompFormat;      nsIMsgCompType = Components.interfaces.nsIMsgCompType;      nsIMsgComposeParams.format = nsIMsgCompFormat.PlainText; // this could be a pref for the user      nsIMsgComposeParams.type = nsIMsgCompType.New;      // finally lets pop open a composer window after all this work :)      nsIMsgComposeServiceComponent = Components.classes["@mozilla.org/messengercompose;1"];      nsIMsgComposeService = nsIMsgComposeServiceComponent.getService().QueryInterface(Components.interfaces.nsIMsgComposeService);      nsIMsgComposeService.OpenComposeWindowWithParams(null, nsIMsgComposeParams);   }   catch(ex)   {      alert( ex );      mdebug("failed to get composer window\nex: " + ex);   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/f465d8f36482d4559bd5389be6db7cc751f8e007/calendarMail.js/buggy/calendar/resources/content/calendarMail.js