public override MessageItem CreateForward(MailboxSession session, StoreId parentFolderId, ReplyForwardConfiguration configuration) { this.CheckDisposed("CreateForward"); ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.CreateForward: GOID={0}", this.GlobalObjectId); Util.ThrowOnNullArgument(session, "session"); Util.ThrowOnNullArgument(parentFolderId, "parentFolderId"); Util.ThrowOnNullArgument(configuration, "configuration"); MeetingRequest meetingRequest = null; bool flag = false; MessageItem result; try { meetingRequest = (base.IsSeriesMessage ? MeetingRequest.CreateMeetingRequestSeries(session) : MeetingRequest.CreateMeetingRequest(session)); ForwardCreation forwardCreation = new ForwardCreation(this, meetingRequest, configuration); forwardCreation.PopulateProperties(); meetingRequest.AdjustAppointmentStateFlagsForForward(); List <BlobRecipient> mergedRecipientList = this.GetMergedRecipientList(); meetingRequest.SetUnsendableRecipients(mergedRecipientList); base.LocationIdentifierHelperInstance.SetLocationIdentifier(42485U, LastChangeAction.CreateForward); flag = true; result = meetingRequest; } finally { if (!flag && meetingRequest != null) { meetingRequest.Dispose(); meetingRequest = null; } } return(result); }
private void UpdateParticipantsOnCalendarItem(CalendarItemBase calendarItem, bool isReadOnlyItem) { this.CheckDisposed("ProcessParticipants"); base.LocationIdentifierHelperInstance.SetLocationIdentifier(62325U, LastChangeAction.ProcessParticipants); IAttendeeCollection attendeeCollection = calendarItem.AttendeeCollection; calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(37749U); attendeeCollection.Clear(); bool flag = false; if (base.From != null) { calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(54133U); attendeeCollection.Add(base.From, AttendeeType.Required, null, null, false).RecipientFlags = (RecipientFlags.Sendable | RecipientFlags.Organizer); flag = true; } List <BlobRecipient> list = this.GetUnsendableRecipients(); if (!isReadOnlyItem) { this.SetUnsendableRecipients(list); } list = MeetingRequest.MergeRecipientLists(base.Recipients, list); Participant participant = null; if (base.IsDelegated()) { participant = (Participant)base.TryGetProperty(InternalSchema.ReceivedBy); } foreach (BlobRecipient blobRecipient in list) { RecipientFlags valueOrDefault = blobRecipient.GetValueOrDefault <RecipientFlags>(InternalSchema.RecipientFlags); bool flag2 = (valueOrDefault & RecipientFlags.Organizer) == RecipientFlags.Organizer; if (flag2) { if (flag) { continue; } flag = true; } if (!blobRecipient.Participant.AreAddressesEqual(base.From)) { RecipientItemType type = MapiUtil.MapiRecipientTypeToRecipientItemType(blobRecipient.GetValueOrDefault <RecipientType>(InternalSchema.RecipientType, RecipientType.To)); AttendeeType attendeeType = Attendee.RecipientItemTypeToAttendeeType(type); Participant participant2 = blobRecipient.Participant; if (participant != null && Participant.HasSameEmail(participant2, participant, base.MailboxSession, true)) { calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(41845U); attendeeCollection.Add(base.ReceivedRepresenting, attendeeType, null, null, false); participant = null; } else { calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(58229U); attendeeCollection.Add(participant2, attendeeType, null, null, false); } } } }
internal void SetUnsendableRecipients(List <BlobRecipient> list) { base.LocationIdentifierHelperInstance.SetLocationIdentifier(33653U, LastChangeAction.SetUnsendableRecipients); List <BlobRecipient> list2 = MeetingRequest.FilterBlobRecipientList(list); BlobRecipientParser.WriteRecipients(this, InternalSchema.UnsendableRecipients, list2); }
private Item BindToItemWithItemClass(StoreObjectId id, ICollection <PropertyDefinition> properties) { switch (id.ObjectType) { case StoreObjectType.Message: return(MessageItem.Bind(this.folder.Session, id, properties)); case StoreObjectType.MeetingRequest: return(MeetingRequest.Bind(this.folder.Session, id, properties)); case StoreObjectType.MeetingResponse: return(MeetingResponse.Bind(this.folder.Session, id, properties)); case StoreObjectType.MeetingCancellation: return(MeetingCancellation.Bind(this.folder.Session, id, properties)); case StoreObjectType.Contact: return(Contact.Bind(this.folder.Session, id, properties)); case StoreObjectType.DistributionList: return(DistributionList.Bind(this.folder.Session, id, properties)); case StoreObjectType.Task: return(Task.Bind(this.folder.Session, id, true, properties)); case StoreObjectType.Post: return(PostItem.Bind(this.folder.Session, id, properties)); case StoreObjectType.Report: return(ReportMessage.Bind(this.folder.Session, id, properties)); } return(Item.Bind(this.folder.Session, id, properties)); }
internal static MeetingForwardNotification Create(MeetingRequest request) { MailboxSession mailboxSession = request.Session as MailboxSession; if (mailboxSession == null) { throw new NotSupportedException(); } MeetingForwardNotification meetingForwardNotification = null; bool flag = false; MeetingForwardNotification result; try { StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId((mailboxSession.LogonType == LogonType.Transport) ? DefaultFolderType.SentItems : DefaultFolderType.Drafts); meetingForwardNotification = ItemBuilder.CreateNewItem <MeetingForwardNotification>(mailboxSession, defaultFolderId, request.IsSeriesMessage ? ItemCreateInfo.MeetingForwardNotificationSeriesInfo : ItemCreateInfo.MeetingForwardNotificationInfo); meetingForwardNotification.Load(InternalSchema.ContentConversionProperties); meetingForwardNotification.Initialize(request, request.IsSeriesMessage ? "IPM.MeetingMessageSeries.Notification.Forward" : "IPM.Schedule.Meeting.Notification.Forward"); flag = true; result = meetingForwardNotification; } finally { if (!flag && meetingForwardNotification != null) { meetingForwardNotification.Dispose(); } } return(result); }
public static MeetingRequest CreateMeetingRequestSeries(MailboxSession mailboxSession) { MeetingRequest meetingRequest = ItemBuilder.CreateNewItem <MeetingRequest>(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts), ItemCreateInfo.MeetingRequestSeriesInfo); meetingRequest.Initialize("IPM.MeetingMessageSeries.Request"); return(meetingRequest); }
internal static bool?HasRecurrenceTypeChanged(object meetingProperty, object calendarItemProperty) { if (meetingProperty is int && (int)meetingProperty == 0 && calendarItemProperty is PropertyError) { return(null); } return(new bool?(!MeetingRequest.ArePropsEqual(meetingProperty, calendarItemProperty))); }
internal static bool?HasRecurrencePatternChanged(object meetingProperty, object calendarItemProperty) { if (string.IsNullOrEmpty(meetingProperty as string) && (calendarItemProperty is PropertyError || string.IsNullOrEmpty(calendarItemProperty as string))) { return(null); } return(new bool?(!MeetingRequest.ArePropsEqual(meetingProperty, calendarItemProperty))); }
protected override void SetSequencingPropertiesForForward(MeetingRequest meetingRequest) { int appointmentLastSequenceNumber = this.AppointmentLastSequenceNumber; int valueOrDefault = meetingRequest.GetValueOrDefault <int>(InternalSchema.AppointmentSequenceNumber, appointmentLastSequenceNumber); if (valueOrDefault < appointmentLastSequenceNumber) { meetingRequest[InternalSchema.AppointmentSequenceNumber] = appointmentLastSequenceNumber; } }
internal static ChangeHighlightHelper CompareForChangeHighlightOnUpdatedItems(PropertyBag propBagItem1, long bodySizeItem1, PropertyBag propBagItem2, long bodySizeItem2) { ChangeHighlightHelper changeHighlightHelper = MeetingRequest.ComparePropertyBags(propBagItem1, propBagItem2, true); if (bodySizeItem1 != bodySizeItem2) { changeHighlightHelper[InternalSchema.HtmlBody] = true; } return(changeHighlightHelper); }
private void ProcessChangeHighlights(CalendarItemBase calendarItem, long meetingRequestBodySize, long calendarItemBodySize) { int num = base.GetValueOrDefault <int>(InternalSchema.ChangeHighlight, -1); if (calendarItem.IsNew && !(calendarItem is CalendarItemOccurrence)) { num = 0; base.LocationIdentifierHelperInstance.SetLocationIdentifier(47221U); this[InternalSchema.ChangeHighlight] = num; } else { ChangeHighlightHelper changeHighlightHelper = MeetingRequest.CompareForChangeHighlightOnUpdatedItems(base.PropertyBag, meetingRequestBodySize, calendarItem.PropertyBag, calendarItemBodySize); if (this.ShouldPreserveAttendeesChanges(calendarItem)) { PreservablePropertyContext context = new PreservablePropertyContext(this, calendarItem, (ChangeHighlightProperties)num); foreach (StorePropertyDefinition storePropertyDefinition in ChangeHighlightHelper.HighlightProperties) { if (changeHighlightHelper[storePropertyDefinition]) { PreservableMeetingMessageProperty preservableMeetingMessageProperty = null; if (PreservableMeetingMessageProperty.InstanceFromPropertyDefinition.TryGetValue(storePropertyDefinition, out preservableMeetingMessageProperty)) { changeHighlightHelper[storePropertyDefinition] = !preservableMeetingMessageProperty.ShouldPreserve(context); } } } } num = changeHighlightHelper.HighlightFlags; MeetingMessageType meetingMessageType = changeHighlightHelper.SuggestedMeetingType; if (meetingMessageType == MeetingMessageType.InformationalUpdate && calendarItem.IsCancelled) { meetingMessageType = MeetingMessageType.FullUpdate; } if (this.MeetingRequestType != MeetingMessageType.PrincipalWantsCopy) { this.MeetingRequestType = meetingMessageType; } else { base.LocationIdentifierHelperInstance.SetLocationIdentifier(35701U); this[InternalSchema.OriginalMeetingType] = meetingMessageType; } base.LocationIdentifierHelperInstance.SetLocationIdentifier(52085U); this[InternalSchema.ChangeHighlight] = num; } calendarItem.SetChangeHighlight(num); }
private void Initialize(MeetingRequest request, string className) { base.Initialize(); this.ClassName = className; base.Recipients.Add(request.From); CalendarItemBase.CopyPropertiesTo(request, this, MeetingForwardNotification.MeetingForwardNotificationProperties); List <BlobRecipient> list = new List <BlobRecipient>(); foreach (Recipient recipient in request.Recipients) { BlobRecipient item = new BlobRecipient(recipient); list.Add(item); } this.SetForwardedAttendees(list); this.Subject = base.GetValueOrDefault <string>(InternalSchema.NormalizedSubjectInternal, string.Empty); }
internal static ChangeHighlightHelper ComparePropertyBags(PropertyBag meetingPropBag, PropertyBag calItemPropBag, bool isUpdate) { ChangeHighlightHelper changeHighlightHelper = new ChangeHighlightHelper(0, isUpdate); if (meetingPropBag == null || calItemPropBag == null) { return(changeHighlightHelper); } object[] array = new object[ChangeHighlightHelper.HighlightProperties.Length]; object[] array2 = new object[ChangeHighlightHelper.HighlightProperties.Length]; for (int i = 0; i < ChangeHighlightHelper.HighlightProperties.Length; i++) { StorePropertyDefinition storePropertyDefinition = ChangeHighlightHelper.HighlightProperties[i]; array[i] = meetingPropBag.TryGetProperty(storePropertyDefinition); array2[i] = calItemPropBag.TryGetProperty(storePropertyDefinition); if (storePropertyDefinition == InternalSchema.MapiRecurrenceType) { bool?flag = MeetingRequest.HasRecurrenceTypeChanged(array[i], array2[i]); if (flag != null) { changeHighlightHelper[storePropertyDefinition] = flag.Value; } } else if (storePropertyDefinition == InternalSchema.RecurrencePattern) { bool?flag2 = MeetingRequest.HasRecurrencePatternChanged(array[i], array2[i]); if (flag2 != null) { changeHighlightHelper[storePropertyDefinition] = flag2.Value; } } else if (storePropertyDefinition != InternalSchema.Duration || !string.IsNullOrEmpty(array[i] as string)) { changeHighlightHelper[storePropertyDefinition] = !MeetingRequest.ArePropsEqual(array[i], array2[i]); } } return(changeHighlightHelper); }
protected override MeetingRequest CreateNewMeetingRequest(MailboxSession mailboxSession) { return(MeetingRequest.CreateMeetingRequestSeries(mailboxSession)); }
protected override void SetSequencingPropertiesForForward(MeetingRequest meetingRequest) { meetingRequest.SeriesSequenceNumber = this.SeriesSequenceNumber; meetingRequest[CalendarItemBaseSchema.AppointmentSequenceNumber] = this.SeriesSequenceNumber; }
public static MessageItem CreateForward(MessageItem originalItem, bool asAttachment, CultureInfo culture, string imceaDomain, string xLoop, ExTimeZone timeZone, IRuleEvaluationContext context) { Util.ThrowOnNullArgument(originalItem, "originalItem"); Util.ThrowOnNullArgument(culture, "culture"); Util.ThrowOnNullOrEmptyArgument(imceaDomain, "imceaDomain"); ExTraceGlobals.StorageTracer.Information(0L, "RuleMessageUtils::CreateForward."); MessageItem messageItem = null; bool flag = false; MessageItem result; try { ForwardCreationFlags forwardCreationFlags = ForwardCreationFlags.None; string className = originalItem.ClassName; if (ObjectClass.IsMeetingMessage(className)) { forwardCreationFlags |= ForwardCreationFlags.TreatAsMeetingMessage; } messageItem = context.CreateMessageItem(InternalSchema.ContentConversionProperties); messageItem[InternalSchema.ItemClass] = "IPM.Note"; StoreSession storeSession = context.StoreSession ?? originalItem.Session; if (asAttachment) { ForwardAsAttachmentCreation forwardAsAttachmentCreation = new ForwardAsAttachmentCreation(originalItem, messageItem, new ReplyForwardConfiguration(forwardCreationFlags, culture) { XLoop = xLoop, TimeZone = timeZone, ConversionOptionsForSmime = new InboundConversionOptions(storeSession.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid), imceaDomain) }); forwardAsAttachmentCreation.PopulateProperties(); } else { bool flag2 = ObjectClass.IsMeetingCancellation(className); bool flag3 = ObjectClass.IsMeetingRequest(className); bool isRestricted = originalItem.IsRestricted; if (flag2) { messageItem[InternalSchema.ItemClass] = "IPM.Schedule.Meeting.Canceled"; messageItem[InternalSchema.IconIndex] = IconIndex.AppointmentMeetCancel; } else if (flag3) { messageItem[InternalSchema.ItemClass] = "IPM.Schedule.Meeting.Request"; messageItem[InternalSchema.IsResponseRequested] = true; messageItem[InternalSchema.IsReplyRequested] = true; } else if (isRestricted) { messageItem[StoreObjectSchema.ContentClass] = "rpmsg.message"; messageItem.IconIndex = IconIndex.MailIrm; } BodyFormat format = originalItem.Body.Format; ReplyForwardConfiguration replyForwardConfiguration = new ReplyForwardConfiguration(format, forwardCreationFlags, culture); replyForwardConfiguration.XLoop = xLoop; replyForwardConfiguration.TimeZone = timeZone; replyForwardConfiguration.ConversionOptionsForSmime = new InboundConversionOptions(storeSession.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid), imceaDomain); RuleMessageUtils.GenerateHeader(replyForwardConfiguration, originalItem); ForwardCreation forwardCreation = new ForwardCreation(originalItem, messageItem, replyForwardConfiguration); forwardCreation.PopulateProperties(); if (flag2 || flag3) { AppointmentStateFlags appointmentStateFlags = messageItem.GetValueOrDefault <AppointmentStateFlags>(InternalSchema.AppointmentState); appointmentStateFlags |= (AppointmentStateFlags.Meeting | AppointmentStateFlags.Received); messageItem[InternalSchema.AppointmentState] = appointmentStateFlags; int num = messageItem.GetValueOrDefault <int>(InternalSchema.AppointmentAuxiliaryFlags, 0); num |= 4; messageItem[InternalSchema.AppointmentAuxiliaryFlags] = num; if (flag3) { List <BlobRecipient> list = BlobRecipientParser.ReadRecipients(originalItem, InternalSchema.UnsendableRecipients); list = MeetingRequest.FilterBlobRecipientList(list); list = MeetingRequest.MergeRecipientLists(originalItem.Recipients, list); list = MeetingRequest.FilterBlobRecipientList(list); BlobRecipientParser.WriteRecipients(messageItem, InternalSchema.UnsendableRecipients, list); } } } flag = true; result = messageItem; } finally { if (!flag && messageItem != null) { messageItem.Dispose(); messageItem = null; } } return(result); }
protected override void InitializeMeetingRequest(Action <MeetingRequest> setBodyAndAdjustFlags, MeetingRequest meetingRequest) { base.InitializeMeetingRequest(setBodyAndAdjustFlags, meetingRequest); Microsoft.Exchange.Data.Storage.Item.CopyCustomPublicStrings(this, meetingRequest); this.ClearCounterProposal(); if (base.CalendarItemType == CalendarItemType.RecurringMaster) { CalendarItemBase.CopyPropertiesTo(this, meetingRequest, new PropertyDefinition[] { InternalSchema.AppointmentRecurrenceBlob }); } }
internal List <BlobRecipient> GetMergedRecipientList() { List <BlobRecipient> unsendableRecipients = this.GetUnsendableRecipients(); return(MeetingRequest.MergeRecipientLists(base.Recipients, unsendableRecipients)); }
public IMeetingRequest BindToMeetingRequestMessage(IStoreSession session, StoreId storeId) { return(MeetingRequest.Bind((StoreSession)session, storeId)); }
internal List <BlobRecipient> GetUnsendableRecipients() { List <BlobRecipient> blobRecipientList = BlobRecipientParser.ReadRecipients(this, InternalSchema.UnsendableRecipients); return(MeetingRequest.FilterBlobRecipientList(blobRecipientList)); }
public new static MeetingRequest Bind(StoreSession session, StoreId storeId) { return(MeetingRequest.Bind(session, storeId, null)); }
public new static MeetingRequest Bind(StoreSession session, StoreId storeId, params PropertyDefinition[] propsToReturn) { return(MeetingRequest.Bind(session, storeId, (ICollection <PropertyDefinition>)propsToReturn)); }
internal static ChangeHighlightHelper ComparePropertyBags(PropertyBag meetingPropBag, PropertyBag calItemPropBag) { return(MeetingRequest.ComparePropertyBags(meetingPropBag, calItemPropBag, false)); }
protected override void CopyMeetingRequestProperties(MeetingRequest meetingRequest) { base.CopyMeetingRequestProperties(meetingRequest); CalendarItemBase.CopyPropertiesTo(this, meetingRequest, MeetingMessage.WriteOnCreateSeriesProperties); }
private bool ShouldPreserveLocalExceptions(CalendarItem calendarItem) { InternalRecurrence recurrenceFromItem = CalendarItem.GetRecurrenceFromItem(this); Recurrence recurrence = null; try { recurrence = calendarItem.Recurrence; } catch (RecurrenceFormatException ex) { ExTraceGlobals.MeetingMessageTracer.Information <string, GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingRequest.ShouldPreserveLocalExceptions encountered a recurrence format exception ({0}). Local exceptions will not be preserved: GOID={1}", ex.Message, this.GlobalObjectId); } catch (CorruptDataException ex2) { ExTraceGlobals.MeetingMessageTracer.Information <string, GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingRequest.ShouldPreserveLocalExceptions encountered a corrupt data exception ({0}). Local exceptions will not be preserved: GOID={1}", ex2.Message, this.GlobalObjectId); } return(recurrence != null && recurrenceFromItem != null && recurrence.Equals(recurrenceFromItem) && MeetingRequest.ArePropsEqual(calendarItem.TryGetProperty(InternalSchema.StartTime), base.TryGetProperty(InternalSchema.StartTime)) && MeetingRequest.ArePropsEqual(calendarItem.TryGetProperty(InternalSchema.EndTime), base.TryGetProperty(InternalSchema.EndTime))); }
public override CalendarItemBase PreProcess(bool createNewItem, bool processExternal, int defaultReminderMinutes) { this.CheckDisposed("PreProcess"); base.LocationIdentifierHelperInstance.SetLocationIdentifier(44661U, LastChangeAction.PreProcessMeetingMessage); bool canUpdatePrincipalCalendar = true; CalendarItemBase calendarItemBase = null; bool flag = false; if (base.GetValueOrDefault <MeetingMessageType>(InternalSchema.MeetingRequestType) == MeetingMessageType.Outdated) { return(null); } try { calendarItemBase = this.GetCorrelatedItem(); if (base.IsOutOfDate(calendarItemBase)) { base.MarkAsOutOfDate(); base.LocationIdentifierHelperInstance.SetLocationIdentifier(59381U, LastChangeAction.MeetingMessageOutdated); return(null); } if (base.SkipMessage(processExternal, calendarItemBase)) { ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId, bool, bool>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping meeting message processing. (ProcessExternal: {1}; IsRepairUpdateMessage: {2})", this.GlobalObjectId, processExternal, base.IsRepairUpdateMessage); return(null); } CalendarProcessingSteps valueOrDefault = base.GetValueOrDefault <CalendarProcessingSteps>(InternalSchema.CalendarProcessingSteps); bool flag2 = (valueOrDefault & CalendarProcessingSteps.CreatedOnPrincipal) == CalendarProcessingSteps.CreatedOnPrincipal; bool flag3 = (valueOrDefault & CalendarProcessingSteps.UpdatedCalItem) == CalendarProcessingSteps.UpdatedCalItem; flag = (flag2 || flag3); if (flag) { ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping meeting message processing because it was already created.", this.GlobalObjectId); } else if (createNewItem || calendarItemBase != null) { MeetingRequest meetingRequest = this as MeetingRequest; if (meetingRequest != null) { flag = meetingRequest.TryUpdateCalendarItem(ref calendarItemBase, defaultReminderMinutes, canUpdatePrincipalCalendar); } else { MeetingCancellation meetingCancellation = this as MeetingCancellation; if (meetingCancellation != null) { flag = meetingCancellation.TryUpdateCalendarItem(ref calendarItemBase, canUpdatePrincipalCalendar); } } } else { ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping new meeting request.", this.GlobalObjectId); } } finally { if (!flag && calendarItemBase != null) { ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Disposing calendar item; preconditions failed.", this.GlobalObjectId); calendarItemBase.Dispose(); calendarItemBase = null; } } return(calendarItemBase); }
public PreservablePropertyContext(MeetingRequest mtg, CalendarItemBase calItem, ChangeHighlightProperties organizerHighlights) { this.MeetingRequest = mtg; this.CalendarItem = calItem; this.OrganizerHighlights = organizerHighlights; }