private void EnsureOneDriveProDataProvider(CallContext callContext, PolymorphicConfiguration <AttachmentDataProvider> attachmentDataProvidersConfig, UserContext userContext) { if (!this.useMockAttachmentDataProvider) { if (!this.isOneDriveProProviderAvailable) { return; } if (!userContext.IsBposUser) { return; } } if (!this.dataProviders.Values.Any((AttachmentDataProvider x) => x.GetType() == typeof(OneDriveProAttachmentDataProvider))) { lock (this.lockObject) { if (!this.dataProviders.Values.Any((AttachmentDataProvider x) => x.GetType() == typeof(OneDriveProAttachmentDataProvider))) { OneDriveProAttachmentDataProvider oneDriveProAttachmentDataProvider = OneDriveProAttachmentDataProvider.CreateFromBpos(userContext, callContext, this.useMockAttachmentDataProvider); if (oneDriveProAttachmentDataProvider != null) { this.AddProviderInternal(callContext, attachmentDataProvidersConfig, oneDriveProAttachmentDataProvider); } } } } }
public GetAttachmentDataProviderItemsResponse GetGroups(CallContext callContext, MailboxSession mailboxSession) { AttachmentDataProvider attachmentDataProvider = this.GetDefaultUploadDataProvider(callContext); GetAttachmentDataProviderItemsResponse getAttachmentDataProviderItemsResponse; if (attachmentDataProvider is OneDriveProAttachmentDataProvider) { OneDriveProAttachmentDataProvider oneDriveProAttachmentDataProvider = (OneDriveProAttachmentDataProvider)attachmentDataProvider; getAttachmentDataProviderItemsResponse = oneDriveProAttachmentDataProvider.GetGroups(mailboxSession); } else { getAttachmentDataProviderItemsResponse = new GetAttachmentDataProviderItemsResponse(); getAttachmentDataProviderItemsResponse.Items = new AttachmentDataProviderItem[0]; getAttachmentDataProviderItemsResponse.TotalItemCount = 0; getAttachmentDataProviderItemsResponse.ResultCode = AttachmentResultCode.GenericFailure; } return(getAttachmentDataProviderItemsResponse); }
// Token: 0x06000806 RID: 2054 RVA: 0x0001A83C File Offset: 0x00018A3C private static WacConfigData GetWacConfigData(UserContext userContext) { WacConfigData wacConfigData = new WacConfigData(); if (userContext == null) { throw new NullReferenceException("Retail assert: UserContext is null."); } if (userContext.FeaturesManager == null) { throw new NullReferenceException("Retail assert: UserContext.FeaturesManager is null."); } if (WacConfiguration.Instance == null) { throw new NullReferenceException("Retail assert: WacConfiguration.Instance is null."); } if (WacDiscoveryManager.Instance == null) { throw new NullReferenceException("Retail assert: WacDiscoveryManager.Instance is null."); } if (WacDiscoveryManager.Instance.WacDiscoveryResult == null) { throw new NullReferenceException("Retail assert: WacDiscoveryManager.Instance.WacDiscoveryResult is null."); } if (!WacConfiguration.Instance.BlockWacViewingThroughUI) { if (userContext.FeaturesManager.ClientServerSettings.DocCollab.Enabled || userContext.FeaturesManager.ClientServerSettings.ModernAttachments.Enabled) { wacConfigData.IsWacEditingEnabled = WacConfiguration.Instance.EditingEnabled; } else { wacConfigData.IsWacEditingEnabled = false; } try { wacConfigData.WacViewableFileTypes = WacDiscoveryManager.Instance.WacDiscoveryResult.WacViewableFileTypes; wacConfigData.WacEditableFileTypes = WacDiscoveryManager.Instance.WacDiscoveryResult.WacEditableFileTypes; wacConfigData.WacDiscoverySucceeded = true; } catch (WacDiscoveryFailureException ex) { OwaDiagnostics.PublishMonitoringEventNotification(ExchangeComponent.OwaDependency.Name, "DocCollab", ex.Message, ResultSeverityLevel.Error); wacConfigData.WacViewableFileTypes = new string[0]; wacConfigData.WacEditableFileTypes = new string[0]; wacConfigData.WacDiscoverySucceeded = false; wacConfigData.IsWacEditingEnabled = false; } } if (userContext.IsBposUser) { string text; string text2; wacConfigData.OneDriveDiscoverySucceeded = OneDriveProAttachmentDataProvider.TryGetBposDocumentsInfoFromBox(userContext, CallContext.Current, out text, out text2); wacConfigData.OneDriveDocumentsUrl = (text ?? string.Empty); wacConfigData.OneDriveDocumentsDisplayName = (text2 ?? string.Empty); } else { wacConfigData.OneDriveDiscoverySucceeded = true; wacConfigData.OneDriveDocumentsUrl = string.Empty; wacConfigData.OneDriveDocumentsDisplayName = string.Empty; } return(wacConfigData); }