private StoreObjectId ResolveSearchFolderIdForFilteredView(StoreId inboxFolderId, OwaViewFilter viewFilter) { StoreObjectId storeObjectId = null; ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView Start. SubscriptionId: {0}", base.SubscriptionId); OwaSearchContext owaSearchContext = new OwaSearchContext(); owaSearchContext.ViewFilter = viewFilter; owaSearchContext.FolderIdToSearch = inboxFolderId; StoreObjectId defaultFolderId = base.UserContext.MailboxSession.GetDefaultFolderId(DefaultFolderType.SearchFolders); using (SearchFolder owaViewFilterSearchFolder = SearchUtil.GetOwaViewFilterSearchFolder(owaSearchContext, base.UserContext.MailboxSession, defaultFolderId, null, CallContext.Current)) { if (owaViewFilterSearchFolder == null) { throw new ArgumentNullException(string.Format("HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView null searchFolder returned for subscriptionId: {0}. ViewFilter: {1}; Source folder id: {2}", base.SubscriptionId, viewFilter, inboxFolderId.ToString())); } storeObjectId = owaViewFilterSearchFolder.StoreObjectId; ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView found filtered-view search folder subscriptionId: {0} . ViewFilter: {1}; Source folder id: {2}, Search folder id: {3}", new object[] { base.SubscriptionId, viewFilter, inboxFolderId.ToString(), storeObjectId.ToString() }); } return(storeObjectId); }
// Token: 0x0600025C RID: 604 RVA: 0x00008ED4 File Offset: 0x000070D4 private void Initialize(MailboxSession mailboxSession, StoreObjectId id, PropertyDefinition[] properties) { bool flag = false; try { AnchorUtil.ThrowOnNullArgument(mailboxSession, "dataProvider"); AnchorUtil.ThrowOnNullArgument(id, "id"); AnchorUtil.ThrowOnNullArgument(properties, "properties"); this.Message = MessageItem.Bind(mailboxSession, id, properties); flag = true; } catch (ArgumentException ex) { base.AnchorContext.Logger.Log(MigrationEventType.Error, ex, "Encountered an argument exception when trying to find message with id={0}", new object[] { id.ToString() }); throw new ObjectNotFoundException(ServerStrings.ExItemNotFound, ex); } finally { if (!flag) { this.Dispose(); } } }
internal PushNotificationStoreId(ADObjectId mailboxOwnerId, StoreObjectId storeObjectIdValue, string subscriptionId) : base(mailboxOwnerId) { ArgumentValidator.ThrowIfNull("storeObjectId", storeObjectIdValue); this.StoreObjectId = storeObjectIdValue.ToString(); this.StoreObjectIdValue = storeObjectIdValue; this.SubscriptionId = subscriptionId; }
protected internal override void ValidateStoreObjectIdForCorrectType(StoreObjectId storeObjectId) { if (!storeObjectId.IsFolderId) { string id = storeObjectId.ToString(); throw new ObjectNotFoundException(Strings.CanNotUseFolderIdForItem(id)); } }
private void EnsureExternalFreeBusyFolder(Server localServer, PublicFolderDatabase[] publicFolderDatabases) { Organization orgContainer = this.configurationSession.GetOrgContainer(); if (orgContainer == null) { base.WriteVerbose(Strings.InstallFreeBusyFolderCannotGetOrganizationContainer); return; } string legacyDN = orgContainer.LegacyExchangeDN + "/ou=External (FYDIBOHF25SPDLT)"; if (this.IsExternalFreeBusyFolderCreated(legacyDN, publicFolderDatabases)) { base.WriteVerbose(Strings.InstallFreeBusyFolderAlreadyExists); return; } using (PublicFolderSession publicFolderSession = this.GetPublicFolderSession(localServer)) { StoreObjectId freeBusyFolderId = FreeBusyFolder.GetFreeBusyFolderId(publicFolderSession, legacyDN, FreeBusyFolderDisposition.CreateIfNeeded); if (freeBusyFolderId == null) { base.WriteVerbose(Strings.InstallFreeBusyFolderUnableToCreateFolder); } else { base.WriteVerbose(Strings.InstallFreeBusyFolderCreatedFolder(freeBusyFolderId.ToString())); using (Folder folder = Folder.Bind(publicFolderSession, freeBusyFolderId, new PropertyDefinition[] { FolderSchema.ReplicaList })) { string[] array = Array.ConvertAll <PublicFolderDatabase, string>(publicFolderDatabases, (PublicFolderDatabase database) => database.ExchangeLegacyDN); string[] secondArray = (string[])folder[FolderSchema.ReplicaList]; if (!this.IsEqualsArrayOfLegacyDN(array, secondArray)) { folder[FolderSchema.ReplicaList] = array; folder.Save(); folder.Load(); } } } } }
// Token: 0x060007E5 RID: 2021 RVA: 0x00039374 File Offset: 0x00037574 private void ProcessFolder(MailboxSession mailboxSession, StoreObjectId folderId, CalendarSyncLogEntry logEntry) { CalendarSyncAssistantHelper.Tracer.TraceDebug <object, StoreObjectId, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantType.ProcessFolder will try to process folder {1} from mailbox {2}.", TraceContext.Get(), folderId, this.GetDisplayName(mailboxSession)); using (Folder folder = Folder.Bind(mailboxSession, folderId)) { SynchronizableFolderType synchronizableFolderType = SynchronizableFolderType.FromFolder(folder); CalendarSyncFolderOperationLogEntry calendarSyncFolderOperationLogEntry = new CalendarSyncFolderOperationLogEntry { MailboxGuid = mailboxSession.MailboxGuid, FolderId = folderId.ToString(), DisplayName = folder.DisplayName, IsOnDemandJob = true, TenantGuid = mailboxSession.MailboxOwner.MailboxInfo.OrganizationId.GetTenantGuid() }; if (synchronizableFolderType != null) { FolderRow folderRow = FolderRow.FromFolder(folder); this.ThrowIfShuttingDown((mailboxSession != null) ? mailboxSession.MailboxOwner : null); if (!synchronizableFolderType.Synchronize(mailboxSession, folderRow, this.GetDeadline(SynchronizableFolderType.MaxSyncTimePerFolder), this.PerformanceCounters, calendarSyncFolderOperationLogEntry)) { CalendarSyncAssistantHelper.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.ProcessFolder: deadline expired while processing folder {1} from mailbox {2}. MaxSyncTime {3}.", new object[] { TraceContext.Get(), folderId, this.GetDisplayName(mailboxSession), SynchronizableFolderType.MaxSyncTimePerFolder }); calendarSyncFolderOperationLogEntry.IsDeadlineExpired = true; } else { calendarSyncFolderOperationLogEntry.IsSyncSuccess = true; } calendarSyncFolderOperationLogEntry.FolderType = synchronizableFolderType.FolderTypeName; } else { CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string, StoreObjectId>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.ProcessFolder for mailbox {1}: id {2}. Couldn't find a corresponding SynchronizableFolderType object.", TraceContext.Get(), this.GetDisplayName(mailboxSession), folderId); calendarSyncFolderOperationLogEntry.FolderType = "UnknownFolderType"; } logEntry.AddFolderDetailLogline(calendarSyncFolderOperationLogEntry); } }
private void RenderAppointmentData(CalendarViewBase view, int i, ExDateTime itemStart, ExDateTime itemEnd) { ICalendarDataSource dataSource = view.DataSource; CalendarItemTypeWrapper wrappedItemType = dataSource.GetWrappedItemType(i); this.output.Write("new Item(\""); OwaStoreObjectId itemId = dataSource.GetItemId(i); string changeKey = dataSource.GetChangeKey(i); PublishedCalendarDataSource publishedCalendarDataSource = dataSource as PublishedCalendarDataSource; if (publishedCalendarDataSource != null && publishedCalendarDataSource.DetailLevel != DetailLevelEnumType.AvailabilityOnly) { StoreObjectId itemStoreObjectId = publishedCalendarDataSource.GetItemStoreObjectId(i); Utilities.JavascriptEncode(itemStoreObjectId.ToString(), this.output); this.output.Write("\",\""); if (this.IsOneOfRecurrence(wrappedItemType)) { StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(itemStoreObjectId.ProviderLevelItemId); Utilities.JavascriptEncode(storeObjectId.ToString(), this.output); } else { this.output.Write("0"); } } else { if (itemId != null) { Utilities.JavascriptEncode(itemId.ToString(), this.output); } this.output.Write("\",\""); if (itemId != null && this.IsOneOfRecurrence(wrappedItemType)) { OwaStoreObjectId providerLevelItemId = itemId.ProviderLevelItemId; Utilities.JavascriptEncode(providerLevelItemId.ToString(), this.output); } else { this.output.Write("0"); } } this.output.Write("\",\""); if (changeKey != null) { Utilities.JavascriptEncode(changeKey, this.output); } this.output.Write("\",\""); this.output.Write(DateTimeUtilities.GetJavascriptDate(itemStart)); this.output.Write("\",\""); this.output.Write(DateTimeUtilities.GetJavascriptDate(itemEnd)); this.output.Write("\",\""); Utilities.JavascriptEncode(dataSource.GetSubject(i), this.output); this.output.Write("\",\""); Utilities.JavascriptEncode(dataSource.GetLocation(i), this.output); BusyTypeWrapper wrappedBusyType = dataSource.GetWrappedBusyType(i); this.output.Write("\","); this.output.Write((int)wrappedBusyType); this.output.Write(",\""); if (itemId != null) { Utilities.JavascriptEncode(ObjectClass.GetContainerMessageClass(itemId.StoreObjectType), this.output); } this.output.Write("\""); bool flag = dataSource.IsMeeting(i); this.output.Write(flag ? ",1" : ",0"); this.output.Write(dataSource.IsCancelled(i) ? ",1" : ",0"); bool flag2 = dataSource.IsOrganizer(i); this.output.Write(flag2 ? ",1" : ",0"); this.output.Write(",\""); if (flag) { Utilities.JavascriptEncode(dataSource.GetOrganizerDisplayName(i), this.output); } this.output.Write("\""); bool flag3 = dataSource.IsPrivate(i); this.output.Write(flag3 ? ",1," : ",0,"); this.output.Write((int)wrappedItemType); this.output.Write(dataSource.HasAttachment(i) ? ",1" : ",0"); this.output.Write(",\""); this.output.Write(dataSource.GetCssClassName(i)); this.output.Write("\""); this.output.Write(")"); }
protected virtual void OnGetDocumentLibraryListsComplete(IAsyncResult asyncResult) { if (asyncResult == null) { throw new InvalidOperationException("OnGetDocumentLibraryListsComplete: asyncResult cannot be null here."); } ProtocolLog.LogInformation(this.loggingComponent, this.loggingContext, string.Format("SiteSynchronizer.BeginExecute", new object[0])); bool flag = (base.SyncOption & SyncOption.CurrentDocumentLibsOnly) == SyncOption.CurrentDocumentLibsOnly; Dictionary <Guid, List> dictionary = new Dictionary <Guid, List>(); if (!flag) { try { this.InitializeDocumentLibraryList(dictionary); if (base.HandleShutDown()) { return; } } catch (WebException e) { SharePointException value = new SharePointException(this.siteUri.AbsoluteUri, e, false); this.executionAsyncResult.InvokeCallback(value); return; } catch (IOException value2) { this.executionAsyncResult.InvokeCallback(value2); return; } catch (ClientRequestException value3) { this.executionAsyncResult.InvokeCallback(value3); return; } catch (ServerException value4) { this.executionAsyncResult.InvokeCallback(value4); return; } } List <StoreObjectId> list = new List <StoreObjectId>(); List <List> list2 = new List <List>(); Dictionary <StoreObjectId, List> dictionary2 = new Dictionary <StoreObjectId, List>(); try { using (Folder folder = Folder.Bind(this.mailboxSession, DefaultFolderType.Root)) { using (QueryResult queryResult = folder.FolderQuery(FolderQueryFlags.None, new ExistsFilter(FolderSchema.LinkedId), null, new PropertyDefinition[] { FolderSchema.LinkedId, FolderSchema.Id, FolderSchema.DisplayName, FolderSchema.LinkedUrl, FolderSchema.LinkedSiteAuthorityUrl })) { object[][] rows; do { rows = queryResult.GetRows(10000); for (int i = 0; i < rows.Length; i++) { Guid guid = (Guid)rows[i][0]; StoreObjectId objectId = ((VersionedId)rows[i][1]).ObjectId; string a = rows[i][2] as string; string text = rows[i][3] as string; string text2 = rows[i][4] as string; Uri uri = null; if (!string.IsNullOrEmpty(text2)) { uri = new Uri(text2); } if (string.IsNullOrEmpty(text)) { this.executionAsyncResult.InvokeCallback(new ArgumentNullException("LinkedUrl is null for folder " + objectId.ToString())); } if (!flag) { List list3 = null; if (dictionary.TryGetValue(guid, out list3)) { if (!string.Equals(a, list3.Title, StringComparison.Ordinal) || (uri != null && !UriComparer.IsEqual(uri, this.siteUri)) || (this.Job.SyncOption & SyncOption.FullSync) == SyncOption.FullSync) { dictionary2[objectId] = dictionary[guid]; } this.documentLibraryInfos.Enqueue(new DocumentLibraryInfo(objectId, list3.Id, list3.RootFolder.ServerRelativeUrl)); dictionary.Remove(guid); } else { list.Add(objectId); } } else { this.documentLibraryInfos.Enqueue(new DocumentLibraryInfo(objectId, guid, new Uri(text).AbsolutePath)); } } }while (rows.Length != 0); list2.AddRange(dictionary.Values); } if (list.Count > 0) { folder.DeleteObjects(DeleteItemFlags.HardDelete, list.ToArray()); } foreach (KeyValuePair <StoreObjectId, List> keyValuePair in dictionary2) { if (base.HandleShutDown()) { return; } using (Folder folder2 = Folder.Bind(this.mailboxSession, keyValuePair.Key)) { Uri uri2 = new Uri(new Uri(this.siteUri.GetLeftPart(UriPartial.Authority)), keyValuePair.Value.RootFolder.ServerRelativeUrl); bool flag2 = Utils.HasFolderUriChanged(folder2, uri2); if (flag2) { folder2[FolderSchema.SharePointChangeToken] = string.Empty; folder2[FolderSchema.LinkedUrl] = uri2.AbsoluteUri; folder2[FolderSchema.LinkedSiteUrl] = this.siteUri.AbsoluteUri; string valueOrDefault = folder2.PropertyBag.GetValueOrDefault <string>(FolderSchema.LinkedUrl, string.Empty); ProtocolLog.LogInformation(this.loggingComponent, this.loggingContext, string.Format("SiteSynchronizer: Document Library URL has changed from {0} to {1}", valueOrDefault, uri2.AbsoluteUri)); } folder2.DisplayName = keyValuePair.Value.Title; folder2[FolderSchema.LinkedSiteAuthorityUrl] = this.siteUri.AbsoluteUri; folder2.Save(); } } foreach (List list4 in list2) { if (base.HandleShutDown()) { return; } using (Folder folder3 = Folder.Create(this.mailboxSession, folder.Id.ObjectId, StoreObjectType.ShortcutFolder, list4.Title, CreateMode.OpenIfExists)) { folder3[FolderSchema.LinkedId] = list4.Id; Uri uri3 = new Uri(new Uri(this.siteUri.GetLeftPart(UriPartial.Authority)), list4.RootFolder.ServerRelativeUrl); folder3[FolderSchema.LinkedUrl] = uri3.AbsoluteUri; folder3[FolderSchema.LinkedSiteUrl] = this.siteUri.AbsoluteUri; folder3[FolderSchema.LinkedListId] = list4.Id; folder3[FolderSchema.IsDocumentLibraryFolder] = true; folder3[FolderSchema.LinkedSiteAuthorityUrl] = this.siteUri.AbsoluteUri; folder3.Save(); folder3.Load(); ProtocolLog.LogInformation(this.loggingComponent, this.loggingContext, string.Format("SiteSynchronizer: Create or update top level document library Name:{0}, LinkedUrl: {1}, LinkedId {2}, ListId {3}", new object[] { folder3.DisplayName, folder3[FolderSchema.LinkedUrl], folder3[FolderSchema.LinkedId], folder3[FolderSchema.LinkedListId] })); this.documentLibraryInfos.Enqueue(new DocumentLibraryInfo(folder3.Id.ObjectId, list4.Id, list4.RootFolder.ServerRelativeUrl)); } } } base.SyncResult = this.documentLibraryInfos; this.executionAsyncResult.InvokeCallback(null); } catch (StorageTransientException value5) { this.executionAsyncResult.InvokeCallback(value5); } catch (StoragePermanentException value6) { this.executionAsyncResult.InvokeCallback(value6); } }
// Token: 0x06001563 RID: 5475 RVA: 0x0007DBA4 File Offset: 0x0007BDA4 protected Item GetSmartItem(StoreObjectId smartId) { Item item = null; try { item = Item.Bind(base.MailboxSession, smartId, null); } catch (ObjectNotFoundException innerException) { base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemNotFound"); string.Format("The message send request isn't valid because the message for ID '{0}' couldn't be found", smartId.ToString()); throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.ItemNotFound, innerException, false); } item.OpenAsReadWrite(); return(item); }
internal static IDictionary <string, string> ExtractDeliveryDetails(StoreSession session, Item item) { IDictionary <string, string> customProperties = null; ActivityLogHelper.CatchNonFatalExceptions(delegate { MessageItem messageItem = item as MessageItem; if (messageItem == null) { return; } bool flag = false; bool flag2 = false; string value = null; ConversationId conversationId = null; string value2 = null; bool?flag3 = null; if (((IDirectPropertyBag)messageItem.PropertyBag).IsLoaded(InternalSchema.InferenceClassificationResult)) { InferenceClassificationResult?valueAsNullable = messageItem.GetValueAsNullable <InferenceClassificationResult>(InternalSchema.InferenceClassificationResult); flag3 = new bool?(valueAsNullable != null && valueAsNullable.Value.HasFlag(InferenceClassificationResult.IsClutterFinal)); } string value3 = string.Empty; if (flag3 != null) { value3 = (flag3.Value ? bool.TrueString : bool.FalseString); } bool?flag4 = new bool?(messageItem.IsGroupEscalationMessage); string value4 = string.Empty; if (flag4 != null) { value4 = (flag4.Value ? bool.TrueString : bool.FalseString); } StoreObjectId parentId = messageItem.ParentId; DefaultFolderType defaultFolderType = DefaultFolderType.None; bool flag5 = false; if (parentId != null) { StoreObjectId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.Inbox); flag = parentId.Equals(defaultFolderId); StoreObjectId defaultFolderId2 = session.GetDefaultFolderId(DefaultFolderType.Clutter); flag2 = (defaultFolderId2 != null && parentId.Equals(defaultFolderId2)); MailboxSession mailboxSession = session as MailboxSession; if (mailboxSession != null) { defaultFolderType = mailboxSession.IsDefaultFolderType(parentId); flag5 = true; } } value = messageItem.InternetMessageId; ConversationIndex index; if (ConversationIndex.TryCreate(messageItem.ConversationIndex, out index)) { conversationId = ConversationId.Create(index); } string value5 = string.Empty; if (((IDirectPropertyBag)messageItem.PropertyBag).IsLoaded(InternalSchema.InferenceMessageIdentifier)) { value5 = messageItem.GetValueAsNullable <Guid>(InternalSchema.InferenceMessageIdentifier).ToString(); } if (messageItem.Sender != null) { value2 = messageItem.Sender.SmtpEmailAddress; } List <string> list = null; List <string> list2 = null; foreach (Recipient recipient in messageItem.Recipients) { if (recipient.Participant != null) { if (recipient.IsDistributionList() == true) { if (list == null) { list = new List <string>(2); } list.Add(recipient.SmtpAddress()); } else if (recipient.IsGroupMailbox() == true) { if (list2 == null) { list2 = new List <string>(2); } list2.Add(recipient.SmtpAddress()); } } } Dictionary <string, string> dictionary = new Dictionary <string, string> { { "IsClutter", value3 }, { "DeliveredToInbox", flag ? bool.TrueString : bool.FalseString }, { "DeliveredToClutter", flag2 ? bool.TrueString : bool.FalseString }, { "IsGroupEscalationMessage", value4 }, { "InternetMessageId", value }, { "ConversationId", (conversationId == null) ? string.Empty : conversationId.ToString() }, { "MessageGuid", value5 }, { "SenderSmtpAddress", value2 } }; if (list != null && list.Count > 0) { dictionary.Add("DLRecipients", string.Join(";", list)); } if (list2 != null) { dictionary.Add("GMRecipients", string.Join(";", list2)); } if (flag5) { Dictionary <string, string> dictionary2 = dictionary; string key = "DeliveredFolderType"; int num = (int)defaultFolderType; dictionary2.Add(key, num.ToString()); if (defaultFolderType == DefaultFolderType.None && parentId != null) { dictionary.Add("DeliveredFolderId", parentId.ToString()); } } customProperties = dictionary; }, null); return(customProperties); }
private static NavigationTree[] CreateNavigationTreeByFolderLists(UserContext userContext, FolderList[] folderLists, params NavigationNodeCollection[] collections) { if (folderLists == null || folderLists.Length == 0) { throw new ArgumentNullException("folderLists"); } if (collections.Length == 0) { return(new NavigationTree[0]); } string[] array = new string[collections.Length]; StoreObjectId[] array2 = new StoreObjectId[collections.Length]; for (int i = 0; i < collections.Length; i++) { array[i] = NavigationNode.GetFolderClass(collections[i].GroupSection); if (ObjectClass.IsOfClass(array[i], "IPF.Note")) { throw new ArgumentException("Invalid group section. Can only be Calendar, Contact, Task"); } switch (collections[i].GroupSection) { case NavigationNodeGroupSection.Calendar: array2[i] = Utilities.TryGetDefaultFolderId(userContext.MailboxSession, DefaultFolderType.Calendar); break; case NavigationNodeGroupSection.Contacts: array2[i] = Utilities.TryGetDefaultFolderId(userContext.MailboxSession, DefaultFolderType.Contacts); break; case NavigationNodeGroupSection.Tasks: array2[i] = Utilities.TryGetDefaultFolderId(userContext.MailboxSession, DefaultFolderType.Tasks); break; default: throw new ArgumentException("Invalid group section. Can only be Calendar, Contact, Task"); } } Dictionary <string, StoreObjectId>[] array3 = new Dictionary <string, StoreObjectId> [collections.Length]; for (int j = 0; j < array.Length; j++) { array3[j] = new Dictionary <string, StoreObjectId>(); } foreach (FolderList folderList in folderLists) { foreach (StoreObjectId storeObjectId in folderList.GetFolderIds()) { string itemClass = folderList.GetFolderProperty(storeObjectId, StoreObjectSchema.ContainerClass) as string; for (int m = 0; m < array.Length; m++) { if (ObjectClass.IsOfClass(itemClass, array[m])) { string key = folderList.MailboxSession.MailboxOwnerLegacyDN.ToLowerInvariant() + storeObjectId.ToString(); array3[m][key] = storeObjectId; break; } } } } bool flag = false; NavigationNodeGroupSection[] array4 = new NavigationNodeGroupSection[collections.Length]; StoreObjectId storeObjectId2 = userContext.TryGetMyDefaultFolderId(DefaultFolderType.ToDoSearch); List <NavigationNodeFolder> list = new List <NavigationNodeFolder>(); for (int n = 0; n < collections.Length; n++) { list.Clear(); bool flag2 = false; bool flag3 = false; NavigationNodeCollection navigationNodeCollection = collections[n]; NavigationNodeGroupSection navigationNodeGroupSection = navigationNodeCollection.GroupSection; array4[n] = navigationNodeGroupSection; foreach (NavigationNodeGroup navigationNodeGroup in navigationNodeCollection) { foreach (NavigationNodeFolder navigationNodeFolder in navigationNodeGroup.Children) { if (navigationNodeFolder.IsValid && navigationNodeFolder.FolderId != null && !navigationNodeFolder.IsFlagSet(NavigationNodeFlags.PublicFolderFavorite)) { bool flag4 = false; foreach (FolderList folderList2 in folderLists) { if (navigationNodeFolder.IsFolderInSpecificMailboxSession(folderList2.MailboxSession)) { flag4 = true; break; } } if (flag4) { string key2 = navigationNodeFolder.MailboxLegacyDN.ToLowerInvariant() + navigationNodeFolder.FolderId.ToString(); if (!array3[n].Remove(key2)) { if (navigationNodeGroupSection == NavigationNodeGroupSection.Tasks && storeObjectId2 != null && storeObjectId2.Equals(navigationNodeFolder.FolderId)) { flag3 = true; } else { list.Add(navigationNodeFolder); } } if (navigationNodeFolder.FolderId.Equals(array2[n])) { foreach (FolderList folderList3 in folderLists) { if (navigationNodeFolder.IsFolderInSpecificMailboxSession(folderList3.MailboxSession)) { string text = (string)folderList3.GetFolderProperty(navigationNodeFolder.FolderId, FolderSchema.DisplayName); string subject = navigationNodeFolder.Subject; if (text != null && !text.Equals(subject)) { navigationNodeFolder.Subject = text; flag2 = true; } } } } } } } } if (navigationNodeGroupSection == NavigationNodeGroupSection.Tasks && !flag3 && storeObjectId2 != null) { navigationNodeCollection.InsertToDoFolderToGroup(userContext); flag2 = true; } if (array3[n].Count > 0) { foreach (KeyValuePair <string, StoreObjectId> keyValuePair in array3[n]) { StoreObjectId value = keyValuePair.Value; string key3 = keyValuePair.Key; string y = key3.Substring(0, key3.LastIndexOf(value.ToString())); foreach (FolderList folderList4 in folderLists) { if (StringComparer.OrdinalIgnoreCase.Equals(folderList4.MailboxSession.MailboxOwnerLegacyDN, y)) { navigationNodeCollection.AddMyFolderToGroup(userContext, folderList4.MailboxSession, folderList4.GetFolderProperties(value), folderList4.QueryPropertyMap); break; } } } flag2 = true; } if (list.Count > 0) { foreach (NavigationNodeFolder navigationNodeFolder2 in list) { navigationNodeCollection.RemoveFolderOrGroupByNodeId(navigationNodeFolder2.NavigationNodeId.ObjectId); } flag2 = true; } if (flag2) { navigationNodeCollection.Save(userContext.MailboxSession); flag = true; } } if (flag) { collections = NavigationNodeCollection.TryCreateNavigationNodeCollections(userContext, userContext.MailboxSession, array4); } NavigationTree[] array5 = new NavigationTree[collections.Length]; for (int num4 = 0; num4 < collections.Length; num4++) { NavigationNodeCollection navigationNodeCollection2 = collections[num4]; NavigationTree navigationTree = new NavigationTree(userContext, new InvisibleRootTreeNode(userContext), navigationNodeCollection2.GroupSection); foreach (NavigationNodeGroup navigationNodeGroup2 in navigationNodeCollection2) { if (!navigationNodeGroup2.IsNew) { if ((navigationNodeCollection2.GroupSection == NavigationNodeGroupSection.Contacts || navigationNodeCollection2.GroupSection == NavigationNodeGroupSection.Tasks) && NavigationNodeCollection.PeoplesFoldersClassId.Equals(navigationNodeGroup2.NavigationNodeGroupClassId)) { bool flag5 = false; foreach (NavigationNodeFolder navigationNodeFolder3 in navigationNodeGroup2.Children) { if (navigationNodeFolder3.NavigationNodeType != NavigationNodeType.SharedFolder) { flag5 = true; break; } } if (!flag5) { continue; } } NavigationGroupHeaderTreeNode navigationGroupHeaderTreeNode = new NavigationGroupHeaderTreeNode(userContext, navigationNodeGroup2); foreach (NavigationNodeFolder navigationNodeFolder4 in navigationNodeGroup2.Children) { if (((navigationNodeCollection2.GroupSection != NavigationNodeGroupSection.Contacts && navigationNodeCollection2.GroupSection != NavigationNodeGroupSection.Tasks) || navigationNodeFolder4.NavigationNodeType != NavigationNodeType.SharedFolder) && navigationNodeFolder4.IsValid && (navigationNodeFolder4.IsGSCalendar || navigationNodeFolder4.FolderId != null)) { NavigationFolderTreeNode navigationFolderTreeNode = null; foreach (FolderList folderList5 in folderLists) { object[] array6 = null; if (navigationNodeFolder4.FolderId != null) { array6 = folderList5.GetFolderProperties(navigationNodeFolder4.FolderId); } if (array6 != null) { navigationFolderTreeNode = new NavigationFolderTreeNode(userContext, navigationNodeFolder4, null, array6, folderList5.QueryPropertyMap); break; } } if (navigationFolderTreeNode == null && (!navigationNodeFolder4.IsFolderInSpecificMailboxSession(userContext.MailboxSession) || (navigationNodeFolder4.FolderId != null && Utilities.IsDefaultFolderId(userContext.MailboxSession, navigationNodeFolder4.FolderId, DefaultFolderType.ToDoSearch)))) { navigationFolderTreeNode = new NavigationFolderTreeNode(userContext, navigationNodeFolder4); } if (navigationFolderTreeNode != null) { navigationGroupHeaderTreeNode.AddChild(navigationFolderTreeNode); } } } navigationTree.RootNode.AddChild(navigationGroupHeaderTreeNode); } } array5[num4] = navigationTree; } return(array5); }
// Token: 0x060006CE RID: 1742 RVA: 0x00025F84 File Offset: 0x00024184 private void FillFidMapping(GetSyncStateResult results, MailboxSession session) { foreach (DeviceData deviceData in results.Devices) { foreach (SyncStateFolderData syncStateFolderData in deviceData.SyncFolders) { if (syncStateFolderData != null && !string.IsNullOrEmpty(syncStateFolderData.SyncStateBlob)) { syncStateFolderData.FolderMapping = new List <FolderMappingData>(); using (PooledMemoryStream pooledMemoryStream = new PooledMemoryStream(102400)) { byte[] array = Convert.FromBase64String(syncStateFolderData.SyncStateBlob); pooledMemoryStream.Write(array, 0, array.Length); pooledMemoryStream.Flush(); pooledMemoryStream.Position = 0L; int num; int num2; long num3; long num4; Dictionary <string, bool> dictionary; GenericDictionaryData <ConstStringData, string, DerivedData <ICustomSerializableBuilder> > genericDictionaryData = SyncState.InternalDeserializeData(pooledMemoryStream, out num, out num2, out num3, out num4, out dictionary); FolderIdMapping folderIdMapping = genericDictionaryData.Data["IdMapping"].Data as FolderIdMapping; IDictionaryEnumerator syncIdIdEnumerator = folderIdMapping.SyncIdIdEnumerator; while (syncIdIdEnumerator.MoveNext()) { string shortId = syncIdIdEnumerator.Key as string; ISyncItemId syncItemId = syncIdIdEnumerator.Value as ISyncItemId; StoreObjectId storeObjectId = syncItemId.NativeId as StoreObjectId; try { using (Folder folder = Folder.Bind(session, storeObjectId, new PropertyDefinition[] { FolderSchema.DisplayName })) { DefaultFolderType defaultFolderType = session.IsDefaultFolderType(folder.Id); syncStateFolderData.FolderMapping.Add(new FolderMappingData { ShortId = shortId, LongId = storeObjectId.ToString(), Name = folder.DisplayName, DefaultFolderType = defaultFolderType.ToString(), Exception = null }); } } catch (Exception ex) { syncStateFolderData.FolderMapping.Add(new FolderMappingData { ShortId = shortId, LongId = "[Error]", Name = "[Error]", DefaultFolderType = "[Error]", Exception = ex.ToString() }); } } } } } } }
// Token: 0x06000475 RID: 1141 RVA: 0x00020064 File Offset: 0x0001E264 internal static void AssignTagPropsToFolder(FolderTuple source, Folder target, MailboxSession session) { StoreObjectId objectId = target.Id.ObjectId; for (FolderHelper.DataColumnIndex dataColumnIndex = FolderHelper.DataColumnIndex.startOfTagPropsIndex; dataColumnIndex <= FolderHelper.DataColumnIndex.containerClassIndex; dataColumnIndex++) { PropertyDefinition key = FolderHelper.DataColumns[(int)dataColumnIndex]; object obj = source.FolderProps[key]; if (obj != null && !(obj is PropertyError)) { if (dataColumnIndex != FolderHelper.DataColumnIndex.containerClassIndex) { target[FolderHelper.DataColumns[(int)dataColumnIndex]] = obj; } else if (target.GetValueOrDefault <string>(FolderHelper.DataColumns[(int)dataColumnIndex], null) == null) { target[FolderHelper.DataColumns[(int)dataColumnIndex]] = obj; } } else if (target.GetValueOrDefault <object>(FolderHelper.DataColumns[(int)dataColumnIndex]) != null && dataColumnIndex != FolderHelper.DataColumnIndex.containerClassIndex) { target.DeleteProperties(new PropertyDefinition[] { FolderHelper.DataColumns[(int)dataColumnIndex] }); } } FolderSaveResult folderSaveResult = target.Save(); if (folderSaveResult.OperationResult != OperationResult.Succeeded) { FolderTuple.Tracer.TraceError <StoreObjectId, FolderSaveResult>(0L, "AssignTagPropsToFolder for folder {0} save result {1}", objectId, folderSaveResult); throw new IWPermanentException(Strings.descUnableToSaveFolderTagProperties(objectId.ToString(), session.MailboxOwner.ToString(), folderSaveResult.ToString())); } }
// Token: 0x060007DB RID: 2011 RVA: 0x00038E54 File Offset: 0x00037054 protected Dictionary <SynchronizableFolderType, List <FolderRow> > GetSynchronizableFolderRows(MailboxSession mailboxSession, object[][] rows) { Dictionary <SynchronizableFolderType, List <FolderRow> > dictionary = CalendarSyncAssistantHelper.CreateSynchronizableFolderRowsDictionary(); for (int i = 0; i < rows.Length; i++) { FolderRow folderRow = FolderRow.FromRawData(rows[i]); SynchronizableFolderType synchronizableFolderType = SynchronizableFolderType.FromFolderRow(folderRow); if (synchronizableFolderType != null && !this.IsDeletedItemsFolder(mailboxSession, folderRow.ParentItemId)) { StoreObjectId folderId = folderRow.FolderId; CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string, PropertyDefinition>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.GetSynchronizableFolderRows identified folder id {1} as a synchronizable folder of type {2}.", TraceContext.Get(), folderId.ToString(), synchronizableFolderType.CounterProperty); if (synchronizableFolderType.HasSubscription(mailboxSession, folderId)) { CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.GetSynchronizableFolderRows found a subscription for folder id {1}.", TraceContext.Get(), folderId.ToString()); dictionary[synchronizableFolderType].Add(folderRow); } } } return(dictionary); }