Example #1
0
        internal static ContactFolders Load(IXSOFactory xsoFactory, IMailboxSession mailboxSession)
        {
            MyContactFolders myContactFolders = new MyContactFolders(xsoFactory, mailboxSession);
            StoreObjectId    defaultFolderId  = mailboxSession.GetDefaultFolderId(DefaultFolderType.MyContacts);
            StoreObjectId    defaultFolderId2 = mailboxSession.GetDefaultFolderId(DefaultFolderType.QuickContacts);
            StoreObjectId    defaultFolderId3 = mailboxSession.GetDefaultFolderId(DefaultFolderType.Favorites);

            return(new ContactFolders(myContactFolders, defaultFolderId, defaultFolderId2, defaultFolderId3));
        }
 // Token: 0x060013AF RID: 5039 RVA: 0x00073030 File Offset: 0x00071230
 public bool LoadData(IMailboxSession itemStore, IXSOFactory factory)
 {
     if (this.inboxFolderId == null)
     {
         StoreObjectId defaultFolderId = itemStore.GetDefaultFolderId(DefaultFolderType.Inbox);
         if (defaultFolderId != null)
         {
             this.inboxFolderId = defaultFolderId.ProviderLevelItemId;
             using (IFolder folder = factory.BindToFolder(itemStore, defaultFolderId))
             {
                 this.InboxItemCount   = (long)folder.ItemCount;
                 this.InboxUnreadCount = (long)folder.GetValueOrDefault <int>(FolderSchema.UnreadCount, 1);
                 if (this.InboxUnreadCount == 0L)
                 {
                     this.InboxUnreadCount = 1L;
                     ExTraceGlobals.PushNotificationAssistantTracer.TraceError <Guid, object>((long)this.GetHashCode(), "MailboxData.LoadData('{0}'): {1} - The UnreadCount coming from the folder is = 0", itemStore.MailboxGuid, TraceContext.Get());
                 }
                 return(true);
             }
         }
         Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_FailedToResolveInboxFolderId, itemStore.MdbGuid.ToString(), new object[]
         {
             itemStore.MdbGuid,
             itemStore.MailboxGuid
         });
         ExTraceGlobals.PushNotificationAssistantTracer.TraceWarning((long)this.GetHashCode(), "MailboxData.LoadData: {0} - Load Data: Inbox folder is null", new object[]
         {
             TraceContext.Get()
         });
         return(false);
     }
     return(true);
 }
Example #3
0
        public void UpdateFolderScope(IXSOFactory xsoFactory, IMailboxSession mailboxSession, StoreObjectId[] scope)
        {
            ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
            ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
            ArgumentValidator.ThrowIfNull("scope", scope);
            StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(this.defaultFolderType);

            if (defaultFolderId == null)
            {
                mailboxSession.CreateDefaultFolder(this.defaultFolderType);
                defaultFolderId = mailboxSession.GetDefaultFolderId(this.defaultFolderType);
            }
            using (ISearchFolder searchFolder = xsoFactory.BindToSearchFolder(mailboxSession, defaultFolderId))
            {
                ContactsSearchFolderCriteria.UpdateFolderScope(xsoFactory, mailboxSession, searchFolder, scope);
            }
        }
        public static IUnseenItemsReader Create(IMailboxSession mailboxSession, IXSOFactory xsoFactory)
        {
            ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
            ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
            StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox);
            IFolder       folder          = xsoFactory.BindToFolder(mailboxSession, defaultFolderId);

            return(new UnseenItemsReader(folder));
        }
Example #5
0
        private StoreObjectId GetPhotoStoreId(IMailboxSession session)
        {
            StoreObjectId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.Configuration);

            if (defaultFolderId == null)
            {
                this.tracer.TraceDebug((long)this.GetHashCode(), "Mailbox photo reader: photo store doesn't exist.");
                throw new ObjectNotFoundException(Strings.UserPhotoStoreNotFound);
            }
            return(defaultFolderId);
        }
Example #6
0
        private static StoreObjectId[] GetFolderIds(IMailboxSession session, bool forceCreate, DefaultFolderType[] scopeDefaultFolderTypes)
        {
            List <StoreObjectId> list = new List <StoreObjectId>(scopeDefaultFolderTypes.Length);

            foreach (DefaultFolderType arg in scopeDefaultFolderTypes)
            {
                StoreObjectId defaultFolderId = session.GetDefaultFolderId(arg);
                if (forceCreate && defaultFolderId == null)
                {
                    ContactsSearchFolderCriteria.Tracer.TraceDebug <DefaultFolderType>(0L, "Default folder {0} not yet created. Explicitly creating it now.", arg);
                    session.CreateDefaultFolder(arg);
                    defaultFolderId = session.GetDefaultFolderId(arg);
                }
                if (defaultFolderId != null)
                {
                    list.Add(defaultFolderId);
                }
            }
            return(list.ToArray());
        }
        public static IPushNotificationStorage Find(IMailboxSession mailboxSession, IXSOFactory xsoFactory)
        {
            ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
            ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
            StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.PushNotificationRoot);

            if (defaultFolderId != null)
            {
                return(new PushNotificationStorage(xsoFactory.BindToFolder(mailboxSession, defaultFolderId), PushNotificationStorage.GetTenantId(mailboxSession)));
            }
            return(null);
        }
Example #8
0
 public override StoreObjectId GetFolderId(IMailboxSession session)
 {
     return(session.GetDefaultFolderId(this.folderType));
 }
 private static StoreObjectId GetEscalationFolderId(IMailboxSession mailboxSession)
 {
     return(mailboxSession.GetDefaultFolderId(DefaultFolderType.TemporarySaves) ?? mailboxSession.CreateDefaultFolder(DefaultFolderType.TemporarySaves));
 }
Example #10
0
        // Token: 0x060000C8 RID: 200 RVA: 0x00005364 File Offset: 0x00003564
        internal static bool IsDeletedItemsFolder(IMailboxSession mailboxSession, byte[] parentId)
        {
            StoreObjectId id = StoreObjectId.FromProviderSpecificId(parentId, StoreObjectType.Folder);

            return(mailboxSession.GetDefaultFolderId(DefaultFolderType.DeletedItems).Equals(id));
        }