// Token: 0x06000D5D RID: 3421 RVA: 0x00032494 File Offset: 0x00030694 public ConversationRowNotificationHandler(string subscriptionId, SubscriptionParameters parameters, StoreObjectId folderId, IMailboxContext userContext, Guid mailboxGuid, ExTimeZone timeZone, bool remoteSubscription, IFeaturesManager featuresManager) : base(subscriptionId, parameters, folderId, userContext, mailboxGuid, timeZone, remoteSubscription) { this.conversationViewQuerySubscriptionProperties = ConversationRowNotificationHandler.GetSubscriptionProperties(parameters.ConversationShapeName, featuresManager); SimulatedWebRequestContext.Execute(userContext, "ConversationNotificationDraftFolderId", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger) { this.draftFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts); }); }
// Token: 0x06000D62 RID: 3426 RVA: 0x000325E4 File Offset: 0x000307E4 private static PropertyDefinition[] GetSubscriptionProperties(string requestedConversationShapeName, IFeaturesManager featuresManager) { if (string.IsNullOrEmpty(requestedConversationShapeName)) { requestedConversationShapeName = WellKnownShapeName.ConversationUberListView.ToString(); } ConversationResponseShape clientResponseShape = new ConversationResponseShape(ShapeEnum.IdOnly, new PropertyPath[0]); ConversationResponseShape responseShape = Global.ResponseShapeResolver.GetResponseShape <ConversationResponseShape>(requestedConversationShapeName, clientResponseShape, featuresManager); if (responseShape == null) { ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)requestedConversationShapeName.GetHashCode(), "[ConversationRowNotificationHandler.GetSubscriptionProperties] Unable to resolve requestedConversationShapeName: {0}", requestedConversationShapeName); return(ConversationRowNotificationHandler.defaultConversationViewQuerySubscriptionProperties); } Shape[] shapes = new Shape[] { ConversationShape.CreateShape() }; PropertyDefinition[] specialConversationProperties = ConversationRowNotificationHandler.GetSpecialConversationProperties(responseShape); return(RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, specialConversationProperties)); }
// Token: 0x06000E82 RID: 3714 RVA: 0x00036E28 File Offset: 0x00035028 public void SubscribeToRowNotification(string subscriptionId, SubscriptionParameters parameters, ExTimeZone timeZone, CallContext callContext, bool remoteSubscription) { if (parameters == null) { throw new ArgumentNullException("parameters"); } if (parameters.FolderId == null) { throw new OwaInvalidOperationException("Folder Id must be specified when subscribing to row notifications"); } if (subscriptionId == null) { throw new ArgumentNullException("subscriptionId"); } if (timeZone == null) { throw new ArgumentNullException("timeZone"); } lock (this.syncRoot) { if (!this.isDisposed) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <UserContextKey, string, string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] START userContextKey: {0} SubscriptionId: {1} ChannelId: {2}", this.userContext.Key, subscriptionId, parameters.ChannelId); RowNotificationHandler rowNotificationHandler = null; this.rowNotificationHandlerCache.TryGetHandler(subscriptionId, out rowNotificationHandler); if (rowNotificationHandler == null) { StoreObjectId storeObjectId = StoreId.EwsIdToStoreObjectId(parameters.FolderId); if (storeObjectId == null) { throw new OwaInvalidOperationException("Invalid Folder Id. Could not be converted to a storeFolderId"); } if (parameters.NotificationType == NotificationType.CalendarItemNotification) { rowNotificationHandler = new CalendarItemNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, remoteSubscription); } else if (parameters.NotificationType == NotificationType.PeopleIKnowNotification) { rowNotificationHandler = new PeopleIKnowRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, callContext.ClientCulture); } else if (parameters.IsConversation) { UserContext fullUserContext = this.GetFullUserContext("Conversation row notification"); rowNotificationHandler = new ConversationRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, remoteSubscription, fullUserContext.FeaturesManager); } else { UserContext fullUserContext2 = this.GetFullUserContext("MessageItem row notification"); rowNotificationHandler = new MessageItemRowNotificationHandler(subscriptionId, parameters, storeObjectId, this.userContext, this.userContext.ExchangePrincipal.MailboxInfo.MailboxGuid, timeZone, fullUserContext2.FeaturesManager); } try { ExTraceGlobals.NotificationsCallTracer.TraceDebug <UserContextKey, string, string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} New subscription for subscriptionId: {1} ChannelId: {2}", this.userContext.Key, subscriptionId, parameters.ChannelId); this.WireConnectionDroppedHandler(rowNotificationHandler); rowNotificationHandler.Subscribe(); rowNotificationHandler.OnBeforeDisposed += this.BeforeDisposeRowNotificationHandler; this.rowNotificationHandlerCache.AddHandler(subscriptionId, rowNotificationHandler, parameters.ChannelId); rowNotificationHandler = null; goto IL_319; } finally { if (rowNotificationHandler != null) { try { this.userContext.LockAndReconnectMailboxSession(3000); rowNotificationHandler.Dispose(); rowNotificationHandler = null; } catch (OwaLockTimeoutException ex) { ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] User context lock timed out in attempt to dispose handler. Exception: {0}", ex.Message); } finally { if (this.userContext.MailboxSessionLockedByCurrentThread()) { this.userContext.UnlockAndDisconnectMailboxSession(); } } } } } ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} Reusing existing notification handler subscriptionId: {1} ChannelId: {2} Current RefCount: {3}. Setting MissedNotifications = false", new object[] { this.userContext.Key, subscriptionId, parameters.ChannelId, rowNotificationHandler.RefCount }); rowNotificationHandler.MissedNotifications = false; if (rowNotificationHandler.NeedToReinitSubscriptions) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[OwaMapiNotificationManager::SubscribeToRowNotification] userContextKey: {0} Need to re-init subscriptionId: {1} ChannelId: {2} Refcount: {3}", new object[] { this.userContext.Key, subscriptionId, parameters.ChannelId, rowNotificationHandler.RefCount }); rowNotificationHandler.Subscribe(); } this.rowNotificationHandlerCache.AddHandler(subscriptionId, rowNotificationHandler, parameters.ChannelId); } IL_319 :; } }