public void ForwardEvent(StoreId id, ForwardEventParameters parameters, Event updateToEvent = null, int?seriesSequenceNumber = null, string occurrencesViewPropertiesBlob = null, CommandContext commandContext = null)
        {
            using (ICalendarItemBase calendarItemBase = this.Bind(id))
            {
                if (updateToEvent != null)
                {
                    calendarItemBase.OpenAsReadWrite();
                    this.UpdateOnly(updateToEvent, calendarItemBase, base.GetSaveMode(updateToEvent.ChangeKey, commandContext));
                }
                CalendarItemBase calendarItemBase2 = (CalendarItemBase)calendarItemBase;
                BodyFormat       targetFormat      = BodyFormat.TextPlain;
                if (parameters != null && parameters.Notes != null)
                {
                    targetFormat = parameters.Notes.ContentType.ToStorageType();
                }
                ReplyForwardConfiguration replyForwardParameters = new ReplyForwardConfiguration(targetFormat)
                {
                    ShouldSuppressReadReceipt = false
                };
                MailboxSession mailboxSession = base.Session as MailboxSession;
                using (MessageItem messageItem = calendarItemBase2.CreateForward(mailboxSession, CalendarItemBase.GetDraftsFolderIdOrThrow(mailboxSession), replyForwardParameters, seriesSequenceNumber, occurrencesViewPropertiesBlob))
                {
                    EventWorkflowParametersTranslator <ForwardEventParameters, ForwardEventParametersSchema> .Instance.SetPropertiesFromEntityOnStorageObject(parameters, messageItem);

                    foreach (Recipient <RecipientSchema> recipient in parameters.Forwardees)
                    {
                        messageItem.Recipients.Add(new Participant(recipient.Name, recipient.EmailAddress, "SMTP"));
                    }
                    MeetingMessage.SendLocalOrRemote(messageItem, true, true);
                }
            }
        }
示例#2
0
        public static CalendarItemBase TryGetCorrelatedItem(MeetingMessage meetingMessage)
        {
            CalendarItemBase result = null;

            try
            {
                ExTraceGlobals.CalendarTracer.TraceDebug <string>(0L, "Retreiving calendar item associated with meeting message. Value = '{0}'", (meetingMessage.Id != null) ? meetingMessage.Id.ObjectId.ToBase64String() : "null");
                result = meetingMessage.GetCorrelatedItem();
            }
            catch (CorrelationFailedException ex)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Can not retrieve calendar item associated with Meeting message.  Exception: {0}", ex.Message);
            }
            catch (CorruptDataException ex2)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Can not retrieve calendar item associated with Meeting message.  Exception: {0}", ex2.Message);
            }
            catch (ObjectDisposedException ex3)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Can not retrieve calendar item associated with Meeting message.  Exception: {0}", ex3.Message);
            }
            catch (StorageTransientException ex4)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Can not retrieve calendar item associated with Meeting message.  Exception: {0}", ex4.Message);
            }
            catch (InvalidOperationException ex5)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Can not retrieve calendar item associated with Meeting message.  Exception: {0}", ex5.Message);
            }
            return(result);
        }
        public override CalendarItemBase UpdateCalendarItem(bool canUpdatePrincipalCalendar)
        {
            this.CheckDisposed("UpdateCalendarItem");
            ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.UpdateCalendarItem: GOID={0}", this.GlobalObjectId);
            object obj = base.TryGetProperty(InternalSchema.OriginalMeetingType);

            if (obj is int)
            {
                base.LocationIdentifierHelperInstance.SetLocationIdentifier(36981U);
                this[InternalSchema.MeetingRequestType] = (MeetingMessageType)obj;
            }
            base.CheckPreConditionForDelegatedMeeting(canUpdatePrincipalCalendar);
            CalendarItemBase calendarItemBase = this.GetCorrelatedItem();
            bool             flag             = calendarItemBase == null;
            bool             flag2            = false;

            try
            {
                this.TryUpdateCalendarItemInternal(ref calendarItemBase, true, canUpdatePrincipalCalendar);
                flag2 = true;
            }
            finally
            {
                if (!flag2 && calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
            if (flag && calendarItemBase != null)
            {
                calendarItemBase.AssociatedItemId = base.Id;
            }
            return(calendarItemBase);
        }
示例#4
0
        internal static bool IsReplySupported(Item item)
        {
            CalendarItemBase calendarItemBase = item as CalendarItemBase;
            bool             flag             = calendarItemBase != null && calendarItemBase.IsMeeting;

            return(item is MessageItem || flag || item is PostItem);
        }
示例#5
0
        public bool ApplyAttachmentsUpdates(Item item)
        {
            bool flag = false;

            if (base.NeedsSave() && !Utilities.IsClearSigned(item))
            {
                item.OpenAsReadWrite();
                CalendarItemBase calendarItemBase = item as CalendarItemBase;
                if (calendarItemBase != null)
                {
                    Utilities.ValidateCalendarItemBaseStoreObject(calendarItemBase);
                }
                try
                {
                    flag = this.SaveChanges();
                }
                catch (AccessDeniedException)
                {
                }
                if (flag)
                {
                    try
                    {
                        Utilities.SaveItem(item, false);
                    }
                    catch (AccessDeniedException)
                    {
                    }
                }
            }
            return(flag);
        }
示例#6
0
        private void BuildRecipientsFromCalendarItem()
        {
            MessageItem      messageItem      = (MessageItem)this.newItem;
            CalendarItemBase calendarItemBase = (CalendarItemBase)this.originalItem;

            if (calendarItemBase.Organizer != null)
            {
                messageItem.Recipients.Add(calendarItemBase.Organizer, RecipientItemType.To);
            }
            if (!this.isReplyAll)
            {
                return;
            }
            MailboxSession mailboxSession = calendarItemBase.Session as MailboxSession;

            foreach (Attendee attendee in calendarItemBase.AttendeeCollection)
            {
                if (!messageItem.Recipients.Contains(attendee.Participant) && (mailboxSession == null || !Participant.HasSameEmail(attendee.Participant, new Participant(mailboxSession.MailboxOwner))))
                {
                    if (attendee.AttendeeType == AttendeeType.Required)
                    {
                        messageItem.Recipients.Add(attendee.Participant, RecipientItemType.To);
                    }
                    else if (attendee.AttendeeType == AttendeeType.Optional)
                    {
                        messageItem.Recipients.Add(attendee.Participant, RecipientItemType.Cc);
                    }
                }
            }
        }
        public void EditResponseCalendarItem()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingInviteEventHandler.EditResponseCalendarItem");
            ResponseType     responseType     = (ResponseType)base.GetParameter("Rsp");
            CalendarItemBase calendarItemBase = null;

            try
            {
                calendarItemBase = base.GetRequestItem <CalendarItemBase>(new PropertyDefinition[0]);
                if (calendarItemBase != null)
                {
                    this.EditResponseInternal(responseType, calendarItemBase);
                    calendarItemBase.Load();
                    this.Writer.Write("<div id=nid>");
                    if (calendarItemBase.Id != null && calendarItemBase.Id.ObjectId != null)
                    {
                        this.Writer.Write(OwaStoreObjectId.CreateFromStoreObject(calendarItemBase).ToBase64String());
                    }
                    this.Writer.Write("</div>");
                }
            }
            finally
            {
                if (calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
        }
示例#8
0
        public override CalendarItemBase GetEmbeddedItem()
        {
            CalendarItemBase embeddedItem = base.GetEmbeddedItem();

            this.UpdateParticipantsOnCalendarItem(embeddedItem, true);
            return(embeddedItem);
        }
示例#9
0
        protected override void UpdateCalendarItemInternal(ref CalendarItemBase correlatedCalendarItem)
        {
            ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingRequest.UpdateCalendarItemInternal: GOID={0}", this.GlobalObjectId);
            CalendarItemBase calendarItemBase = null;

            try
            {
                calendarItemBase = base.GetCalendarItemToUpdate(correlatedCalendarItem);
                this.UpdateMeetingRequest(calendarItemBase);
                this.UpdateCalendarItemProperties(calendarItemBase);
                this.UpdateAttachmentsOnCalendarItem(calendarItemBase);
                this.UpdateParticipantsOnCalendarItem(calendarItemBase, false);
                ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Leaving Storage.MeetingRequest.UpdateCalendarItemInternal: GOID={0}", this.GlobalObjectId);
                if (correlatedCalendarItem == null)
                {
                    correlatedCalendarItem = calendarItemBase;
                }
            }
            finally
            {
                if (calendarItemBase != null && calendarItemBase != correlatedCalendarItem)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
        }
示例#10
0
 private List <Attendee> GetRumAttendees(CalendarItemBase calendarItem)
 {
     return(new List <Attendee>(1)
     {
         calendarItem.AttendeeCollection.Add(base.From, AttendeeType.Required, null, null, false)
     });
 }
示例#11
0
 public bool TryUpdateCalendarItem(ref CalendarItemBase originalCalendarItem, int defaultReminderMinutes, bool canUpdatePrincipalCalendar)
 {
     this.CheckDisposed("TryUpdateCalendarItem");
     base.CheckPreConditionForDelegatedMeeting(canUpdatePrincipalCalendar);
     this.consumerDefaultMinutesBeforeStart = defaultReminderMinutes;
     return(this.TryUpdateCalendarItem(ref originalCalendarItem, canUpdatePrincipalCalendar));
 }
示例#12
0
        internal static CalendarValidationContext CreateInstance(CalendarItemBase calendarItem, bool isOrganizer, UserObject localUser, UserObject remoteUser, CalendarVersionStoreGateway cvsGateway, AttendeeExtractor attendeeExtractor)
        {
            CalendarValidationContext calendarValidationContext = new CalendarValidationContext();

            calendarValidationContext.LocalUser  = localUser;
            calendarValidationContext.RemoteUser = remoteUser;
            if (isOrganizer)
            {
                calendarValidationContext.BaseRole     = RoleType.Organizer;
                calendarValidationContext.OppositeRole = RoleType.Attendee;
                calendarValidationContext.Organizer    = localUser;
                calendarValidationContext.Attendee     = remoteUser;
            }
            else
            {
                calendarValidationContext.BaseRole     = RoleType.Attendee;
                calendarValidationContext.OppositeRole = RoleType.Organizer;
                calendarValidationContext.Organizer    = remoteUser;
                calendarValidationContext.Attendee     = localUser;
            }
            calendarValidationContext.calendarItems = new Dictionary <RoleType, CalendarItemBase>(2);
            calendarValidationContext.calendarItems.Add(calendarValidationContext.BaseRole, calendarItem);
            calendarValidationContext.calendarItems.Add(calendarValidationContext.OppositeRole, null);
            calendarValidationContext.OrganizerRecurrence          = null;
            calendarValidationContext.OrganizerExceptions          = null;
            calendarValidationContext.OrganizerDeletions           = null;
            calendarValidationContext.AttendeeRecurrence           = null;
            calendarValidationContext.AttendeeExceptions           = null;
            calendarValidationContext.AttendeeDeletions            = null;
            calendarValidationContext.OppositeRoleOrganizerIsValid = false;
            calendarValidationContext.CvsGateway        = cvsGateway;
            calendarValidationContext.AttendeeExtractor = attendeeExtractor;
            return(calendarValidationContext);
        }
示例#13
0
        public static void RenderAttendees(TextWriter writer, AttendeeType type, CalendarItemBase item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            bool flag = true;
            int  num  = 0;

            foreach (Attendee attendee in item.AttendeeCollection)
            {
                if (attendee.AttendeeType == type)
                {
                    if (!flag && attendee.Participant.RoutingType != null)
                    {
                        writer.Write("; ");
                    }
                    AddressBookHelper.RenderParticipant(writer, num, attendee.Participant);
                    flag = false;
                }
                num++;
            }
            if (flag)
            {
                writer.Write("&nbsp;");
            }
        }
示例#14
0
        protected override void UpdateCalendarItemInternal(ref CalendarItemBase originalCalendarItem)
        {
            ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingCancellation.UpdateCalendarItemInternal: GOID={0}", this.GlobalObjectId);
            CalendarItemBase calendarItemBase = originalCalendarItem;

            if (base.IsOutOfDate(calendarItemBase))
            {
                ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingCancellation.UpdateCalendarItemInternal: GOID={0}; NOOP because message is out of date.", this.GlobalObjectId);
                return;
            }
            calendarItemBase = base.GetCalendarItemToUpdate(calendarItemBase);
            base.AdjustAppointmentState();
            calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(49781U);
            CalendarItemBase.CopyPropertiesTo(this, calendarItemBase, MeetingMessage.MeetingMessageProperties);
            this.CopyParticipantsToCalendarItem(calendarItemBase);
            string valueOrDefault = base.GetValueOrDefault <string>(InternalSchema.AppointmentClass);

            if (valueOrDefault != null && ObjectClass.IsDerivedClass(valueOrDefault, "IPM.Appointment"))
            {
                calendarItemBase.ClassName = valueOrDefault;
            }
            Microsoft.Exchange.Data.Storage.Item.CopyCustomPublicStrings(this, calendarItemBase);
            if (!base.IsRepairUpdateMessage)
            {
                calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(65013U);
                Body.CopyBody(this, calendarItemBase, false);
                calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(56821U);
                base.ReplaceAttachments(calendarItemBase);
            }
            calendarItemBase.FreeBusyStatus = BusyType.Free;
            calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(40437U);
            calendarItemBase[InternalSchema.AppointmentState] = base.AppointmentState;
            originalCalendarItem = calendarItemBase;
        }
        // Token: 0x06001566 RID: 5478 RVA: 0x0007DE58 File Offset: 0x0007C058
        protected CalendarItemBase GetCalendarItemBaseToReplyOrForward(CalendarItem item)
        {
            ExDateTime       occurrence = this.Occurrence;
            CalendarItemBase result     = null;

            if (occurrence == ExDateTime.MinValue)
            {
                result = item;
            }
            else
            {
                if (item.Recurrence == null)
                {
                    AirSyncDiagnostics.TraceError <string, ExDateTime>(ExTraceGlobals.RequestsTracer, this, "Failed to get occurrence of calendar item with subject: \"{0}\" with Start Time: {1}", item.Subject, occurrence);
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "NoRecurrenceInCalendar");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.NoRecurrenceInCalendar, null, false);
                }
                try
                {
                    CalendarItemOccurrence calendarItemOccurrence = item.OpenOccurrenceByOriginalStartTime(occurrence, null);
                    if (!item.IsMeeting)
                    {
                        calendarItemOccurrence.MakeModifiedOccurrence();
                    }
                    result = calendarItemOccurrence;
                }
                catch (OccurrenceNotFoundException innerException)
                {
                    AirSyncDiagnostics.TraceError <string, ExDateTime>(ExTraceGlobals.RequestsTracer, this, "OccurrenceNotFoundException getting occurrence of calendar item with subject: \"{0}\" with Start Time: {1}", item.Subject, occurrence);
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "NoInstanceInCalendar");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.NoRecurrenceInCalendar, innerException, false);
                }
            }
            return(result);
        }
示例#16
0
 internal void UpdateMeetingRequest(CalendarItemBase calendarItem)
 {
     ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingRequest.UpdateMeetingRequest: GOID={0}", this.GlobalObjectId);
     this.SetDefaultMeetingRequestTypeIfNeeded(calendarItem);
     this.UpdateIconIndex();
     base.AdjustAppointmentState();
     if (!calendarItem.IsNew)
     {
         if (calendarItem.CalendarItemType != CalendarItemType.RecurringMaster)
         {
             base.LocationIdentifierHelperInstance.SetLocationIdentifier(64629U);
             this[InternalSchema.OldStartWhole] = calendarItem.StartTime;
             this[InternalSchema.OldEndWhole]   = calendarItem.EndTime;
             this.SetCalendarProcessingSteps(CalendarProcessingSteps.CopiedOldProps);
         }
         string valueOrDefault = base.GetValueOrDefault <string>(InternalSchema.OldLocation, string.Empty);
         if (string.IsNullOrEmpty(valueOrDefault))
         {
             string location = calendarItem.Location;
             if (!string.IsNullOrEmpty(location))
             {
                 this.OldLocation = location;
                 this.SetCalendarProcessingSteps(CalendarProcessingSteps.CopiedOldProps);
             }
         }
         if (!PropertyError.IsPropertyError(calendarItem.TryGetProperty(CalendarItemBaseSchema.ResponseType)))
         {
             base.LocationIdentifierHelperInstance.SetLocationIdentifier(56437U);
             this[InternalSchema.ResponseState] = (int)calendarItem.ResponseType;
         }
     }
 }
示例#17
0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            CalendarItemBase calendarItemBase = (CalendarItemBase)base.XsoItem;

            calendarItemBase[ItemSchema.ReminderIsSet] = true;
            calendarItemBase[base.PropertyDef]         = ((IIntegerProperty)srcProperty).IntegerData;
        }
示例#18
0
        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);
                    }
                }
            }
        }
示例#19
0
 // Token: 0x0600079C RID: 1948 RVA: 0x000364A4 File Offset: 0x000346A4
 private static void AutoAcceptEvents(MailboxSession session, CalendarItemBase originalCalItem)
 {
     if (originalCalItem != null && !originalCalItem.IsCancelled)
     {
         bool flag;
         if (session.IsGroupMailbox())
         {
             CalendarProcessing.ProcessingRequestTracer.TraceDebug <IExchangePrincipal>(0L, "Processing meeting request for group mailbox {0}", session.MailboxOwner);
             originalCalItem.Reminder.IsSet = false;
             flag = false;
         }
         else
         {
             CalendarProcessing.ProcessingRequestTracer.TraceDebug <IExchangePrincipal>(0L, "Processing sent to self meeting request. Mailbox owner: {0}", session.MailboxOwner);
             flag = originalCalItem.ResponseRequested;
         }
         using (MeetingResponse meetingResponse = originalCalItem.RespondToMeetingRequest(ResponseType.Accept, true, flag, null, null))
         {
             if (flag)
             {
                 meetingResponse.Send();
             }
         }
         originalCalItem.Load();
     }
 }
示例#20
0
        private void CopyNlgPropertiesTo(CalendarItemBase calendarItem)
        {
            bool flag = false;

            foreach (PropertyExistenceTracker propertyDefinition in MeetingRequest.NlgExtractedExistenceProperties)
            {
                if (base.GetValueOrDefault <bool>(propertyDefinition, false))
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                base.Load(MeetingRequest.NlgExtractedProperties);
            }
            foreach (StorePropertyDefinition storePropertyDefinition in MeetingRequest.NlgExtractedProperties)
            {
                object obj = flag ? base.TryGetProperty(storePropertyDefinition) : null;
                if (obj != null && !PropertyError.IsPropertyError(obj))
                {
                    calendarItem[storePropertyDefinition] = obj;
                }
                else
                {
                    calendarItem.DeleteProperties(new PropertyDefinition[]
                    {
                        storePropertyDefinition
                    });
                }
            }
        }
        // Token: 0x06002DC1 RID: 11713 RVA: 0x00103500 File Offset: 0x00101700
        private MeetingRequest GetMeetingRequest(params PropertyDefinition[] prefetchProperties)
        {
            MeetingRequest result = null;

            try
            {
                result = base.GetRequestItem <MeetingRequest>(prefetchProperties);
            }
            catch (ObjectNotFoundException innerException)
            {
                if (!base.IsParameterSet("idci"))
                {
                    throw;
                }
                OwaStoreObjectId itemId = (OwaStoreObjectId)base.GetParameter("idci");
                int num;
                int num2;
                using (CalendarItemBase readOnlyRequestItem = base.GetReadOnlyRequestItem <CalendarItemBase>(itemId, new PropertyDefinition[0]))
                {
                    num  = (int)base.GetParameter("sn");
                    num2 = (int)readOnlyRequestItem[CalendarItemBaseSchema.AppointmentSequenceNumber];
                }
                if (num < num2)
                {
                    throw new OwaEventHandlerException("Meeting request must be out of date", LocalizedStrings.GetNonEncoded(2031473992), innerException);
                }
                throw;
            }
            return(result);
        }
示例#22
0
        public PublishedCalendarItemData GetItemData(StoreObjectId itemId)
        {
            base.CheckDisposed("GetItemData");
            PublishedCalendarItemData result;

            using (CalendarItemBase item = this.GetItem(itemId, null))
            {
                string bodyText = string.Empty;
                if (this.DetailLevel == DetailLevelEnumType.FullDetails)
                {
                    using (TextReader textReader = item.Body.OpenTextReader(BodyFormat.TextPlain))
                    {
                        bodyText = textReader.ReadToEnd();
                    }
                }
                result = new PublishedCalendarItemData
                {
                    Subject  = item.Subject,
                    Location = item.Location,
                    When     = item.GenerateWhen(),
                    BodyText = bodyText
                };
            }
            return(result);
        }
示例#23
0
 private bool ShouldSendRum(CalendarValidationContext context, Inconsistency inconsistency)
 {
     if (context.BaseRole == RoleType.Attendee && CalendarItemBase.IsTenantToBeFixed(context.BaseItem.Session as MailboxSession))
     {
         return(false);
     }
     if (inconsistency.Owner == context.BaseRole)
     {
         return(false);
     }
     if (!this.Policy.ContainsRepairFlag(inconsistency.Flag))
     {
         return(false);
     }
     if (context.AttendeeItem != null && context.OrganizerItem != null && context.AttendeeItem.CalendarItemType == CalendarItemType.Occurrence && context.OrganizerItem.CalendarItemType == CalendarItemType.Occurrence)
     {
         return(false);
     }
     if (context.RemoteUser.ExchangePrincipal == null)
     {
         return(false);
     }
     if (this.CheckServerVersion(context, inconsistency))
     {
         CalendarProcessingFlags?calendarConfig = context.CalendarInstance.GetCalendarConfig();
         return(calendarConfig != null && (inconsistency.Flag != CalendarInconsistencyFlag.MissingItem || !context.HasSentUpdateForItemOrMaster) && calendarConfig.Value == CalendarProcessingFlags.AutoUpdate);
     }
     return(false);
 }
示例#24
0
        internal static List <MeetingData> GetCorrelatedMeetings(MailboxSession session, UserObject mailboxUser, StoreId meetingId)
        {
            List <MeetingData> list = new List <MeetingData>();

            using (CalendarItemBase calendarItemBase = CalendarItemBase.Bind(session, meetingId, CalendarQuery.CalendarQueryProps))
            {
                MeetingData item = MeetingData.CreateInstance(mailboxUser, calendarItemBase);
                list.Add(item);
                if (calendarItemBase.CalendarItemType == CalendarItemType.RecurringMaster)
                {
                    try
                    {
                        IList <OccurrenceInfo> modifiedOccurrences = (calendarItemBase as CalendarItem).Recurrence.GetModifiedOccurrences();
                        foreach (OccurrenceInfo occurrenceInfo in modifiedOccurrences)
                        {
                            MeetingData item2 = MeetingData.CreateInstance(mailboxUser, occurrenceInfo.VersionedId, calendarItemBase.GlobalObjectId, CalendarItemType.Exception);
                            list.Add(item2);
                        }
                    }
                    catch (RecurrenceFormatException)
                    {
                    }
                }
            }
            return(list);
        }
示例#25
0
        // Token: 0x060013F3 RID: 5107 RVA: 0x000735A4 File Offset: 0x000717A4
        public IEnumerator <AttendeeData> GetEnumerator()
        {
            CalendarItemBase calItem = base.XsoItem as CalendarItemBase;

            if (calItem == null)
            {
                throw new UnexpectedTypeException("CalendarItemBase", base.XsoItem);
            }
            AirSyncDiagnostics.TraceInfo <int, GlobalObjectId>(ExTraceGlobals.XsoTracer, this, "Adding Attendees to meeting request.Count :{0}, GlobalObjectID: {1}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId);
            bool anyAttendeeAdded = false;

            foreach (Attendee attendee in calItem.AttendeeCollection)
            {
                if (!attendee.IsOrganizer)
                {
                    if (attendee.Participant.EmailAddress != null)
                    {
                        anyAttendeeAdded = true;
                        yield return(new AttendeeData(EmailAddressConverter.LookupEmailAddressString(attendee.Participant, calItem.Session.MailboxOwner), attendee.Participant.DisplayName));
                    }
                    else
                    {
                        AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.XsoTracer, this, "Attendee '{0}' skipped because there is no email address. Meeting Subject:'{1}'.", (attendee.Participant.DisplayName == null) ? "<Null>" : attendee.Participant.DisplayName, calItem.Subject);
                    }
                }
            }
            if (!anyAttendeeAdded && !calItem.IsOrganizer() && calItem.IsMeeting && calItem.AttendeeCollection.Count > 0)
            {
                AirSyncDiagnostics.TraceDebug <int, GlobalObjectId, string>(ExTraceGlobals.XsoTracer, this, "No Attendees were added for this meeting, Adding current user as default attendee. Actual Attendees Count: {0}, GlobalObjectId:{1}, Subject:{2}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId, calItem.Subject);
                Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ExplictlyAddingUserToMeeting");
                MailboxSession session = (MailboxSession)calItem.Session;
                yield return(new AttendeeData(session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), session.MailboxOwner.MailboxInfo.DisplayName));
            }
            yield break;
        }
示例#26
0
        internal static CalendarItemBase FindMatchingItem(MailboxSession session, CalendarFolder calendarFolder, CalendarItemType itemType, byte[] globalId, ref string errorString)
        {
            VersionedId calendarItemId = calendarFolder.GetCalendarItemId(globalId);

            if (calendarItemId == null)
            {
                errorString = string.Format("FindMatchingItem: Could not find calendar item, itemId is null. ", new object[0]);
                return(null);
            }
            CalendarItemBase result;

            try
            {
                result = CalendarItemBase.Bind(session, calendarItemId, CalendarQuery.CalendarQueryProps);
            }
            catch (ObjectNotFoundException ex)
            {
                errorString = string.Format("[{0}(UTC)] FindMatchingItem: Could not find calendar item, exception = {1}. ", ExDateTime.UtcNow, ex.GetType());
                result      = null;
            }
            catch (ArgumentException ex2)
            {
                errorString = string.Format("[{0}(UTC)] FindMatchingItem: Could not bind to item as CalendarItemBase, exception = {1}. ", ExDateTime.UtcNow, ex2.GetType());
                result      = null;
            }
            return(result);
        }
示例#27
0
        internal static bool IsCalendarItemEndTimeInPast(CalendarItemBase calendarItemBase)
        {
            if (calendarItemBase == null)
            {
                throw new ArgumentNullException("calendarItemBase");
            }
            ExDateTime localTime = DateTimeUtilities.GetLocalTime();
            bool       result    = false;

            if (calendarItemBase.CalendarItemType == CalendarItemType.RecurringMaster)
            {
                CalendarItem calendarItem = (CalendarItem)calendarItemBase;
                if (!(calendarItem.Recurrence.Range is NoEndRecurrenceRange))
                {
                    OccurrenceInfo lastOccurrence = calendarItem.Recurrence.GetLastOccurrence();
                    if (lastOccurrence != null && lastOccurrence.EndTime < localTime)
                    {
                        result = true;
                    }
                }
            }
            else if (calendarItemBase.EndTime < localTime)
            {
                result = true;
            }
            return(result);
        }
示例#28
0
        private Inconsistency GetAttendeeMissingItemInconsistency(CalendarValidationContext context, string fullDescription, ClientIntentQuery.QueryResult inconsistencyIntent, ClientIntentFlags declineIntent, ClientIntentFlags deleteIntent)
        {
            Inconsistency inconsistency = null;

            if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent.Intent, new ClientIntentFlags[]
            {
                declineIntent
            }))
            {
                inconsistency        = ResponseInconsistency.CreateInstance(fullDescription, ResponseType.Decline, context.Attendee.ResponseType, ExDateTime.MinValue, context.Attendee.ReplyTime, context);
                inconsistency.Intent = inconsistencyIntent.Intent;
            }
            else if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent.Intent, new ClientIntentFlags[]
            {
                deleteIntent
            }))
            {
                inconsistency = null;
            }
            else if (inconsistencyIntent.SourceVersionId != null)
            {
                int?deletedItemVersion = null;
                using (CalendarItemBase calendarItemBase = CalendarItemBase.Bind(this.session, inconsistencyIntent.SourceVersionId))
                {
                    deletedItemVersion = calendarItemBase.GetValueAsNullable <int>(CalendarItemBaseSchema.ItemVersion);
                }
                if (deletedItemVersion != null)
                {
                    inconsistency        = MissingItemInconsistency.CreateAttendeeMissingItemInstance(fullDescription, inconsistencyIntent.Intent, deletedItemVersion, context);
                    inconsistency.Intent = inconsistencyIntent.Intent;
                }
            }
            return(inconsistency);
        }
 public override CalendarItemBase TryGetCorrelatedItemFromHintId(MailboxSession session, StoreObjectId hintId)
 {
     if (hintId != null)
     {
         try
         {
             CalendarItemBase calendarItemBase = CalendarItemBase.Bind(session, hintId);
             if (!this.ValidateCorrelatedItem(calendarItemBase))
             {
                 calendarItemBase.Dispose();
                 throw new CorrelationFailedException(ServerStrings.ExCorrelationFailedForOccurrence(this.Subject));
             }
             calendarItemBase.OpenAsReadWrite();
             calendarItemBase.IsCorrelated       = true;
             this.correlatedItemId               = calendarItemBase.Id;
             calendarItemBase.AssociatedItemId   = base.Id;
             this.externalCorrelatedCalendarItem = calendarItemBase;
             this.getCorrelatedItemCalled        = true;
             return(calendarItemBase);
         }
         catch (Exception arg)
         {
             ExTraceGlobals.MeetingMessageTracer.TraceError <string, Exception>((long)this.GetHashCode(), "Exception thrown when trying to bind to calendar item id hint passed from meeting series message ordering agent. Mailbox = {0}, exception = {1}.", session.MailboxOwnerLegacyDN, arg);
         }
     }
     return(null);
 }
示例#30
0
 private static void DefaultCopy(PreservablePropertyContext context, StorePropertyDefinition prop)
 {
     CalendarItemBase.CopyPropertiesTo(context.MeetingRequest, context.CalendarItem, new PropertyDefinition[]
     {
         prop
     });
 }