void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     CommonUtils.ProcessInBatches <byte[]>(entryIds, 1000, delegate(byte[][] batch)
     {
         this.MrsProxy.IDestinationFolder_SetReadFlagsOnMessages(this.Handle, (int)flags, batch);
     });
 }
Exemplo n.º 2
0
        internal int GetSetReadFlag()
        {
            int num = this.markMsgFlagsToSet & FlagStatusInternal.GetSetReadFlagsBitMask();

            if (num == 0)
            {
                return(-1);
            }
            SetReadFlags setReadFlags = SetReadFlags.None;

            if ((num & 1) != 0)
            {
                if ((this.msgFlags & 1) != 0)
                {
                    setReadFlags = setReadFlags;
                }
                else
                {
                    setReadFlags |= SetReadFlags.ClearRead;
                }
            }
            if ((num & 512) != 0 && (this.msgFlags & 512) != 0)
            {
                setReadFlags |= SetReadFlags.SuppressReceipt;
            }
            return((int)setReadFlags);
        }
Exemplo n.º 3
0
        private void SetReadFlagsInternal(SetReadFlags flags)
        {
            StoreSession session = base.Session;
            bool         flag    = false;

            try
            {
                if (session != null)
                {
                    session.BeginMapiCall();
                    session.BeginServerHealthCall();
                    flag = true;
                }
                if (StorageGlobals.MapiTestHookBeforeCall != null)
                {
                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                }
                base.MapiMessage.SetReadFlag(flags);
            }
            catch (MapiPermanentException ex)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotSetReadFlags, ex, session, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("PostItem::SetReadFlagsInternal.", new object[0]),
                    ex
                });
            }
            catch (MapiRetryableException ex2)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotSetReadFlags, ex2, session, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("PostItem::SetReadFlagsInternal.", new object[0]),
                    ex2
                });
            }
            finally
            {
                try
                {
                    if (session != null)
                    {
                        session.EndMapiCall();
                        if (flag)
                        {
                            session.EndServerHealthCall();
                        }
                    }
                }
                finally
                {
                    if (StorageGlobals.MapiTestHookAfterCall != null)
                    {
                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                    }
                }
            }
        }
 void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     MapiUtils.ProcessMapiCallInBatches <byte[]>(entryIds, delegate(byte[][] batch)
     {
         using (this.Mailbox.RHTracker.Start())
         {
             this.Folder.SetReadFlags(flags, batch);
         }
     });
 }
Exemplo n.º 5
0
 void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     base.CreateContext("IDestinationFolder.SetReadFlagsOnMessages", new DataContext[]
     {
         new SimpleValueDataContext("Flags", flags),
         new EntryIDsDataContext(entryIds)
     }).Execute(delegate
     {
         ((IDestinationFolder)this.WrappedObject).SetReadFlagsOnMessages(flags, entryIds);
     }, true);
 }
 void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     MrsTracer.Provider.Function("StorageDestinationFolder.SetReadFlagsOnMessages: {0}", new object[]
     {
         base.DisplayNameForTracing
     });
     MapiUtils.ProcessMapiCallInBatches <byte[]>(entryIds, delegate(byte[][] batch)
     {
         StoreObjectId[] array = new StoreObjectId[batch.Length];
         for (int i = 0; i < batch.Length; i++)
         {
             array[i] = StoreObjectId.FromProviderSpecificId(batch[i]);
         }
         using (this.Mailbox.RHTracker.Start())
         {
             bool flag;
             this.CoreFolder.SetReadFlags((int)flags, array, out flag);
         }
     });
 }
Exemplo n.º 7
0
        internal ReplyForwardCommon(Item originalItem, Item newItem, ReplyForwardConfiguration parameters, bool decodeSmime)
        {
            Util.ThrowOnNullArgument(parameters, "parameters");
            if (decodeSmime && ObjectClass.IsSmime(originalItem.ClassName))
            {
                if (parameters.ConversionOptionsForSmime == null || parameters.ConversionOptionsForSmime.IgnoreImceaDomain || parameters.ConversionOptionsForSmime.ImceaEncapsulationDomain == null)
                {
                    throw new InvalidOperationException("Cannot decode SMIME without valid ConversionOptionsForSmime");
                }
                this.originalItem = originalItem;
                MessageItem messageItem = originalItem as MessageItem;
                if (messageItem != null)
                {
                    Item item = messageItem.FetchSmimeContent(parameters.ConversionOptionsForSmime.ImceaEncapsulationDomain);
                    if (item != null)
                    {
                        this.originalItem = item;
                        this.originalItem[InternalSchema.NormalizedSubjectInternal] = messageItem.GetValueOrDefault <string>(InternalSchema.NormalizedSubjectInternal, string.Empty);
                        this.originalItem[InternalSchema.Sender] = messageItem.Sender;
                        this.originalItem[InternalSchema.From]   = messageItem.From;
                    }
                }
            }
            else
            {
                this.originalItem = originalItem;
            }
            this.newItem    = newItem;
            this.parameters = parameters;
            this.culture    = ReplyForwardUtils.CalculateReplyForwardCulture(parameters.Culture, newItem);
            if (this.culture == null)
            {
                throw new InvalidOperationException("Forward message culture is unknown");
            }
            this.FetchPropertiesFromOriginalItem();
            if (originalItem is MessageItem)
            {
                if (originalItem.MapiMessage != null)
                {
                    SetReadFlags readFlag = parameters.ShouldSuppressReadReceipt ? SetReadFlags.SuppressReceipt : SetReadFlags.None;
                    try
                    {
                        StoreSession session = originalItem.Session;
                        bool         flag    = false;
                        try
                        {
                            if (session != null)
                            {
                                session.BeginMapiCall();
                                session.BeginServerHealthCall();
                                flag = true;
                            }
                            if (StorageGlobals.MapiTestHookBeforeCall != null)
                            {
                                StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                            }
                            originalItem.MapiMessage.SetReadFlag(readFlag);
                        }
                        catch (MapiPermanentException ex)
                        {
                            throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotSetReadFlags, ex, session, this, "{0}. MapiException = {1}.", new object[]
                            {
                                string.Format("ReplyForwardCommon::ctor.", new object[0]),
                                ex
                            });
                        }
                        catch (MapiRetryableException ex2)
                        {
                            throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotSetReadFlags, ex2, session, this, "{0}. MapiException = {1}.", new object[]
                            {
                                string.Format("ReplyForwardCommon::ctor.", new object[0]),
                                ex2
                            });
                        }
                        finally
                        {
                            try
                            {
                                if (session != null)
                                {
                                    session.EndMapiCall();
                                    if (flag)
                                    {
                                        session.EndServerHealthCall();
                                    }
                                }
                            }
                            finally
                            {
                                if (StorageGlobals.MapiTestHookAfterCall != null)
                                {
                                    StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                                }
                            }
                        }
                    }
                    catch (StoragePermanentException)
                    {
                    }
                    catch (StorageTransientException)
                    {
                    }
                }
                (this.originalItem as MessageItem).IsRead = true;
            }
            else if (this.originalItem is CalendarItemOccurrence)
            {
                this.parentPropValues[ParentPropertyIndex.IsRecurring]               = true;
                this.parentPropValues[ParentPropertyIndex.AppointmentRecurring]      = false;
                this.parentPropValues[ParentPropertyIndex.RecurrenceType]            = 0;
                this.parentPropValues[ParentPropertyIndex.TimeZoneBlob]              = new PropertyError(InternalSchema.TimeZoneBlob, PropertyErrorCode.NotFound);
                this.parentPropValues[ParentPropertyIndex.AppointmentRecurrenceBlob] = new PropertyError(InternalSchema.AppointmentRecurrenceBlob, PropertyErrorCode.NotFound);
                this.parentPropValues[ParentPropertyIndex.IsException]               = true;
                if (string.IsNullOrEmpty(this.parentPropValues[ParentPropertyIndex.RecurrencePattern] as string))
                {
                    CalendarItemOccurrence calendarItemOccurrence = this.originalItem as CalendarItemOccurrence;
                    this.parentPropValues[ParentPropertyIndex.RecurrencePattern] = calendarItemOccurrence.OccurrencePropertyBag.MasterCalendarItem.GenerateWhen();
                }
            }
            string valueOrDefault = originalItem.GetValueOrDefault <string>(InternalSchema.ItemClass, string.Empty);

            this.originalItemSigned = (ObjectClass.IsOfClass(valueOrDefault, "IPM.Note.Secure.Sign") || ObjectClass.IsSmimeClearSigned(valueOrDefault));
            if (!this.originalItemSigned)
            {
                this.originalItemEncrypted = (ObjectClass.IsOfClass(valueOrDefault, "IPM.Note.Secure") || ObjectClass.IsSmime(valueOrDefault));
            }
            string valueOrDefault2 = originalItem.GetValueOrDefault <string>(InternalSchema.ContentClass, string.Empty);

            this.originalItemIrm = ObjectClass.IsRightsManagedContentClass(valueOrDefault2);
        }
Exemplo n.º 8
0
 void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     throw new NotImplementedException();
 }