Esempio n. 1
0
        // Token: 0x06000796 RID: 1942 RVA: 0x00035ED0 File Offset: 0x000340D0
        private void TryUnparkInstanceMessages(MailboxSession session, string seriesId, int seriesSequenceNumber)
        {
            string        correlationId   = ParkedMeetingMessage.GetCorrelationId(seriesId, seriesSequenceNumber);
            StoreObjectId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.ParkedMessages);

            if (defaultFolderId != null)
            {
                using (Folder folder = Folder.Bind(session, DefaultFolderType.ParkedMessages))
                {
                    using (QueryResult queryResult = folder.ItemQuery(ItemQueryType.None, null, new SortBy[]
                    {
                        new SortBy(ParkedMeetingMessageSchema.ParkedCorrelationId, SortOrder.Ascending),
                        new SortBy(StoreObjectSchema.ItemClass, SortOrder.Ascending)
                    }, new PropertyDefinition[]
                    {
                        ParkedMeetingMessageSchema.ParkedCorrelationId,
                        ItemSchema.Id,
                        StoreObjectSchema.ItemClass
                    }))
                    {
                        QueryFilter seekFilter = new AndFilter(new QueryFilter[]
                        {
                            new ComparisonFilter(ComparisonOperator.Equal, ParkedMeetingMessageSchema.ParkedCorrelationId, correlationId),
                            new ComparisonFilter(ComparisonOperator.Equal, StoreObjectSchema.ItemClass, "IPM.Parked.MeetingMessage")
                        });
                        queryResult.SeekToCondition(SeekReference.OriginBeginning, seekFilter, SeekToConditionFlags.AllowExtendedFilters);
                        IStorePropertyBag[] propertyBags;
                        do
                        {
                            propertyBags = queryResult.GetPropertyBags(50);
                            foreach (IStorePropertyBag storePropertyBag in propertyBags)
                            {
                                string valueOrDefault  = storePropertyBag.GetValueOrDefault <string>(ParkedMeetingMessageSchema.ParkedCorrelationId, null);
                                string valueOrDefault2 = storePropertyBag.GetValueOrDefault <string>(StoreObjectSchema.ItemClass, null);
                                if (!(correlationId == valueOrDefault) || !ObjectClass.IsParkedMeetingMessage(valueOrDefault2))
                                {
                                    goto IL_10C;
                                }
                                this.UnparkMessage(session, storePropertyBag);
                            }
                        }while (propertyBags.Length > 0);
                        IL_10C :;
                    }
                }
            }
        }
Esempio n. 2
0
        // Token: 0x06000797 RID: 1943 RVA: 0x0003604C File Offset: 0x0003424C
        private void UnparkMessage(MailboxSession session, IStorePropertyBag rowPropertyBag)
        {
            VersionedId valueOrDefault = rowPropertyBag.GetValueOrDefault <VersionedId>(ItemSchema.Id, null);

            try
            {
                using (ParkedMeetingMessage parkedMeetingMessage = ParkedMeetingMessage.Bind(session, valueOrDefault, new PropertyDefinition[0]))
                {
                    IExchangePrincipal mailboxOwner = session.MailboxOwner;
                    parkedMeetingMessage.Recipients.Clear();
                    Participant participant = new Participant(mailboxOwner.MailboxInfo.DisplayName, mailboxOwner.LegacyDn, "EX");
                    parkedMeetingMessage.Recipients.Add(participant);
                    parkedMeetingMessage.From = participant;
                    parkedMeetingMessage.SendWithoutSavingMessage(SubmitMessageFlags.None);
                }
            }
            catch (ObjectNotFoundException arg)
            {
                CalendarProcessing.ProcessingTracer.TraceWarning <VersionedId, ObjectNotFoundException>((long)this.GetHashCode(), "Cannot find parked message any more - skipping. Id: {0}, exception {1}", valueOrDefault, arg);
            }
        }
Esempio n. 3
0
        private bool TryParkThisMessage(StoreDriverDeliveryEventArgsImpl args, MeetingSeriesMessageOrderingAgent.SeriesHeadersData headersData)
        {
            Guid networkMessageId = args.MailItemDeliver.MbxTransportMailItem.NetworkMessageId;

            this.AddUnparkedHeader(args.MailItem.Message.MimeDocument.RootPart.Headers, networkMessageId);
            bool   encapsulationSucceeded = true;
            string text;
            bool   encapsulationSucceeded2;

            using (EmailMessage emailMessage = ModerationHelper.EncapsulateOriginalMessage(args.MailItemDeliver.MbxTransportMailItem, new List <MailRecipient>
            {
                args.MailRecipient
            }, args.MailRecipient.Email.ToString(), args.MailRecipient.Email.ToString(), MeetingSeriesMessageOrderingAgent.tracer, delegate(Exception param0)
            {
                encapsulationSucceeded = false;
            }, out text))
            {
                if (encapsulationSucceeded)
                {
                    MailboxSession mailboxSession = args.MailboxSession;
                    using (ParkedMeetingMessage parkedMeetingMessage = ParkedMeetingMessage.Create(mailboxSession))
                    {
                        if (parkedMeetingMessage != null)
                        {
                            string internetMessageId = args.MailItemDeliver.MbxTransportMailItem.InternetMessageId;
                            ItemConversion.ConvertAnyMimeToItem(parkedMeetingMessage, emailMessage.MimeDocument, new InboundConversionOptions(args.ADRecipientCache));
                            parkedMeetingMessage.ParkedCorrelationId          = ParkedMeetingMessage.GetCorrelationId(headersData.SeriesId, headersData.SeriesSequenceNumber);
                            parkedMeetingMessage[StoreObjectSchema.ItemClass] = "IPM.Parked.MeetingMessage";
                            parkedMeetingMessage.CleanGlobalObjectId          = headersData.InstanceGoid;
                            parkedMeetingMessage.OriginalMessageId            = internetMessageId;
                            int retentionPeriod = MeetingSeriesMessageOrderingAgent.GetRetentionPeriod(args.MailboxOwner);
                            PolicyTagHelper.SetRetentionProperties(parkedMeetingMessage, ExDateTime.UtcNow.AddDays((double)retentionPeriod), retentionPeriod);
                            parkedMeetingMessage.Save(SaveMode.NoConflictResolution);
                        }
                    }
                }
                encapsulationSucceeded2 = encapsulationSucceeded;
            }
            return(encapsulationSucceeded2);
        }