// Token: 0x060003D4 RID: 980 RVA: 0x0001B9C0 File Offset: 0x00019BC0
        private bool PreScreenPassed(object[] itemProperties, PropertyIndexHolder propertyIndexHolder, out string itemClass)
        {
            itemClass = null;
            VersionedId versionedId = itemProperties[propertyIndexHolder.IdIndex] as VersionedId;

            if (versionedId == null)
            {
                ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: We could not get id of this item. Skipping it.", this);
                return(false);
            }
            StoreObjectId storeObjectId = itemProperties[propertyIndexHolder.ParentItemIdIndex] as StoreObjectId;

            if (storeObjectId == null)
            {
                ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: We could not get parent id of this item. Skipping it.", this);
                return(false);
            }
            if (base.MailboxDataForTags.CorruptItemList.Contains(versionedId.ObjectId))
            {
                ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer, VersionedId>((long)this.GetHashCode(), "{0}: The item {1} is in the corrupt list. Skipping it.", this, versionedId);
                return(false);
            }
            itemClass = (itemProperties[propertyIndexHolder.ItemClassIndex] as string);
            itemClass = ((itemClass == null) ? string.Empty : itemClass.ToLower(CultureInfo.InvariantCulture));
            return(TagAssistantHelper.IsRetainableItem(itemClass) && (!TagAssistantHelper.IsConflictableItem(itemClass, storeObjectId.ProviderLevelItemId, this.deletedItemsId) || base.ElcTagSubAssistant.ELCAssistantCalendarTaskRetentionEnabled));
        }
Esempio n. 2
0
 // Token: 0x0600049E RID: 1182 RVA: 0x00021E0A File Offset: 0x0002000A
 private bool IsConflictableItem(string itemClass)
 {
     if (TagAssistantHelper.IsConflictableItemClass(itemClass) && this.folderType != DefaultFolderType.DeletedItems)
     {
         PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer, DefaultFolderType>((long)this.GetHashCode(), "{0}: Item is conflictable and not in deleted items folder. Folder: {1}. Skipping it.", this, this.folderType);
         return(true);
     }
     return(false);
 }
 // Token: 0x06000383 RID: 899 RVA: 0x00018855 File Offset: 0x00016A55
 internal static bool IsConflictableItem(string itemClass, byte[] currentFolderId, byte[] deletedItemsFolderId)
 {
     if (TagAssistantHelper.IsConflictableItemClass(itemClass) && !ArrayComparer <byte> .Comparer.Equals(currentFolderId, deletedItemsFolderId))
     {
         TagAssistantHelper.Tracer.TraceDebug <string, byte[]>(0L, "Item is of message class {0}, in folder {1} and is hence conflictable.", itemClass, currentFolderId);
         return(true);
     }
     return(false);
 }
        // Token: 0x060004A2 RID: 1186 RVA: 0x00021FA8 File Offset: 0x000201A8
        public bool IsEventInteresting(MapiEvent mapiEvent)
        {
            ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "MapiEvent is dispatched: {0}", mapiEvent);
            if (!this.IsEventRelevant(mapiEvent))
            {
                return(false);
            }
            CachedState cachedState = AssistantsService.CachedObjectsList.GetCachedState(mapiEvent.MailboxGuid);
            UserRetentionPolicyCache userRetentionPolicyCache = RetentionPolicyCheck.QuickCheckForRetentionPolicy(mapiEvent, cachedState);

            if (userRetentionPolicyCache == null || userRetentionPolicyCache.UnderRetentionPolicy)
            {
                bool flag = RetentionPolicyCheck.IsEventConfigChange(mapiEvent);
                if (flag)
                {
                    RetentionPolicyCheck.UpdateStateForPendingFaiEvent(mapiEvent.EventCounter, cachedState);
                    ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because it is a change to our FAI: {1}", TraceContext.Get(), mapiEvent);
                    return(true);
                }
                if (RetentionPolicyCheck.IsAutoTagFai(mapiEvent))
                {
                    ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because it is a change to an Autotag FAI: {1}", TraceContext.Get(), mapiEvent);
                    return(true);
                }
                MapiEventTypeFlags mapiEventTypeFlags = MapiEventTypeFlags.ObjectCreated | MapiEventTypeFlags.ObjectModified | MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied;
                if ((mapiEvent.EventMask & mapiEventTypeFlags) != (MapiEventTypeFlags)0)
                {
                    if (mapiEvent.ClientType == MapiEventClientTypes.Transport && userRetentionPolicyCache != null && !this.InSentItems(userRetentionPolicyCache, mapiEvent))
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Event is from transport and item not in SentItems. Ignoring from IsEventInteresting. Mapievent: {0}", mapiEvent);
                        return(false);
                    }
                    if (userRetentionPolicyCache != null && !this.IsEventOnRelevantFolder(userRetentionPolicyCache, mapiEvent))
                    {
                        return(false);
                    }
                    if (userRetentionPolicyCache != null && TagAssistantHelper.IsConflictableItem(mapiEvent.ObjectClass, mapiEvent.ParentEntryId, userRetentionPolicyCache.DeletedItemsId))
                    {
                        return(false);
                    }
                    MapiEventTypeFlags mapiEventTypeFlags2 = MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied;
                    if (mapiEvent.ItemType == ObjectType.MAPI_FOLDER && (mapiEvent.EventMask & mapiEventTypeFlags2) != (MapiEventTypeFlags)0)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because is a moved folder: {1}", TraceContext.Get(), mapiEvent);
                        return(true);
                    }
                    if (mapiEvent.ItemType == ObjectType.MAPI_MESSAGE)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because is a message: {1}", TraceContext.Get(), mapiEvent);
                        return(true);
                    }
                }
            }
            return(false);
        }
        // Token: 0x06000380 RID: 896 RVA: 0x000187A0 File Offset: 0x000169A0
        internal static bool IsRetainableItem(UserRetentionPolicyCache mailboxState, MailboxSession mailboxSession, StoreObjectId parentId, StoreObject item)
        {
            DefaultFolderType parentDefaultFolderType = TagAssistantHelper.GetParentDefaultFolderType(mailboxState, mailboxSession, parentId);

            if (UserRetentionPolicyCache.IsFolderTypeToSkip(parentDefaultFolderType))
            {
                TagAssistantHelper.Tracer.TraceDebug <DefaultFolderType>(0L, "Current item is in folder {0} (or a sub-folder) that should not be processed.", parentDefaultFolderType);
                return(false);
            }
            return(TagAssistantHelper.IsRetainableItem(item.ClassName));
        }
Esempio n. 6
0
        // Token: 0x06000497 RID: 1175 RVA: 0x000212CC File Offset: 0x0001F4CC
        private void UpdateContentSettingProperties(bool tagChanged, Guid updatedTagGuid, DateTime updatedStartDate, string itemClass, object[] itemProperties)
        {
            if (!tagChanged && updatedTagGuid.Equals(Guid.Empty))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: No need to update ContentSettings since tag is null and there was no change.", this);
                return;
            }
            int num = -1;

            if (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int)
            {
                num = (int)itemProperties[this.propertyIndexHolder.RetentionPeriodIndex];
            }
            DateTime dateTime = DateTime.MinValue;

            if (itemProperties[this.propertyIndexHolder.RetentionDateIndex] is ExDateTime)
            {
                dateTime = (DateTime)((ExDateTime)itemProperties[this.propertyIndexHolder.RetentionDateIndex]).ToUtc();
            }
            if (tagChanged && updatedTagGuid.Equals(Guid.Empty))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Tag is null, so we need to delete the Retention Date & Retention Period.", this);
                if (dateTime != DateTime.MinValue)
                {
                    base.PropertiesToBeDeleted.Add(ItemSchema.RetentionDate);
                }
                if (num != -1)
                {
                    base.PropertiesToBeDeleted.Add(StoreObjectSchema.RetentionPeriod);
                }
                return;
            }
            int      retentionPeriod = this.GetRetentionPeriod(updatedTagGuid, itemClass);
            DateTime retentionDate   = this.GetRetentionDate(updatedStartDate, retentionPeriod);

            if (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int && num != retentionPeriod)
            {
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Retention period needs to be updated.", this);
                base.PropertiesToBeUpdated.Add(StoreObjectSchema.RetentionPeriod, retentionPeriod);
            }
            if (!TagAssistantHelper.DateSlushyEquals(new DateTime?(retentionDate), new DateTime?(dateTime)))
            {
                if (retentionDate == DateTime.MinValue)
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Retention date needs to be deleted.", this);
                    base.PropertiesToBeDeleted.Add(ItemSchema.RetentionDate);
                    return;
                }
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Retention date needs to be updated.", this);
                base.PropertiesToBeUpdated.Add(ItemSchema.RetentionDate, retentionDate);
            }
        }
Esempio n. 7
0
        // Token: 0x06000448 RID: 1096 RVA: 0x0001E678 File Offset: 0x0001C878
        private void UpdateRetentionFlags(Guid retentionTagToUpdateTo)
        {
            RetentionAndArchiveFlags retentionAndArchiveFlags = TagAssistantHelper.UpdatePersonalTagBit((!base.ElcUserTagInformation.ContainsTag(retentionTagToUpdateTo)) ? null : base.ElcUserTagInformation.GetTag(retentionTagToUpdateTo), this.originalRetentionFlags);

            if (retentionTagToUpdateTo.Equals(Guid.Empty))
            {
                retentionAndArchiveFlags = FlagsMan.ClearAllRetentionFlags(retentionAndArchiveFlags);
            }
            else if (this.explicitRetention)
            {
                retentionAndArchiveFlags = (RetentionAndArchiveFlags)FlagsMan.SetExplicit((int)retentionAndArchiveFlags);
            }
            else
            {
                retentionAndArchiveFlags = (RetentionAndArchiveFlags)FlagsMan.ClearExplicit((int)retentionAndArchiveFlags);
            }
            if (this.effectiveArchiveGuid == null || this.effectiveArchiveGuid.Equals(Guid.Empty))
            {
                retentionAndArchiveFlags = FlagsMan.ClearAllArchiveFlags(retentionAndArchiveFlags);
            }
            else if (this.explicitArchive)
            {
                retentionAndArchiveFlags = FlagsMan.SetExplicitArchiveFlag(retentionAndArchiveFlags);
            }
            else
            {
                retentionAndArchiveFlags = FlagsMan.ClearExplicitArchiveFlag(retentionAndArchiveFlags);
            }
            retentionAndArchiveFlags = FlagsMan.SetPendingRescan(retentionAndArchiveFlags);
            retentionAndArchiveFlags = FlagsMan.ClearNeedRescan(retentionAndArchiveFlags);
            if (retentionAndArchiveFlags != this.originalRetentionFlags)
            {
                if (retentionAndArchiveFlags == RetentionAndArchiveFlags.None)
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: The flags bit on the folder will be removed.", this);
                    base.PropertiesToBeDeleted.Add(StoreObjectSchema.RetentionFlags);
                    base.FolderProperties[3] = null;
                    return;
                }
                PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer, RetentionAndArchiveFlags, RetentionAndArchiveFlags>((long)this.GetHashCode(), "{0}: The flags bit on the folder will be updated. ExpectedFlags: {1}. OriginalFlags: {2}. ", this, retentionAndArchiveFlags, this.originalRetentionFlags);
                base.PropertiesToBeUpdated.Add(StoreObjectSchema.RetentionFlags, (int)retentionAndArchiveFlags);
                base.FolderProperties[3] = (int)retentionAndArchiveFlags;
            }
        }
        // Token: 0x060004A3 RID: 1187 RVA: 0x00022124 File Offset: 0x00020324
        protected override void HandleEventInternal(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item, List <KeyValuePair <string, object> > customDataToLog)
        {
            ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "MapiEvent is handled: {0}", mapiEvent);
            this.ManageCache(mapiEvent.MailboxGuid);
            if (this.IsIgnorableDraft(mapiEvent, item))
            {
                return;
            }
            CachedState cachedState = AssistantsService.CachedObjectsList.GetCachedState(mapiEvent.MailboxGuid);

            cachedState.LockForRead();
            UserRetentionPolicyCache userRetentionPolicyCache = null;

            try
            {
                userRetentionPolicyCache = RetentionPolicyCheck.DetailedCheckForRetentionPolicy(mapiEvent, itemStore, item, cachedState);
            }
            finally
            {
                cachedState.ReleaseReaderLock();
            }
            if (RetentionPolicyCheck.IsEventConfigChange(mapiEvent))
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: updated configuration {1}", TraceContext.Get(), mapiEvent);
                return;
            }
            if (userRetentionPolicyCache != null && userRetentionPolicyCache.UnderRetentionPolicy)
            {
                bool flag = false;
                if (!this.IsEventOnRelevantFolder(userRetentionPolicyCache, mapiEvent))
                {
                    return;
                }
                if (mapiEvent.ClientType == MapiEventClientTypes.Transport && !this.InSentItems(userRetentionPolicyCache, mapiEvent))
                {
                    ElcEventBasedAssistant.Tracer.TraceDebug <ElcEventBasedAssistant, MapiEvent>((long)this.GetHashCode(), "{0} Event is from transport and item not in SentItems. Ignoring from HandleEvent. Mapievent: {1}", this, mapiEvent);
                    return;
                }
                if (TagAssistantHelper.IsConflictableItem(mapiEvent.ObjectClass, mapiEvent.ParentEntryId, userRetentionPolicyCache.DeletedItemsId))
                {
                    return;
                }
                if ((mapiEvent.EventMask & MapiEventTypeFlags.ObjectMoved) != (MapiEventTypeFlags)0 && mapiEvent.ItemType == ObjectType.MAPI_FOLDER)
                {
                    userRetentionPolicyCache.ResetFolderCaches();
                }
                StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId);
                if (mapiEvent.ItemType == ObjectType.MAPI_FOLDER && item == null && mapiEvent.ItemEntryId != null && (mapiEvent.EventMask & MapiEventTypeFlags.ObjectDeleted) == (MapiEventTypeFlags)0)
                {
                    Exception ex = null;
                    try
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: A folder was changed and needs to be manually loaded {1}", TraceContext.Get(), mapiEvent);
                        item = Folder.Bind(itemStore, storeObjectId, ElcEventBasedAssistantType.InternalPreloadItemProperties);
                        flag = true;
                    }
                    catch (ObjectNotFoundException ex2)
                    {
                        ex = ex2;
                    }
                    catch (ConversionFailedException ex3)
                    {
                        ex = ex3;
                    }
                    catch (VirusMessageDeletedException ex4)
                    {
                        ex = ex4;
                    }
                    if (ex != null)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <ElcEventBasedAssistant, Exception>((long)this.GetHashCode(), "{0}: Problems loading a folder. It will not be processed. Exception: {1}", this, ex);
                        return;
                    }
                }
                try
                {
                    StoreObjectId     parentId          = StoreObjectId.FromProviderSpecificId(mapiEvent.ParentEntryId);
                    ElcEventProcessor elcEventProcessor = ElcEventProcessor.GetElcEventProcessor();
                    elcEventProcessor.ValidateStoreObject(userRetentionPolicyCache, itemStore, parentId, storeObjectId, item, mapiEvent);
                }
                finally
                {
                    if (flag)
                    {
                        item.Dispose();
                    }
                }
            }
        }
Esempio n. 9
0
        // Token: 0x06000491 RID: 1169 RVA: 0x00020AF8 File Offset: 0x0001ECF8
        private Guid UpdateTagProperties(out bool tagChanged, out Guid effectiveParentTagGuid, string itemClass, object[] itemProperties)
        {
            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Start to update tag properties", this);
            Guid value           = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.PolicyTagIndex], new Guid?(Guid.Empty), true, (VersionedId)itemProperties[this.propertyIndexHolder.IdIndex]).Value;
            Guid value2          = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.ExplicitPolicyTagIndex], new Guid?(Guid.Empty), true, (VersionedId)itemProperties[this.propertyIndexHolder.IdIndex]).Value;
            int? retentionPeriod = (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int) ? ((int?)itemProperties[this.propertyIndexHolder.RetentionPeriodIndex]) : null;
            int? retentionFlags  = (itemProperties[this.propertyIndexHolder.RetentionFlagsIndex] is int) ? ((int?)itemProperties[this.propertyIndexHolder.RetentionFlagsIndex]) : null;

            tagChanged = false;
            Guid guid = value;

            effectiveParentTagGuid = this.GetEffectiveParentTag(itemClass);
            bool flag  = TagAssistantHelper.IsTagImplicit(retentionPeriod, retentionFlags);
            bool flag2 = !base.ElcUserTagInformation.ContainsTag(value);

            if (!value2.Equals(Guid.Empty) && base.ElcUserTagInformation.ContainsTag(value2))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Found explicit personal tag", this);
                tagChanged = true;
                guid       = value2;
                base.AddAdriftTagToFai(value2);
                this.SetTagProperties(guid, value, true);
                base.PropertiesToBeDeleted.Add(StoreObjectSchema.ExplicitPolicyTag);
                itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = 1;
                ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                this.taggedByPersonalExpiryTag = true;
            }
            else if (flag || (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int && flag2))
            {
                if (!effectiveParentTagGuid.Equals(value))
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The original tag doesn't match the parent tag", this);
                    if (!flag)
                    {
                        base.PropertiesToBeUpdated.Add(StoreObjectSchema.ExplicitPolicyTag, value.ToByteArray());
                        base.AddDeletedTag(value);
                    }
                    if (!this.ShouldSkipImplicitItem(itemProperties, effectiveParentTagGuid, value, itemClass))
                    {
                        tagChanged = true;
                        guid       = effectiveParentTagGuid;
                        this.SetTagProperties(effectiveParentTagGuid, value, false);
                        itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = null;
                        if (effectiveParentTagGuid != Guid.Empty)
                        {
                            if (base.ElcUserTagInformation.AllAdTags.ContainsKey(effectiveParentTagGuid))
                            {
                                if (base.ElcUserTagInformation.GetTag(effectiveParentTagGuid).Tag.Type == ElcFolderType.Personal)
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited explicit personal tag", this);
                                    ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                                    this.taggedByPersonalExpiryTag = true;
                                }
                                else if (base.ElcUserTagInformation.GetTag(effectiveParentTagGuid).Tag.Type == ElcFolderType.All)
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited default tag", this);
                                    ELCPerfmon.TotalItemsWithDefaultTag.Increment();
                                    this.taggedByDefaultExpiryTag = true;
                                }
                                else
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited system tag", this);
                                    ELCPerfmon.TotalItemsWithDefaultTag.Increment();
                                    this.taggedBySystemExpiryTag = true;
                                }
                            }
                            else
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The parent tag is not in AD. Its type is unknown.", this);
                                this.taggedByUncertainExpiryTag = true;
                            }
                        }
                        else if (!flag)
                        {
                            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The tag is explicit. Removed personal tag", this);
                            this.taggedByPersonalExpiryTag = true;
                        }
                        else if (!flag2)
                        {
                            if (base.ElcUserTagInformation.GetTag(value).Tag.Type == ElcFolderType.Personal)
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed personal tag", this);
                                this.taggedByPersonalExpiryTag = true;
                            }
                            else if (base.ElcUserTagInformation.GetTag(value).Tag.Type == ElcFolderType.All)
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed default tag", this);
                                this.taggedByDefaultExpiryTag = true;
                            }
                            else
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed system tag", this);
                                this.taggedBySystemExpiryTag = true;
                            }
                        }
                        else
                        {
                            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The removed tag is deleted in AD. Its type is unknown.", this);
                            this.taggedByUncertainExpiryTag = true;
                        }
                    }
                    else
                    {
                        PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The item is skipped", this);
                    }
                }
                else
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The original tag matches the parent tag", this);
                    if (FlagsMan.IsAutoTagSet(itemProperties[this.propertyIndexHolder.RetentionFlagsIndex]))
                    {
                        base.PropertiesToBeDeleted.Add(StoreObjectSchema.RetentionPeriod);
                        itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = null;
                    }
                }
            }
            else if (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int)
            {
                base.AddAdriftTagToFai(value);
            }
            return(guid);
        }
Esempio n. 10
0
        // Token: 0x0600048D RID: 1165 RVA: 0x0002067C File Offset: 0x0001E87C
        internal void Update()
        {
            bool processEhaMigratedMessages = base.MailboxDataForTags.ElcUserInformation.ProcessEhaMigratedMessages;

            using (IEnumerator <List <object[]> > allItemsIterator = this.GetAllItemsIterator())
            {
                while (allItemsIterator != null && allItemsIterator.MoveNext())
                {
                    List <object[]> list             = allItemsIterator.Current;
                    VersionedId     versionedId      = null;
                    Guid            empty            = Guid.Empty;
                    Guid            empty2           = Guid.Empty;
                    DateTime        updatedStartDate = DateTime.MaxValue;
                    Guid            updatedTagGuid   = Guid.Empty;
                    foreach (object[] array in list)
                    {
                        versionedId = (array[this.propertyIndexHolder.IdIndex] as VersionedId);
                        if (versionedId == null)
                        {
                            PropertySynchronizerBase.Tracer.TraceError <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: We could not get id of this item.", this);
                        }
                        else
                        {
                            if (processEhaMigratedMessages)
                            {
                                object obj = array[this.propertyIndexHolder.EHAMigrationExpiryDateIndex];
                                if (obj != null && obj is ExDateTime)
                                {
                                    PropertySynchronizerBase.Tracer.TraceError <ItemPropertySynchronizer, object>((long)this.GetHashCode(), "{0}: We dont tag eha migration messages, this message is stamped with migration expiration date from eha. Expiration date is {1}", this, obj);
                                    continue;
                                }
                            }
                            base.PropertiesToBeDeleted.Clear();
                            base.PropertiesToBeUpdated.Clear();
                            bool tagChanged = false;
                            this.taggedByDefaultExpiryTag   = false;
                            this.taggedByPersonalArchiveTag = false;
                            this.taggedByPersonalExpiryTag  = false;
                            this.taggedBySystemExpiryTag    = false;
                            this.taggedByUncertainExpiryTag = false;
                            string text = array[this.propertyIndexHolder.ItemClassIndex] as string;
                            text = ((text == null) ? string.Empty : ElcPolicySettings.GetEffectiveItemClass(text).ToLower());
                            if (TagAssistantHelper.IsRetainableItem(text) && !this.ShouldSkipItem(array) && !this.IsRuleMessageItem(text))
                            {
                                try
                                {
                                    empty            = Guid.Empty;
                                    empty2           = Guid.Empty;
                                    updatedStartDate = DateTime.MaxValue;
                                    updatedTagGuid   = this.UpdateTagProperties(out tagChanged, out empty, text, array);
                                    bool tagChanged2 = this.UpdateArchiveTag(array, out empty2);
                                    if (!updatedTagGuid.Equals(Guid.Empty) || !empty2.Equals(Guid.Empty))
                                    {
                                        PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Need to set StartDate since no tag is present.", this);
                                        updatedStartDate = this.UpdateStartDateEtc(versionedId, text, array);
                                    }
                                    this.UpdateContentSettingProperties(tagChanged, updatedTagGuid, updatedStartDate, text, array);
                                    this.UpdateRetentionFlags(empty, tagChanged, updatedTagGuid, empty2, array);
                                    this.UpdateArchiveContentSettingProperties(tagChanged2, array, text, empty2, updatedStartDate);
                                    this.CommitChangesAlready(versionedId);
                                }
                                catch (ArgumentOutOfRangeException arg)
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer, string, ArgumentOutOfRangeException>((long)this.GetHashCode(), "{0} Corrupted Data. Skip current item {1}. Exception: {2}", this, versionedId.ObjectId.ToHexEntryId(), arg);
                                }
                            }
                        }
                    }
                }
            }
        }