// Token: 0x06000782 RID: 1922 RVA: 0x00035430 File Offset: 0x00033630
        internal static bool IsDumpsterFolder(MailboxSession itemStore, StoreObjectId folderId)
        {
            bool result;

            using (COWSession cowsession = COWSession.Create(itemStore))
            {
                result = cowsession.IsDumpsterFolder(itemStore, folderId);
            }
            return(result);
        }
Пример #2
0
 // Token: 0x060000C7 RID: 199 RVA: 0x00005318 File Offset: 0x00003518
 internal static bool IsItemInDumpster(MailboxSession mailboxSession, IStoreObject storeObject)
 {
     if (storeObject != null && storeObject.ParentId != null)
     {
         using (COWSession cowsession = COWSession.Create(mailboxSession))
         {
             return(cowsession.IsDumpsterFolder(mailboxSession, storeObject.ParentId));
         }
         return(false);
     }
     return(false);
 }
Пример #3
0
 public CowClientOperationSensitivity SkipGroupOperation(COWSettings settings, IDumpsterItemOperations dumpster, COWTriggerAction operation, FolderChangeOperationFlags flags, StoreSession sourceSession, StoreSession destinationSession, StoreObjectId sourceFolderId, StoreObjectId destinationFolderId, ICollection <StoreObjectId> itemIds, bool onBeforeNotification, bool onDumpster, CallbackContext callbackContext)
 {
     EnumValidator.ThrowIfInvalid <COWTriggerAction>(operation, "operation");
     EnumValidator.ThrowIfInvalid <FolderChangeOperationFlags>(flags, "flags");
     Util.ThrowOnNullArgument(settings, "settings");
     Util.ThrowOnNullArgument(sourceSession, "sourceSession");
     if (onDumpster)
     {
         return(CowClientOperationSensitivity.Skip);
     }
     if (!onBeforeNotification)
     {
         return(CowClientOperationSensitivity.Skip);
     }
     if (operation != COWTriggerAction.SoftDelete)
     {
         return(CowClientOperationSensitivity.Skip);
     }
     if (COWSession.IsDelegateSession(sourceSession))
     {
         return(CowClientOperationSensitivity.Capture);
     }
     return(CowClientOperationSensitivity.CaptureAndPerformOperation);
 }
Пример #4
0
        public CowClientOperationSensitivity SkipGroupOperation(COWSettings settings, IDumpsterItemOperations dumpster, COWTriggerAction operation, FolderChangeOperationFlags flags, StoreSession sourceSession, StoreSession destinationSession, StoreObjectId sourceFolderId, StoreObjectId destinationFolderId, ICollection <StoreObjectId> itemIds, bool onBeforeNotification, bool onDumpster, CallbackContext callbackContext)
        {
            EnumValidator.ThrowIfInvalid <COWTriggerAction>(operation, "operation");
            EnumValidator.ThrowIfInvalid <FolderChangeOperationFlags>(flags, "flags");
            Util.ThrowOnNullArgument(settings, "settings");
            Util.ThrowOnNullArgument(sourceSession, "sourceSession");
            if (onDumpster)
            {
                return(CowClientOperationSensitivity.Skip);
            }
            if (!onBeforeNotification)
            {
                return(CowClientOperationSensitivity.Skip);
            }
            bool flag;

            if (!settings.HoldEnabled())
            {
                flag = true;
            }
            else
            {
                switch (operation)
                {
                case COWTriggerAction.Move:
                case COWTriggerAction.MoveToDeletedItems:
                {
                    Util.ThrowOnNullArgument(sourceSession, "sourceSession");
                    if (destinationSession == null)
                    {
                        flag = true;
                        ExTraceGlobals.SessionTracer.TraceDebug((long)dumpster.StoreSession.GetHashCode(), "Destination session is null, meaning item moving to same mailbox, so don't keep a copy.");
                        goto IL_187;
                    }
                    Guid mailboxGuid  = destinationSession.MailboxGuid;
                    Guid mailboxGuid2 = sourceSession.MailboxGuid;
                    if (destinationSession.MailboxGuid == sourceSession.MailboxGuid)
                    {
                        flag = true;
                        ExTraceGlobals.SessionTracer.TraceDebug((long)dumpster.StoreSession.GetHashCode(), "Mailbox guids are the same, meaning item moving to same mailbox, so don't keep a copy.");
                        goto IL_187;
                    }
                    if (destinationSession is MailboxSession && sourceSession is MailboxSession && string.Compare(((MailboxSession)sourceSession).MailboxOwner.LegacyDn, ((MailboxSession)destinationSession).MailboxOwner.LegacyDn, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        flag = true;
                        ExTraceGlobals.SessionTracer.TraceDebug((long)dumpster.StoreSession.GetHashCode(), "MailboxOwner.LegacyDistinguishedName is the same, meaning same person owns both mailboxes (eg primary and archive), so don't keep a copy.");
                        goto IL_187;
                    }
                    flag = false;
                    ExTraceGlobals.SessionTracer.TraceDebug((long)dumpster.StoreSession.GetHashCode(), "Item moving to a different mailbox owned by someone else. Keep a copy.");
                    goto IL_187;
                }

                case COWTriggerAction.HardDelete:
                    flag = (settings.IsMrmAction() && DumpsterFolderHelper.IsDumpsterFolder(callbackContext.SessionWithBestAccess, sourceFolderId));
                    goto IL_187;

                case COWTriggerAction.DoneWithMessageDelete:
                    flag = false;
                    goto IL_187;
                }
                flag = true;
            }
IL_187:
            if (flag)
            {
                return(CowClientOperationSensitivity.Skip);
            }
            if (COWSession.IsDelegateSession(sourceSession))
            {
                return(CowClientOperationSensitivity.Capture);
            }
            return(CowClientOperationSensitivity.CaptureAndPerformOperation);
        }